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