Some methods are now const.

This commit is contained in:
haru-s 2023-12-30 17:03:33 +09:00
parent 8aa40dc9f6
commit 6bbb421b4a
6 changed files with 21 additions and 21 deletions

View file

@ -817,7 +817,7 @@ final class Application // docmain
}
override Dstring toString()
override Dstring toString() const
{
return errBox.text;
}

View file

@ -2107,7 +2107,7 @@ class Control: DObject, IWindow // docmain
///
final @property bool isHandleCreated() // getter
final @property bool isHandleCreated() const // getter
{
return hwnd != HWND.init;
}
@ -2744,9 +2744,9 @@ class Control: DObject, IWindow // docmain
}
private final Dstring _fetchText()
private final Dstring _fetchText() const
{
return dfl.internal.utf.getWindowText(hwnd);
return dfl.internal.utf.getWindowText(cast(void*)hwnd);
}
@ -2771,7 +2771,7 @@ class Control: DObject, IWindow // docmain
}
/// ditto
@property Dstring text() // getter
@property Dstring text() const // getter
{
if(isHandleCreated)
{
@ -4228,7 +4228,7 @@ class Control: DObject, IWindow // docmain
}
override Dstring toString()
override Dstring toString() const
{
return text;
}

View file

@ -512,7 +512,7 @@ class StatusBar: ControlSuperClass // docmain
}
/// ditto
override @property Dstring text() // getter
override @property Dstring text() const // getter
{
return this._simpletext;
}

View file

@ -47,7 +47,7 @@ class TabPage: Panel
}
override Dstring toString()
override Dstring toString() const
{
return text;
}
@ -56,13 +56,13 @@ class TabPage: Panel
alias opEquals = Control.opEquals;
override Dequ opEquals(Object o)
override Dequ opEquals(Object o) const
{
return text == getObjectString(o);
}
Dequ opEquals(Dstring val)
Dequ opEquals(Dstring val) const
{
return text == val;
}
@ -71,13 +71,13 @@ class TabPage: Panel
alias opCmp = Control.opCmp;
override int opCmp(Object o)
override int opCmp(Object o) const
{
return stringICmp(text, getObjectString(o));
}
int opCmp(Dstring val)
int opCmp(Dstring val) const
{
return stringICmp(text, val);
}

View file

@ -575,7 +575,7 @@ abstract class TextBoxBase: ControlSuperClass // docmain
}
override Dstring toString()
override Dstring toString() const
{
return text; // ?
}

View file

@ -447,7 +447,7 @@ class TreeNode: DObject
}
/// ditto
final @property Dstring text() // getter
final @property Dstring text() const // getter
{
return ttext;
}
@ -597,39 +597,39 @@ class TreeNode: DObject
}
override Dstring toString()
override Dstring toString() const
{
return ttext;
}
override Dequ opEquals(Object o)
override Dequ opEquals(Object o) const
{
return 0 == stringICmp(ttext, getObjectString(o)); // ?
}
Dequ opEquals(TreeNode node)
Dequ opEquals(TreeNode node) const
{
return 0 == stringICmp(ttext, node.ttext);
}
Dequ opEquals(Dstring val)
Dequ opEquals(Dstring val) const
{
return 0 == stringICmp(ttext, val);
}
override int opCmp(Object o)
override int opCmp(Object o) const
{
return stringICmp(ttext, getObjectString(o)); // ?
}
int opCmp(TreeNode node)
int opCmp(TreeNode node) const
{
return stringICmp(ttext, node.ttext);
}
int opCmp(Dstring val)
int opCmp(Dstring val) const
{
return stringICmp(text, val);
}