forked from ff6347/debugging-ae-scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
example_panel.jsx
66 lines (49 loc) · 1.6 KB
/
example_panel.jsx
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
{
#include 'debug_writer.jsx';
var DBug = new Debugger();
run_script(this);
function run_script(thisObj){
// this is global
myMetaObject = new Object();
myMetaObject.settings = {
setting1 : false,
setting2 : false
};
/// THIS WILL CHECK IF PANEL IS DOCKABLE OR FLAOTING WINDOW
var win = buildUI(thisObj , myMetaObject );
if ((win != null) && (win instanceof Window)) {
win.center();
win.show();
}; // end if win null and not a instance of window
};// close run_script
function buildUI (thisObj , metaObject ) {
var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'example',[0,0,150,260],{resizeable: true});
if (win != null) {
var H = 25; // the height
var W1 = 30; // the width
var G = 5; // the gutter
var x = G;
var y = G;
// var yuioff = G; // and some offset
win.sequence_check = win.add('checkbox',[x,y,x+W1*2,y + H],'check');
win.sequence_check.value = metaObject.setting1;
win.export_button = win.add('button', [x + W1*2 -G*2,y,x+W1*5,y + H], 'run');
win.help_button = win.add('button', [x + W1*5+ G,y,x + W1*6,y + H], '?');
win.sequence_check.onClick = function (){
alert("check");
DBug.debugstrings.push("in check");
};
win.help_button.onClick = function () {
alert("help");
}
win.export_button.onClick = function(){
main(metaObject);
};
}
return win
}
function main(metaobj){
alert("in function main. From here on it is a straight run");
DBug.write_infos();
};
}