DialogControls-CheckBoxes
TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here.
Checkboxes
The Checkboxes are a set of state change buttons, ordered by columns and rows. Unlike the Toolbox Control more than one button can become active.
Properties | ||
---|---|---|
Name | Type | Remark |
idc | integer | the unique ID number of this dialog. Can be -1 if you don't require access to the dialog itself from within a script. |
colorText | color array | color of the control text. |
color | color array | color of border from selected entry, if other control has focus. |
colorTextSelect | color array | color of text if selected |
colorSelect | color array | color of border from selected entry. |
colorTextDisable | color array | color of control text, if control is disabled. |
colorDisable | color array | seems nothing to change, but define it to avoid errors. |
font | float | the font to use. See the list of available fonts for possible values |
sizeEx | float | the font size of text (0 to 1) |
rows | integer | amount of rows to display |
columns | integer | amount of columns to display |
color | color array | color of the control surrounding lines. |
strings | string array | text for each toolbox entry |
Checkboxes corresponding type property is CT_CHECKBOXES.
- Example:
class MyRscCheckBoxes {
idc = 200;
type = CT_CHECKBOXES; // defined contant (7)
style = ST_CENTER; // defined constat (0)
x = 0.1;
y = 0.18;
w = 0.15;
h = 0.15;
colorText[] = {1, 0, 0, 1};
color[] = {0, 1, 0, 1}; //seems nothing to change, but define to avaoid errors
colorTextSelect[] = {0, 0.8, 0, 1};
colorSelect[] = {0, 0, 0, 1};
colorTextDisable[] = {0.4, 0.4, 0.4, 1};
colorDisable[] = {0.4, 0.4, 0.4, 1};
font = "Zeppelin32";
sizeEx = 0.0208333;
rows = 3;
columns = 2;
strings[] = {"Entry 1","Entry 2","Entry 3","Entry 4","Entry 5","Entry 6"};
//Simple UI event handler to show response on clicks
onCheckBoxesSelChanged = "hint format[""Checkbox change:\n%1\nEntry#: %2\nNewState: %3"",(_this select 0),(_this select 1),(_this select 2)];"
};
Notice: As you see in the example image, the returned entry number from the onCheckBoxesSelChanged event handler starts at zero (0)! So if you have 6 toolbox entrys, the first is 0 and the last is 5! Notice: You must add this line : coloSelectedBg[] = {0, 0, 0, 0}; (for setting the selected box color)