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