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 LeftProps       = imports.Builder.LeftProps.LeftProps;
12 LeftPanel       = imports.Builder.LeftPanel.LeftPanel;
13 MidPropTree     = imports.Builder.MidPropTree.MidPropTree;
14 // concept:
15 /**
16  * 
17  * left - tree + props
18  * right - top = preview - webkit?
19  * right - bottom = soruceview
20  * 
21  * Palete... as toolbar??? - changes depending on what you pick?
22  * 
23  * Not sure how to do Gtk version.. - our preview might be fun... = probably have to do a gtkhbox.. or something..
24  * 
25  */
26  
27  
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                                                     pack : [ 'pack_start', false, true, 0 ],
90                                                     items : [    LeftProps ]
91                                                 },
92                                                 LeftPanel
93                                                 
94                                             ]
95                                         }
96                                         //LeftProps.add()
97                                     ]
98                                 },
99                                 MidPropTree
100                                 
101                             ]
102                         },
103                                 
104                                 
105                         {
106                             xtype : 'HBox',
107                             xns: 'Gtk',
108                             
109                     
110                             items : [
111                        
112                             
113                                 {
114                                     xtype : 'VPaned',
115                                     xns: 'Gtk',
116                                     set : {
117                                         set_position : [ 300 ]
118                                     },
119                                     items : [
120                                         {
121                                             xtype : 'VBox',
122                                             xns: 'Gtk',
123                                             items : [
124                                                 {
125                                                     xtype : 'Include',
126                                                     xns : 'xnew',
127                                                     cls : Builder.RightBrowser
128                                                 },
129                                                 {
130                                                     xtype : 'Expander',
131                                                     xns: 'Gtk',
132                                                     label : 'Console',
133                                                     packing : ['pack_start', false , false ],
134                                                     set : {
135                                                         //set_position : [ 300 ]
136                                                     },
137                                                     items : [
138                                                     //    Builder.ProjectTree.create()
139                                                         {
140                                                             xtype : 'Button',
141                                                             xns: 'Gtk',
142                                                             label : 'Console Goes here'
143                                                         }
144                                                     ]
145                                                 }
146                                                
147                                               
148                                                         
149                                                   
150                                                
151                                             ]
152                                         },
153                                     
154                                     
155                                        
156                                         {
157                                             xtype : 'Include',
158                                             xns : 'xnew',
159                                             cls : Builder.RightEditor
160                                         }
161                                        
162                                        
163                                        
164                                       
165                                         //LeftProps.add()
166                                     ]
167                                 },
168                                 
169                                 {
170                                     xtype : 'Include',
171                                     xns : 'xnew',
172                                     cls : Builder.RightPalete
173                                 }
174                                
175                                 
176                                 
177                                
178                             ]
179                         }
180                     ]
181                 }
182                 
183             ]
184        }
185                 
186     ]
187 }); 
188  
189     
190  
191  
192