-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathTestCheck.jsx
More file actions
96 lines (84 loc) · 2.78 KB
/
TestCheck.jsx
File metadata and controls
96 lines (84 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include '../../$$.jsxinc'
#include '../../etc/$$.ScriptUI.jsxinc'
#include '../../etc/ScriptUI/factories/$$.Check.jsxinc'
$$.load();
// =============================================================================
// TestCheck [210810]
// CheckFactory tester.
// =============================================================================
try
{
ScriptUI.builder
({
properties: { type:'dialog', text:"Test CheckFactory" },
margins: 20,
spacing: 5,
orientation: 'column',
Group$0:
{
optimalSize: [320,50],
orientation: 'column',
alignChildren: ScriptUI.LC,
margins: [50,8,2,8],
background: $$.isDark ? 0x223344 : 0xCCDDEE,
Checkbox$MyCheckbox:
{
properties: { text: __("Native ScriptUI Checkbox"), },
value: false,
},
},
Group$1:
{
optimalSize: [320,80],
orientation: 'column',
alignChildren: ScriptUI.LC,
margins: [50,8,2,8],
background: $$.isDark ? 0x334455 : 0xBBCCDD,
CheckFactory$MyCheck1:
[{
text: __("Binary Check (with custom box)"),
value: 0,
ternary: false,
help: __("Right-click the control to change its label..."),
onRightClick: function onRightClick(){ this.text=String.random(30); },
}],
CheckFactory$MyCheck2:
[{
text: __("Ternary Check"),
value: 0,
ternary: true,
help: __("This help message will update on click."),
onClickChange: function onClickChange(){ this.helpTip=__("Current value: %1.",this.value); },
}],
CheckFactory$MyCheck3:
[{
text: __("Native Binary Widget"),
value: 0,
customBox: false,
help: __("This Check component is drawn using a native checkbox widget."),
}],
CheckFactory$MyCheck4: [__("Minimal declaration")],
CheckFactory$MyCheck5:
[{
text: __("Emulates a radio button"),
value: 0,
radio: true,
help: __("This Check component is drawn like a radio button."),
}],
},
Group$2:
{
margins: [20,20,20,0],
orientation: 'row',
alignChildren: ScriptUI.CC,
Button$OK: { properties: { text: __("OK"), name: 'ok'} },
Button$KO: { properties: { text: __("Cancel"), name: 'cancel'} },
},
})
.show();
}
catch(e)
{
$$.receiveError(e);
}
$$.unload();