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