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