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