-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathTestSideMenu.jsx
More file actions
126 lines (112 loc) · 3.53 KB
/
TestSideMenu.jsx
File metadata and controls
126 lines (112 loc) · 3.53 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#include '../../$$.jsxinc'
#include '../../etc/$$.ScriptUI.jsxinc'
#include '../../etc/ScriptUI/factories/$$.Popup.jsxinc'
#include '../../etc/ScriptUI/factories/$$.SideMenu.jsxinc'
$$.load(0);
// =============================================================================
// TestSideMenu [220807]
// SideMenuFactory tester. (Also using a Popup.)
// Added custom property though the `more` option.
// =============================================================================
try
{
ScriptUI.builder
({
properties: { type:'dialog', text:"Test SideMenuFactory" },
margins: 0,
spacing: 0,
orientation: 'stack',
Group$0:
{
margins: 20,
spacing: 20,
orientation: 'column',
Group$0:
{
orientation: 'row',
alignChildren: ScriptUI.LT,
margins: 0,
spacing: 20,
SideMenuFactory$MyMenu:
[{
// Note that the below keys start with `$` and match the panel keys
// declared outside the SideMenu. See Group$Features components.
$Feat1: [__("My feature 1"), __("This amazing feature allows you to blablabla.")],
$Feat2: [__("My feature 2"), __("Here is another great tool powered by this script.")],
$Feat3: [__("My feature 3"), __("Finally, you can now experience the best feature ever.")],
// --- Other options
value: 1,
autoFocus: true,
optWidth: 100,
barWidth: 2,
onClickChange: function onClickChange()
{
this.popup( __("You are now entering Feature #%1 area.",1+this.value), 1, 1.5 );
},
more:
{
someCustomProp: "Hello World!",
_layout: function(){ alert("Before we show you the dialog, here is the custom prop:\r" + this.someCustomProp) },
},
}],
Group$Features:
{
orientation: 'stack',
alignChildren: ScriptUI.LT,
margins: 0,
spacing: 0,
Panel$Feat1:
{
optimalSize: [300,250],
alignChildren: ScriptUI.LT,
background: 0x336699,
StaticText$0: { properties: {text:__("Feature 1:")} },
EditText$1: { properties: {text:__("Enter some text")} },
},
Panel$Feat2:
{
optimalSize: [300,250],
alignChildren: ScriptUI.LT,
background: 0x662200,
StaticText$0: { properties: {text:__("Feature 2:")} },
Checkbox$1: { properties: {text:__("That's my first option")} },
Checkbox$2: { properties: {text:__("Then my second choice")} },
},
Panel$Feat3:
{
optimalSize: [300,250],
alignChildren: ScriptUI.LT,
background: 0x009922,
StaticText$0: { properties: {text:__("Feature 3:")} },
Listbox$1:
{
properties: { items:["item1","item2","item3","item4"] },
optimalSize: [120,100],
},
},
},
},
Group$1:
{
optimalSize: [320,40],
margins: 20,
orientation: 'row',
alignChildren: ScriptUI.CC,
Button$OK: { properties: { text: __("OK"), name: 'ok'} },
Button$KO: { properties: { text: __("Cancel"), name: 'cancel'} },
},
},
PopupFactory$MyPopup:
[{
auto: 1,
margins: 25,
xOffset: 20,
}],
})
.show();
}
catch(e)
{
$$.receiveError(e);
}
$$.unload();