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