-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathTestDrawnCheck.jsx
More file actions
127 lines (111 loc) · 3.04 KB
/
TestDrawnCheck.jsx
File metadata and controls
127 lines (111 loc) · 3.04 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
127
#include '../../$$.jsxinc'
#include '../../etc/$$.ScriptUI.jsxinc'
#include '../../etc/ScriptUI/factories/$$.DrawnCheck.jsxinc'
// Load your custom icon functions:
ScriptUI.DrawnCheckFactory.Icons.setup
({
LAYER: function LAYER(/*ScriptUIGraphics*/gx,/*ScriptUIPen*/pen,/*ScriptUIBrush*/bh)
//----------------------------------
// this :: Group[[DrawnCheck]]
{
gx.newPath();
gx.draw(9,3)(3,7)(9,11)(15,7)(9,3);
gx.strokePath(pen);
gx.fillPath(bh);
gx.newPath();
gx.draw(3,10)(9,14)(15,10);
gx.strokePath(pen);
},
FLASH: function FLASH(/*ScriptUIGraphics*/gx,/*ScriptUIPen*/pen)
//----------------------------------
// this :: Group[[DrawnCheck]]
{
gx.newPath();
gx.draw(13,4)(9,4)(5,10)(8,10)(7,14)(8,14)(13,8)(10,8)(13,4);
this.enabled
? gx.fillPath(gx.newBrush(0,[1,1,.2, 1]))
: gx.strokePath(pen);
},
TABLE: function TABLE(/*ScriptUIGraphics*/gx,/*ScriptUIPen*/pen)
//----------------------------------
// this :: Group[[DrawnCheck]]
{
gx.newPath();
gx.draw(5,5)(13,5)(13,13)(5,13)(5,5);
gx.draw(9,5)(9,13);
gx.draw(5,9)(13,9);
gx.strokePath(pen);
},
// etc
});
$$.load();
// =============================================================================
// TestDrawnCheck [220307]
// DrawnCheckFactory tester.
// =============================================================================
try
{
ScriptUI.builder
({
properties: { type:'dialog', text:"Test DrawnCheckFactory" },
margins: 20,
spacing: 5,
orientation: 'column',
Group$0:
{
optimalSize: [320,50],
orientation: 'column',
alignChildren: ScriptUI.LC,
margins: [50,8,2,8],
StaticText$:
{
properties: { text: __("Three styles of DrawnCheck elements:") },
},
},
Group$1:
{
orientation: 'row',
alignment: ScriptUI.CC,
spacing: 10,
DrawnCheckFactory$1:
[{
icon: 'LAYER',
value: 0,
help: __("Layer (toggles.)"),
}],
DrawnCheckFactory$2:
[{
icon: 'FLASH',
value: 0,
locked: true,
help: __("Click this button..."),
onClickChange: function()
{
alert("So you've clicked the flash. This will toggle the Table icon.");
this.window.Table.value ^= 1;
},
}],
DrawnCheckFactory$Table:
[{
icon: 'TABLE',
value: 0,
ignoreClick: true,
help: __("Table (state icon.)"),
}],
},
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();