Hi Sam,
I need to clarify these properties.
What the user types inside the editBox is accessed (changed or retrieved) through the '
contents' property.
For all windows and controls, 'text' is the caption (The text that shows in the title bar, if it has one). We plan to rename this property to 'caption' in the future to avoid this confusion. For controls, the 'text' property can be used to label them, i.e. the label will be connected to the control (through the '
labeledWindow' property) and will name itself from the control. (For the label to use the text of the control, its own (the label's) 'text' property must
not be set.)
One advantage of this is that when you click on the label it will activate the labeled control. The hotKey of the control will also be underlined on the label.
Here is an example of how to set this up:
Code: Select all
import "ecere"
class Form1 : Window
{
text = "Form1";
background = activeBorder;
borderStyle = sizable;
hasMaximize = true;
hasMinimize = true;
hasClose = true;
size = { 576, 432 };
EditBox editBox1 { this, text = "EditBox1", hotKey = altE, size = { 486, 19 }, position = { 32, 32 } };
Label lblEditBox1 { this, position = { 32, 8 }, labeledWindow = editBox1 };
EditBox editBox2 { this, foreground = green, font = { "Times New Roman", 26 }, size = { 478, 59 }, position = { 32, 136 } };
Label label1 { this, text = "label1", foreground = orangeRed, font = { "Times New Roman", 26 }, size = { 516, 53 }, position = { 32, 72 } };
Button btnShow
{
this, text = "(O)显示", altO, size = { 68, 29 }, position = { 240, 216 };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
editBox2.contents=editBox1.contents;
label1.text=editBox1.contents;
return true;
}
};
}
Form1 form1 {};
Regards,
Jerome