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