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