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.el.show_all();
43         this.get('MidPropTree').hideWin();
44         this.get('RightPalete.palete').hide();
45         
46         this.el.set_default_size(900, 600);
47         XObject.prototype.init.call(this); 
48     }
49     
50     listeners : {
51         'delete-event' : function (widget, event) {
52             return false;
53         },
54         destroy  : function (widget) {
55             Gtk.main_quit();
56         },
57          
58     },
59     
60         
61     items : [
62         {
63             xtype : Gtk.VBox,
64             items : [
65                 
66                 TopMenu
67                 
68                 
69                 {
70                     xtype : 'HPaned',
71                     xns: 'Gtk',
72                     set : {
73                             set_position : [ 400 ]
74                     },
75                     listeners : {
76                         _new : function(self) {
77                             _left = this;
78                         }
79                     },
80                     items : [
81                         // in my original design - the child elements get loaded by a 'module loader...',
82                           
83                         {
84                             xtype : 'HBox',
85                             xns: 'Gtk',
86                             
87                     
88                             items : [
89                                 
90                                
91                                 {
92                                     xtype : 'VPaned',
93                                     xns: 'Gtk',
94                                     listeners : {
95                                         _new  : function()
96                                         {
97                                             _leftvpaned = this;
98                                         }
99                                     },
100                                     set : {
101                                         set_position : [ 300 ]
102                                     },
103                                     items : [
104                                        
105                                                  
106                                         {
107                                             xtype : 'Include',
108                                             xns : 'xnew',
109                                             cls : Builder.LeftTopPanel
110                                         },
111                                         
112                                                 
113                                         {
114                     
115                                             xns : 'Gtk',
116                                             xtype: 'VBox',
117                                             
118                                             items : [
119                                           
120                                                 {
121                             
122                                                     xns : 'Gtk',
123                                                     xtype: 'HBox',
124                                                     packing : [ 'pack_start', false, true, 0 ],
125                                                     items : [   
126                                                         {
127                                                             xtype : 'Include',
128                                                             xns : 'xnew',
129                                                             cls : Builder.LeftProps
130                                                         }
131                                                      
132                                                     ]
133                                                 },
134                                                 {
135                                                     xtype : 'Include',
136                                                     xns : 'xnew',
137                                                     cls : Builder.LeftPanel
138                                                 }
139                                                 
140                                             ]
141                                         }
142                                         //LeftProps.add()
143                                     ]
144                                 },
145                                 {
146                                     xtype : 'Include',
147                                     xns : 'xnew',
148                                     cls : Builder.MidPropTree
149                                 }
150                                 
151                             ]
152                         },
153                                 
154                                 
155                         {
156                             xtype : 'HBox',
157                             xns: 'Gtk',
158                             
159                     
160                             items : [
161                        
162                             
163                                 {
164                                     xtype : 'VPaned',
165                                     xns: 'Gtk',
166                                     set : {
167                                         set_position : [ 300 ]
168                                     },
169                                     items : [
170                                         {
171                                             xtype : 'VBox',
172                                             xns: 'Gtk',
173                                             items : [
174                                                 {
175                                                     xtype : 'Include',
176                                                     xns : 'xnew',
177                                                     cls : Builder.RightBrowser
178                                                 },
179                                                 {
180                                                     xtype : 'Expander',
181                                                     xns: 'Gtk',
182                                                     label : 'Console',
183                                                     packing : ['pack_start', false , false ],
184                                                     set : {
185                                                         //set_position : [ 300 ]
186                                                     },
187                                                     items : [
188                                                     //    Builder.ProjectTree.create()
189                                                         {
190                                                             xtype : 'Button',
191                                                             xns: 'Gtk',
192                                                             label : 'Console Goes here'
193                                                         }
194                                                     ]
195                                                 }
196                                                
197                                               
198                                                         
199                                                   
200                                                
201                                             ]
202                                         },
203                                     
204                                     
205                                        
206                                         {
207                                             xtype : 'Include',
208                                             xns : 'xnew',
209                                             cls : Builder.RightEditor
210                                         }
211                                        
212                                        
213                                        
214                                       
215                                         //LeftProps.add()
216                                     ]
217                                 },
218                                 
219                                 {
220                                     xtype : 'Include',
221                                     xns : 'xnew',
222                                     cls : Builder.RightPalete
223                                 }
224                                
225                                 
226                                 
227                                
228                             ]
229                         }
230                     ]
231                 }
232                 
233             ]
234        }
235                 
236     ]
237 }); 
238  
239     
240  
241  
242