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                                     xtype : Gtk.VPaned,
109                                     position :  300,
110                                     items : [
111                                         {
112                                             xtype : Gtk.VBox,
113                                             items : [
114                                                 {
115                                                     xtype : 'Include',
116                                                     xns : 'xnew',
117                                                     cls : Builder.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