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