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