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