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