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