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