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