menu GetProp
menu GetProp {name} {property}- Sets
#MenuRes
Also searchable as: menu GetProp · property · read property
menu GetProp puts one property of a control, or of a window made by menu Form
(the main window is form0), into #MenuRes.
menu SetProp changes them.
Parameters
Section titled “Parameters”| Parameter | Meaning |
|---|---|
name |
The control or window. |
property |
One of the properties below; not case-sensitive. |
Text comes back as it is, numbers in decimal, and yes/no as -1 / 0. When the control or the property
does not exist, #MenuRes is left as it was.
Properties
Section titled “Properties”| Property | What it is | Kind | Controls |
|---|---|---|---|
alignment |
Text alignment: 0 left, 1 right, 2 centre | number | text, check, radio |
checked |
Checked or not | yes/no | check, radio |
color |
Background colour | number | all but image |
enabled |
Can be used | yes/no | all |
fontcolor |
Text colour | number | all but form, panel, image |
fontname |
Font | text | all but form, panel, image |
fontsize |
Font size in points | number | all but form, panel, image |
fontstyle |
Sum of 1 bold, 2 italic, 4 underline, 8 strike-out | number | all but form, panel, image |
height, width |
Size; for a form, of its inside | number | all |
left, top |
Position, inside the parent (on the screen for a form) | number | all |
parent |
Name of the window or panel it is in | text | all but form |
text |
The label, caption or title; an edit’s contents | text | form, text, button, edit, check, radio |
tooltip |
The hint shown when the mouse rests on it | text | all |
visible |
Shown or hidden | yes/no | all |
Colours are numbers in Windows’ order, $BBGGRR. System colours come back as negative numbers:
the standard button colour, btnface, is -16777201.
Example
Section titled “Example”menu Edit name 10 10 120 Bobmenu Showmenu GetProp name widthset %w #MenuResmenu GetProp name textdisplay ok The field is %w pixels wide and says #MenuReshaltThese are quirks of EasyUO 1.6, kept as they are:
- A check box’s
alignmentreads 0 when its text is on the right and 1 when it is on the left; a radio button’s the other way round. parentof a control whose window or panel has no name (one created with a name already taken) gives the last text anymenu GetPropormenu GetDefreturned, not an empty value.
See also
The EasyUO 1.6 behaviour on this page was researched with help from the ScriptUO community: Gaderian's tutorial New Menu Code and how to adapt old scripts and the scripts its members share at scriptuo.com.