Builder/Window.js
[app.Builder.js] / Builder / Window.js
1 //<Script type="text/javascript">
2
3 Gtk = imports.gi.Gtk;
4
5 XObject = imports.XObject;
6 console = imports.console;
7
8   
9 // concept:
10 /**
11  * 
12  * left - tree + props
13  * right - top = preview - webkit?
14  * right - bottom = soruceview
15  * 
16  * Palete... as toolbar??? - changes depending on what you pick?
17  * 
18  * Not sure how to do Gtk version.. - our preview might be fun... = probably have to do a gtkhbox.. or something..
19  * 
20  */
21  
22  
23  
24 var _win;
25 var _left;
26  
27 //print('window loaded');
28
29 Window = new XObject({
30     
31     id: 'Builder.Window',
32     
33     xtype : 'Gtk.Window',
34     
35     type: Gtk.WindowType.TOPLEVEL,
36     title : "Application Builder",
37     border_width : 0,
38     
39     init : function()
40     {
41         this.get('MidPropTree').hideWin();
42         this.get('RightPalete.palete').hide();
43         
44         this.el.set_default_size(900, 600);
45         XObject.prototype.init.call(this); 
46     }
47     
48     listeners : {
49         'delete-event' : function (widget, event) {
50             return false;
51         },
52         destroy  : function (widget) {
53             Gtk.main_quit();
54         },
55          
56     },
57     
58         
59         items : [
60             {
61                 xtype : 'VBox',
62                 xns: 'Gtk',
63                 items : [
64                     
65                     {
66                         xtype : 'Include',
67                         xns : 'xnew',
68                         cls : Builder.TopMenu
69                     },
70                     
71                     
72                     {
73                         xtype : 'HPaned',
74                         xns: 'Gtk',
75                         set : {
76                                 set_position : [ 400 ]
77                         },
78                         listeners : {
79                             _new : function(self) {
80                                 _left = this;
81                             }
82                         },
83                         items : [
84                             // in my original design - the child elements get loaded by a 'module loader...',
85                               
86                             {
87                                 xtype : 'HBox',
88                                 xns: 'Gtk',
89                                 
90                         
91                                 items : [
92                                     
93                                    
94                                     {
95                                         xtype : 'VPaned',
96                                         xns: 'Gtk',
97                                         listeners : {
98                                             _new  : function()
99                                             {
100                                                 _leftvpaned = this;
101                                             }
102                                         },
103                                         set : {
104                                             set_position : [ 300 ]
105                                         },
106                                         items : [
107                                            
108                                                      
109                                             {
110                                                 xtype : 'Include',
111                                                 xns : 'xnew',
112                                                 cls : Builder.LeftTopPanel
113                                             },
114                                             
115                                                     
116                                             {
117                         
118                                                 xns : 'Gtk',
119                                                 xtype: 'VBox',
120                                                 
121                                                 items : [
122                                               
123                                                     {
124                                 
125                                                         xns : 'Gtk',
126                                                         xtype: 'HBox',
127                                                         packing : [ 'pack_start', false, true, 0 ],
128                                                         items : [   
129                                                             {
130                                                                 xtype : 'Include',
131                                                                 xns : 'xnew',
132                                                                 cls : Builder.LeftProps
133                                                             }
134                                                          
135                                                         ]
136                                                     },
137                                                     {
138                                                         xtype : 'Include',
139                                                         xns : 'xnew',
140                                                         cls : Builder.LeftPanel
141                                                     }
142                                                     
143                                                 ]
144                                             }
145                                             //LeftProps.add()
146                                         ]
147                                     },
148                                     {
149                                         xtype : 'Include',
150                                         xns : 'xnew',
151                                         cls : Builder.MidPropTree
152                                     }
153                                     
154                                 ]
155                             },
156                                     
157                                     
158                             {
159                                 xtype : 'HBox',
160                                 xns: 'Gtk',
161                                 
162                         
163                                 items : [
164                            
165                                 
166                                     {
167                                         xtype : 'VPaned',
168                                         xns: 'Gtk',
169                                         set : {
170                                             set_position : [ 300 ]
171                                         },
172                                         items : [
173                                             {
174                                                 xtype : 'VBox',
175                                                 xns: 'Gtk',
176                                                 items : [
177                                                     {
178                                                         xtype : 'Include',
179                                                         xns : 'xnew',
180                                                         cls : Builder.RightBrowser
181                                                     },
182                                                     {
183                                                         xtype : 'Expander',
184                                                         xns: 'Gtk',
185                                                         label : 'Console',
186                                                         packing : ['pack_start', false , false ],
187                                                         set : {
188                                                             //set_position : [ 300 ]
189                                                         },
190                                                         items : [
191                                                         //    Builder.ProjectTree.create()
192                                                             {
193                                                                 xtype : 'Button',
194                                                                 xns: 'Gtk',
195                                                                 label : 'Console Goes here'
196                                                             }
197                                                         ]
198                                                     }
199                                                    
200                                                   
201                                                             
202                                                       
203                                                    
204                                                 ]
205                                             },
206                                         
207                                         
208                                            
209                                             {
210                                                 xtype : 'Include',
211                                                 xns : 'xnew',
212                                                 cls : Builder.RightEditor
213                                             }
214                                            
215                                            
216                                            
217                                           
218                                             //LeftProps.add()
219                                         ]
220                                     },
221                                     
222                                     {
223                                         xtype : 'Include',
224                                         xns : 'xnew',
225                                         cls : Builder.RightPalete
226                                     }
227                                    
228                                     
229                                     
230                                    
231                                 ]
232                             }
233                         ]
234                     }
235                     
236                 ]
237            }
238                     
239         ]
240 }); 
241  
242     
243  
244  
245