src/Builder4/MainWindow.bjs
[app.Builder.js] / src / Builder4 / MainWindow.bjs
1 {
2  "name" : "MainWindow",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/MainWindow.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "builder",
9  "items" : [
10   {
11    "listeners" : {
12     "delete_event" : "  (   event) => {\n    return false;\n} ",
13     "destroy" : "() =>  {\n Xcls_MainWindow.singleton().no_windows--;\n \n Resources.singleton().disconnect(_this.statusbar.handler_id);\n \n \n if (Xcls_MainWindow.singleton().no_windows < 1) {\n\n     Gtk.main_quit();\n }\n}",
14     "show" : "  ( ) => {\n    // hide the file editing..\n   \n    //this.hideViewEditing();\n    _this.statusbar.el.hide();\n     _this.statusbar_errors.el.hide();\n    _this.statusbar_warnings.el.hide();\n    _this.statusbar_depricated.el.hide();\n    \n  \n    Resources.singleton().checkResources();\n\n}",
15     "key_release_event" : " (event) => {\n    \n    if (this.search_entry.el.is_visible()) {\n\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-f  pressed\");\n\t\t\tthis.search_entry.el.grab_focus();\n\t\t    return false;\n\t\t}\n\t\t\n\t\tif (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\t    print(\"SAVE: ctrl-g  pressed\");\n\t\t\tthis.search_entry.forwardSearch(true);\n\t\t    return false;\n\t\t}\n\t\t\n\t}    \n\t\n\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n\t\tprint(\"SAVE: ctrl-n  pressed\");\n\t\tthis.openNewWindow();\n\t\treturn false;\n\t}\n\t\n   // print(event.key.keyval)\n    \n    return false;\n\n} \n\n"
16    },
17    "id" : "MainWindow",
18    "default_width" : 800,
19    "* init" : " \n\t  \n    //this.el.show_all();\n    \n     ",
20    "| void openNewWindow" : "() {\n\tXcls_MainWindow.singleton().no_windows++;\n        var w = new Xcls_MainWindow();\n        w.ref();\n\n        w.el.show_all();\n        w.initChildren();\n        w.windowstate.switchState(WindowState.State.FILES);\n}\n",
21    "# Project.Project project" : "null",
22    "# string title" : "\"Application Builder\"",
23    "xtype" : "Window",
24    "# int no_windows" : 1,
25    "default_height" : 500,
26    "|        void initChildren" : " () {\n    // this needs putting in a better place..\n    this.windowstate = new WindowState(this);\n     \n\n    //w.el.show_all();\n    var tl = new Clutter.Timeline(6000);\n    tl.set_repeat_count(-1);\n    tl.start();\n    tl.ref();\n\n    \n\n\n\n}\n",
27    "$ xns" : "Gtk",
28    "|             void show" : "() {\n   \n    this.el.show_all();\n\n}",
29    "# WindowState windowstate" : "null",
30    "border_width" : 0,
31    "$ type" : "Gtk.WindowType.TOPLEVEL",
32    "|             void setTitle" : " (string str) {\n    this.headerbar.el.set_title(this.title + \" - \" + str);\n} \n",
33    "items" : [
34     {
35      "id" : "headerbar",
36      "* pack" : "set_titlebar",
37      "xtype" : "HeaderBar",
38      "bool show_close_button" : true,
39      "$ xns" : "Gtk",
40      "string title" : "Application Builder",
41      "items" : [
42       {
43        "* pack" : "pack_start",
44        "xtype" : "Box",
45        "$ xns" : "Gtk",
46        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
47        "items" : [
48         {
49          "bool use_popover" : false,
50          "* pack" : "add",
51          "xtype" : "MenuButton",
52          "$ xns" : "Gtk",
53          "items" : [
54           {
55            "id" : "topbarmenu",
56            "* init" : "{\n    this.el.show_all();\n}\n",
57            "xtype" : "Menu",
58            "* pack" : "set_popup",
59            "$ xns" : "Gtk",
60            "items" : [
61             {
62              "listeners" : {
63               "activate" : "( ) => {\n       _this.openNewWindow();\n}"
64              },
65              "xtype" : "MenuItem",
66              "string label" : "Open a new Window",
67              "* pack" : "append",
68              "$ xns" : "Gtk"
69             },
70             {
71              "* pack" : "append",
72              "xtype" : "SeparatorMenuItem",
73              "$ xns" : "Gtk"
74             },
75             {
76              "listeners" : {
77               "activate" : " ( ) => {\n         Resources.singleton().fetchStart();\n}"
78              },
79              "* pack" : "append",
80              "xtype" : "MenuItem",
81              "string label" : "Download updated Resources",
82              "$ xns" : "Gtk"
83             },
84             {
85              "listeners" : {
86               "activate" : "() => {\n    About.singleton().el.show();\n    }"
87              },
88              "string label" : "About the Builder",
89              "* pack" : "append",
90              "xtype" : "MenuItem",
91              "$ xns" : "Gtk"
92             }
93            ]
94           },
95           {
96            "xtype" : "Image",
97            "utf8 icon_name" : "help-about",
98            "* pack" : "set_image",
99            "$ xns" : "Gtk"
100           }
101          ]
102         },
103         {
104          "listeners" : {
105           "clicked" : "  ( ) => {\n   _this.windowstate.switchState(WindowState.State.FILES);\n      \n\n}"
106          },
107          "id" : "openbtn",
108          "xtype" : "Button",
109          "* pack" : "add",
110          "$ xns" : "Gtk",
111          "height_request" : 50,
112          "$ tooltop_text" : "\"Open File\"",
113          "items" : [
114           {
115            "* pack" : "set_image",
116            "xtype" : "Image",
117            "utf8 icon_name" : "document-open",
118            "$ xns" : "Gtk"
119           }
120          ]
121         },
122         {
123          "listeners" : {
124           "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
125          },
126          "id" : "openbackbtn",
127          "utf8 tooltip_text" : "Back",
128          "xtype" : "Button",
129          "* pack" : "add",
130          "width_request" : 50,
131          "$ xns" : "Gtk",
132          "height_request" : 50,
133          "bool visible" : false,
134          "items" : [
135           {
136            "utf8 icon_name" : "go-previous",
137            "* pack" : "set_image",
138            "xtype" : "Image",
139            "$ xns" : "Gtk"
140           }
141          ]
142         }
143        ]
144       }
145      ]
146     },
147     {
148      "id" : "vbox",
149      "xtype" : "Box",
150      "* pack" : "add",
151      "$ xns" : "Gtk",
152      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
153      "$ homogeneous" : false,
154      "items" : [
155       {
156        "id" : "mainpane",
157        "position" : 400,
158        "* pack" : "pack_start,true,true,0",
159        "# int lastWidth" : 0,
160        "xtype" : "Paned",
161        "$ xns" : "Gtk",
162        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
163        "items" : [
164         {
165          "id" : "leftpane",
166          "* pack" : "add1",
167          "xtype" : "Box",
168          "$ xns" : "Gtk",
169          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
170          "items" : [
171           {
172            "id" : "editpane",
173            "* pack" : "pack_start,true,true,0",
174            "xtype" : "Paned",
175            "$ xns" : "Gtk",
176            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
177            "items" : [
178             {
179              "id" : "tree",
180              "* pack" : "add1",
181              "xtype" : "Box",
182              "$ xns" : "Gtk",
183              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
184             },
185             {
186              "id" : "props",
187              "* pack" : "add2",
188              "xtype" : "Box",
189              "$ xns" : "Gtk",
190              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
191             }
192            ]
193           }
194          ]
195         },
196         {
197          "* pack" : "add2",
198          "xtype" : "Box",
199          "$ xns" : "Gtk",
200          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
201          "items" : [
202           {
203            "listeners" : {
204             "size_allocate" : "  (  alloc) => {\n    if (_this.windowstate == null) {\n        return;\n    }\n    _this.windowstate.resizeCanvas(); \n        \n}"
205            },
206            "id" : "clutterembed",
207            "* init" : "    var stage = this.el.get_stage();\n    stage.set_background_color(  Clutter.Color.from_string(\"#000\"));\n    \n    \n",
208            "xtype" : "Embed",
209            "* pack" : "pack_start,true,true,0",
210            "$ xns" : "GtkClutter",
211            "items" : [
212             {
213              "id" : "rooview",
214              "* init" : "{\n   \n   \n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            1.0f\n        )\n    );\n        \n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(1.0f,1.0f);\n    \n    this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
215              "xtype" : "Actor",
216              "* pack" : "get_stage().add_child",
217              "$ xns" : "GtkClutter"
218             },
219             {
220              "id" : "objectview",
221              "* init" : "{\n   \n   /*\n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n    */\n    this.el.fixed_x = 50.0f;\n    this.el.fixed_y = 0.0f;\n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(0.0f,1.0f);\n    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
222              "xtype" : "Actor",
223              "* pack" : "get_stage().add_child",
224              "$ xns" : "GtkClutter"
225             },
226             {
227              "id" : "codeeditview",
228              "* init" : "{\n   \n   /*\n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n    */\n    this.el.fixed_x = 50.0f;\n    this.el.fixed_y = 0.0f;\n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(0.0f,1.0f);\n    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
229              "xtype" : "Actor",
230              "* pack" : "get_stage().add_child",
231              "$ xns" : "GtkClutter"
232             },
233             {
234              "id" : "addpropsview",
235              "* init" : "{\n   \n   /*\n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n    */\n    this.el.fixed_x = 50.0f;\n    this.el.fixed_y = 0.0f;\n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(0.0f,1.0f);\n    this.el.set_size((_this.clutterembed.el.get_stage().width-50)/2,\n            _this.clutterembed.el.get_stage().height);\n            \n}",
236              "xtype" : "Actor",
237              "* pack" : "get_stage().add_child",
238              "$ xns" : "GtkClutter"
239             },
240             {
241              "id" : "projecteditview",
242              "* init" : "{\n   \n   \n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            1.0f\n        )\n    );\n        \n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.0f,0.0f);\n    this.el.set_scale(1.0f,0.0f);\n    this.el.set_size(_this.clutterembed.el.get_stage().width-50,\n            _this.clutterembed.el.get_stage().height /2);\n            \n}",
243              "xtype" : "Actor",
244              "* pack" : "get_stage().add_child",
245              "$ xns" : "GtkClutter"
246             },
247             {
248              "id" : "buttonlayout",
249              "* init" : "{\n    \n    this.el.add_constraint(\n        new Clutter.AlignConstraint(\n            _this.clutterembed.el.get_stage(), \n            Clutter.AlignAxis.X_AXIS,\n            0.0f\n        )\n    );\n     \n    \n    //this.el.set_position(100,100);\n    this.el.set_pivot_point(0.5f,0.5f);\n     this.el.set_size(50,\n           _this.clutterembed.el.get_stage().height);\n     \n}",
250              "xtype" : "Actor",
251              "* pack" : "get_stage().add_child",
252              "$ xns" : "Clutter",
253              "items" : [
254               {
255                "$ orientation" : "Clutter.Orientation.VERTICAL",
256                "xtype" : "BoxLayout",
257                "$ xns" : "Clutter",
258                "* prop" : "layout_manager"
259               },
260               {
261                "id" : "backbutton",
262                "* init" : "this.el.set_size(50,50);",
263                "xtype" : "Actor",
264                "* pack" : "add_child",
265                "$ xns" : "Clutter",
266                "items" : [
267                 {
268                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
269                  "* pack" : "add_child",
270                  "xtype" : "Actor",
271                  "$ xns" : "GtkClutter",
272                  "items" : [
273                   {
274                    "listeners" : {
275                     "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
276                    },
277                    "utf8 tooltip_text" : "Back",
278                    "xtype" : "Button",
279                    "* pack" : false,
280                    "width_request" : 50,
281                    "$ xns" : "Gtk",
282                    "height_request" : 50,
283                    "items" : [
284                     {
285                      "* pack" : "set_image",
286                      "xtype" : "Image",
287                      "utf8 icon_name" : "go-previous",
288                      "$ xns" : "Gtk"
289                     }
290                    ]
291                   }
292                  ]
293                 }
294                ]
295               },
296               {
297                "id" : "editfilebutton",
298                "* init" : "this.el.set_size(50.0f,50.0f);",
299                "xtype" : "Actor",
300                "* pack" : "add_child",
301                "$ xns" : "Clutter",
302                "items" : [
303                 {
304                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
305                  "xtype" : "Actor",
306                  "* pack" : "add_child",
307                  "$ xns" : "GtkClutter",
308                  "items" : [
309                   {
310                    "listeners" : {
311                     "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    if (_this.project == null || _this.windowstate.file == null) {\n        return  ;\n    }\n     _this.windowstate.file_details.show(\n        _this.windowstate.file, this.el\n    );\n     \n    return  ;    \n\n\n}"
312                    },
313                    "* pack" : false,
314                    "xtype" : "Button",
315                    "width_request" : 50,
316                    "$ xns" : "Gtk",
317                    "$ tooltip_text" : "\"File Details\"",
318                    "height_request" : 50,
319                    "items" : [
320                     {
321                      "xtype" : "Image",
322                      "utf8 icon_name" : "document-properties",
323                      "* pack" : "set_image",
324                      "$ xns" : "Gtk"
325                     }
326                    ]
327                   }
328                  ]
329                 }
330                ]
331               },
332               {
333                "id" : "projecteditbutton",
334                "* init" : "this.el.set_size(50,50);",
335                "xtype" : "Actor",
336                "* pack" : "add_child",
337                "$ xns" : "Clutter",
338                "items" : [
339                 {
340                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
341                  "xtype" : "Actor",
342                  "* pack" : "add_child",
343                  "$ xns" : "GtkClutter",
344                  "items" : [
345                   {
346                    "listeners" : {
347                     "clicked" : "  ( ) => {\n     _this.windowstate.switchState(WindowState.State.PROJECT);\n   \n\n\n}"
348                    },
349                    "* pack" : false,
350                    "xtype" : "Button",
351                    "width_request" : 50,
352                    "$ xns" : "Gtk",
353                    "$ tooltip_text" : "\"Project Details\"",
354                    "height_request" : 50,
355                    "items" : [
356                     {
357                      "* pack" : "set_image",
358                      "xtype" : "Image",
359                      "utf8 icon_name" : "emblem-system",
360                      "$ xns" : "Gtk"
361                     }
362                    ]
363                   }
364                  ]
365                 }
366                ]
367               },
368               {
369                "listeners" : {
370                 "enter_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#333\");\n        return false;\n}",
371                 "leave_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#000\");\n    return false;\n}"
372                },
373                "id" : "objectshowbutton",
374                "* init" : "this.el.set_size(50,50);",
375                "xtype" : "Actor",
376                "* pack" : "add_child",
377                "$ xns" : "Clutter",
378                "items" : [
379                 {
380                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
381                  "xtype" : "Actor",
382                  "* pack" : "add_child",
383                  "$ xns" : "GtkClutter",
384                  "items" : [
385                   {
386                    "listeners" : {
387                     "clicked" : "  ( ) => {\n    \n     _this.windowstate.switchState(WindowState.State.OBJECT);\n  \n \n}"
388                    },
389                    "* pack" : false,
390                    "xtype" : "Button",
391                    "width_request" : 50,
392                    "$ xns" : "Gtk",
393                    "$ tooltip_text" : "\"Add Child Element\"",
394                    "height_request" : 50,
395                    "items" : [
396                     {
397                      "utf8 icon_name" : "list-add",
398                      "* pack" : "set_image",
399                      "xtype" : "Image",
400                      "$ xns" : "Gtk"
401                     }
402                    ]
403                   }
404                  ]
405                 }
406                ]
407               },
408               {
409                "id" : "addpropbutton",
410                "* init" : "this.el.set_size(50,50);",
411                "xtype" : "Actor",
412                "* pack" : "add_child",
413                "$ xns" : "Clutter",
414                "items" : [
415                 {
416                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
417                  "xtype" : "Actor",
418                  "* pack" : "add_child",
419                  "$ xns" : "GtkClutter",
420                  "items" : [
421                   {
422                    "listeners" : {
423                     "clicked" : "  ( ) => {\n    \n     _this.windowstate.switchState(WindowState.State.PROP);\n \n\n}"
424                    },
425                    "* pack" : false,
426                    "xtype" : "Button",
427                    "width_request" : 50,
428                    "$ xns" : "Gtk",
429                    "$ tooltip_text" : "\"Add Property\"",
430                    "height_request" : 50,
431                    "items" : [
432                     {
433                      "xtype" : "Image",
434                      "utf8 icon_name" : "format-justify-left",
435                      "* pack" : "set_image",
436                      "$ xns" : "Gtk"
437                     }
438                    ]
439                   }
440                  ]
441                 }
442                ]
443               },
444               {
445                "id" : "addlistenerbutton",
446                "* init" : "this.el.set_size(50,50);",
447                "xtype" : "Actor",
448                "* pack" : "add_child",
449                "$ xns" : "Clutter",
450                "items" : [
451                 {
452                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
453                  "xtype" : "Actor",
454                  "* pack" : "add_child",
455                  "$ xns" : "GtkClutter",
456                  "items" : [
457                   {
458                    "listeners" : {
459                     "clicked" : "  ( ) => {\n    \n    _this.windowstate.switchState(WindowState.State.LISTENER);\n  \n\n\n}"
460                    },
461                    "* pack" : false,
462                    "xtype" : "Button",
463                    "width_request" : 50,
464                    "$ xns" : "Gtk",
465                    "$ tooltip_text" : "\"Add Event Code\"",
466                    "height_request" : 50,
467                    "items" : [
468                     {
469                      "* pack" : "set_image",
470                      "xtype" : "Image",
471                      "utf8 icon_name" : "appointment-new",
472                      "$ xns" : "Gtk"
473                     }
474                    ]
475                   }
476                  ]
477                 }
478                ]
479               },
480               {
481                "id" : "addprojectbutton",
482                "* init" : "this.el.set_size(50.0f,50.0f);",
483                "xtype" : "Actor",
484                "* pack" : "add_child",
485                "$ xns" : "Clutter",
486                "items" : [
487                 {
488                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
489                  "xtype" : "Actor",
490                  "* pack" : "add_child",
491                  "$ xns" : "GtkClutter",
492                  "items" : [
493                   {
494                    "listeners" : {
495                     "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    //Xcls_DialogNewComponent.singleton().show(\n   var  pe =      EditProject.singleton();\n    pe.el.set_transient_for(_this.el);\n    pe.el.set_modal(true);   \n   \n    var p  = pe.show();\n\n    if (p == null) {\n        return;\n    }\n    \n    \n    _this.windowstate.left_projects.is_loaded = false;    \n    _this.windowstate.left_projects.load();\n    _this.windowstate.left_projects.selectProject(p);\n    return  ;    \n\n\n}"
496                    },
497                    "* pack" : false,
498                    "xtype" : "Button",
499                    "width_request" : 50,
500                    "$ xns" : "Gtk",
501                    "$ tooltip_text" : "\"New\\nProj.\"",
502                    "height_request" : 50,
503                    "items" : [
504                     {
505                      "xtype" : "Image",
506                      "utf8 icon_name" : "folder-new",
507                      "* pack" : "set_image",
508                      "$ xns" : "Gtk"
509                     }
510                    ]
511                   }
512                  ]
513                 }
514                ]
515               },
516               {
517                "id" : "addfilebutton",
518                "* init" : "this.el.set_size(50.0f,50.0f);",
519                "xtype" : "Actor",
520                "* pack" : "add_child",
521                "$ xns" : "Clutter",
522                "items" : [
523                 {
524                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
525                  "xtype" : "Actor",
526                  "* pack" : "add_child",
527                  "$ xns" : "GtkClutter",
528                  "items" : [
529                   {
530                    "listeners" : {
531                     "clicked" : " () => {\n    // create a new file in project..\n    print(\"add file selected\\n\");\n    // what's the currently selected project...\n    var proj = _this.windowstate.left_projects.getSelectedProject();\n    \n    if (proj == null) {\n\t\tprint(\"no project selected?\\n\");\n        return  ;\n    }\n    \n    print(\"creating file?\");\n    \n    var f = JsRender.JsRender.factory(proj.xtype,  proj, \"\");\n    _this.project = proj;\n        print(\"showing popup?\");\n     _this.windowstate.file_details.show(\n       f, this.el\n    );\n    \n    \n    return  ;    \n}"
532                    },
533                    "* pack" : false,
534                    "xtype" : "Button",
535                    "width_request" : 50,
536                    "$ xns" : "Gtk",
537                    "$ tooltip_text" : "\"Add File\"",
538                    "height_request" : 50,
539                    "items" : [
540                     {
541                      "utf8 icon_name" : "document-new",
542                      "* pack" : "set_image",
543                      "xtype" : "Image",
544                      "$ xns" : "Gtk"
545                     }
546                    ]
547                   }
548                  ]
549                 }
550                ]
551               },
552               {
553                "id" : "delprojectbutton",
554                "* init" : "this.el.set_size(50,50);",
555                "xtype" : "Actor",
556                "* pack" : "add_child",
557                "$ xns" : "Clutter",
558                "items" : [
559                 {
560                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
561                  "xtype" : "Actor",
562                  "* pack" : "add_child",
563                  "$ xns" : "GtkClutter",
564                  "items" : [
565                   {
566                    "listeners" : {
567                     "clicked" : "  ( ) => {\n     \n     var cd = DialogConfirm.singleton();\n     cd.el.set_transient_for(_this.el);\n    cd.el.set_modal(true);\n\n     var project =   _this.windowstate.left_projects.getSelectedProject();\n    if (project == null) {\n        print(\"SKIP - no project\\n\");\n        return;\n    }\n    \n        \n     if (Gtk.ResponseType.YES != cd.show(\"Confirm\", \n        \"Are you sure you want to delete project %s\".printf(project.name))) {\n        return;\n    }\n     \n\n    // confirm?\n    Project.Project.remove(project);\n    _this.project = null;\n    \n    _this.windowstate.left_projects.is_loaded =  false;\n    _this.windowstate.left_projects.load();\n    _this.windowstate.clutterfiles.clearFiles();\n\n}"
568                    },
569                    "* pack" : false,
570                    "xtype" : "Button",
571                    "width_request" : 50,
572                    "$ xns" : "Gtk",
573                    "$ tooltip_text" : "\"Delete Project\"",
574                    "height_request" : 50,
575                    "items" : [
576                     {
577                      "xtype" : "Image",
578                      "utf8 icon_name" : "user-trash",
579                      "* pack" : "set_image",
580                      "$ xns" : "Gtk"
581                     }
582                    ]
583                   }
584                  ]
585                 }
586                ]
587               }
588              ]
589             }
590            ]
591           }
592          ]
593         }
594        ]
595       },
596       {
597        "bool homogeneous" : false,
598        "* pack" : "pack_end,false,true,0",
599        "xtype" : "Box",
600        "$ xns" : "Gtk",
601        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
602        "items" : [
603         {
604          "string label" : "   ",
605          "* pack" : "pack_start,true,true,0",
606          "xtype" : "Label",
607          "$ xns" : "Gtk"
608         },
609         {
610          "bool show_text" : true,
611          "ulong handler_id" : "-1",
612          "id" : "statusbar",
613          "* init" : "{\n     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {\n        if (pos < 1) {\n            this.el.hide();\n            _this.mainpane.el.set_sensitive(true);\n            \n            return;\n        }\n         _this.mainpane.el.set_sensitive(false);\n         this.el.show();\n         this.el.set_fraction ((1.0f * pos) / (1.0f * total));\n         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));\n       \n     });\n}\n",
614          "xtype" : "ProgressBar",
615          "* pack" : "pack_start,true,true,0",
616          "$ xns" : "Gtk"
617         },
618         {
619          "listeners" : {
620           "key_press_event" : "(event) => {\n    \n \tif (event.keyval == Gdk.Key.Return) {\n\t\tthis.forwardSearch(false);\n\t    return true;\n\n\t}    \n   // print(event.key.keyval)\n    \n    return false;\n\n} ",
621           "changed" : "() => {\n\tif (this.el.text == \"\") {\n\t\t_this.search_results.el.hide();\n\t\treturn;\n\t}\n\tvar res = 0;\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\tres = _this.windowstate.code_editor.search(this.el.text);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);\n\t\t\t} else { \n\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t\n\t\t\t}\n\t\t\n\t\t\n\t\t\tbreak;\n\t}\n\t_this.search_results.el.show();\n\tif (res > 0) {\n\t\t_this.search_results.el.label = \"%d Matches\".printf(res);\n\t} else {\n\t\t_this.search_results.el.label = \"No Matches\";\n\t}\n\t\t\n\t\n\t\n}\n"
622          },
623          "id" : "search_entry",
624          "* init" : "var description =   Pango.FontDescription.from_string(\"monospace\");\n\tdescription.set_size(8000);\n\t this.el.override_font(description);\n\n",
625          "* pack" : "pack_start,false,true,0",
626          "xtype" : "SearchEntry",
627          "$ xns" : "Gtk",
628          "| void forwardSearch" : "(bool change_focus) {\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\t_this.windowstate.code_editor.forwardSearch(change_focus);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);\n\t\t\t} else { \n\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);\n\t\t\t}\n\t\t\n\t\t\tbreak;\n\t}\n\t\n}\n"
629         },
630         {
631          "* pack" : "pack_end,false,true,0",
632          "xtype" : "MenuBar",
633          "$ xns" : "Gtk",
634          "items" : [
635           {
636            "listeners" : {
637             "button_press_event" : "() => {\n/*\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n   \n    \n    this.popup.show(this.notices, this.el);\n    */\n    return true;\n}"
638            },
639            "bool always_show_image" : true,
640            "id" : "search_results",
641            "Xcls_ValaCompileErrors popup" : "",
642            "string label" : "Matches",
643            "* pack" : "add",
644            "xtype" : "ImageMenuItem",
645            "$ xns" : "Gtk",
646            "items" : [
647             {
648              "utf8 icon_name" : "system-search",
649              "* pack" : "set_image",
650              "xtype" : "Image",
651              "bool sensitive" : false,
652              "$ xns" : "Gtk"
653             }
654            ]
655           },
656           {
657            "id" : "statusbar_compilestatus_label",
658            "xtype" : "MenuItem",
659            "* pack" : "add",
660            "string label" : "Compile Status:",
661            "$ xns" : "Gtk"
662           },
663           {
664            "listeners" : {
665             "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n   \n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
666            },
667            "bool always_show_image" : true,
668            "id" : "statusbar_errors",
669            "| void setNotices" : "(Json.Object nots, int qty) {\n    this.el.show();\n    this.el.label = qty.to_string() + \" Errors\";\n    this.notices = nots;\n\n}\n",
670            "Xcls_ValaCompileErrors popup" : "",
671            "string label" : "Errors",
672            "* pack" : "add",
673            "xtype" : "ImageMenuItem",
674            "# Json.Object notices" : "new Json.Object() ",
675            "$ xns" : "Gtk",
676            "items" : [
677             {
678              "* pack" : "set_image",
679              "xtype" : "Image",
680              "utf8 icon_name" : "dialog-error",
681              "$ xns" : "Gtk"
682             }
683            ]
684           },
685           {
686            "listeners" : {
687             "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
688            },
689            "bool always_show_image" : true,
690            "id" : "statusbar_warnings",
691            "| void setNotices" : "(Json.Object nots, int qty) {\n    this.el.show();\n    this.el.label = qty.to_string() + \" Warnings\";\n    this.notices = nots;\n\n}\n",
692            "Xcls_ValaCompileErrors popup" : "",
693            "* pack" : "add",
694            "string label" : "Warnings",
695            "xtype" : "ImageMenuItem",
696            "# Json.Object notices" : "new Json.Object()",
697            "$ xns" : "Gtk",
698            "items" : [
699             {
700              "utf8 icon_name" : "dialog-warning",
701              "* pack" : "set_image",
702              "xtype" : "Image",
703              "$ xns" : "Gtk"
704             }
705            ]
706           },
707           {
708            "listeners" : {
709             "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
710            },
711            "bool always_show_image" : true,
712            "id" : "statusbar_depricated",
713            "| void setNotices" : "(Json.Object nots, int qty) {\n    this.el.show();\n    this.el.label = qty.to_string() + \" Depricated\";\n    this.notices = nots;\n\n}\n",
714            "Xcls_ValaCompileErrors popup" : "",
715            "string label" : "Depricated",
716            "* pack" : "add",
717            "xtype" : "ImageMenuItem",
718            "# Json.Object notices" : "new Json.Object()",
719            "$ xns" : "Gtk",
720            "items" : [
721             {
722              "xtype" : "Image",
723              "utf8 icon_name" : "dialog-information",
724              "* pack" : "set_image",
725              "$ xns" : "Gtk"
726             }
727            ]
728           },
729           {
730            "listeners" : {
731             "button_press_event" : "() => {\n\tif (_this.windowstate.file == null) {\n\t\treturn true;\n\t}\n\t_this.windowstate.valasource.spawnExecute(_this.windowstate.file);\n\t\n\t_this.windowstate.compile_results.show(this.el,true);\n\t\n\treturn true;\n}"
732            },
733            "bool always_show_image" : true,
734            "id" : "statusbar_run",
735            "Xcls_ValaCompileErrors popup" : "",
736            "string label" : "Run",
737            "* pack" : "add",
738            "xtype" : "ImageMenuItem",
739            "$ xns" : "Gtk",
740            "items" : [
741             {
742              "utf8 icon_name" : "media-playback-start",
743              "* pack" : "set_image",
744              "xtype" : "Image",
745              "$ xns" : "Gtk"
746             }
747            ]
748           }
749          ]
750         }
751        ]
752       }
753      ]
754     }
755    ]
756   }
757  ]
758 }