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