2 "build_module" : "builder",
5 "# Project.Project project" : "null",
6 "# WindowState windowstate" : "null",
7 "# int no_windows" : 1,
8 "# string title" : "\"Roo Application Builder\"",
9 "$ type" : "Gtk.WindowType.TOPLEVEL",
14 " //this.el.show_all();",
16 " this.el.set_icon_name(\"roobuilder\");",
17 "\t//} catch (Exception e) {",
18 "\t//\tprint(\"no icon found\");",
22 "default_height" : 850,
23 "default_width" : 1200,
28 "* pack" : "set_titlebar",
29 "bool show_close_button" : true,
34 "* pack" : "pack_start",
35 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
39 "\"Open a new Window",
44 "bool always_show_image" : true,
49 "* pack" : "set_image",
50 "utf8 icon_name" : "window-new",
57 " _this.openNewWindow();",
63 "string label" : "New Window",
67 "$ tooltop_text" : "\"Open File\"",
70 "bool always_show_image" : true,
71 "id" : "open_projects_btn",
75 "* pack" : "set_image",
76 "utf8 icon_name" : "system-file-manager",
83 " \t_this.windowstate.showPopoverFiles(this.el, _this.project);",
88 "string label" : "Files / Projects",
95 "string title" : "Application Builder",
99 "$ homogeneous" : false,
102 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
106 "# int lastWidth" : 0,
108 "* pack" : "pack_start,true,true,0",
109 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
115 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
120 "* pack" : "pack_start,true,true,0",
121 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
127 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
134 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
140 "accept_position" : [
142 "\tGLib.debug(\"Accept postion\");",
148 "\tGLib.debug(\"Move handle\");",
161 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
166 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
167 "bool vexpand" : true,
174 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
175 "bool vexpand" : true,
176 "id" : "codeeditviewbox",
188 "* pack" : "pack_end,false,true,0",
189 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
190 "bool homogeneous" : false,
193 "$ tooltip_text" : "\"Project Details\"",
196 "bool always_show_image" : true,
200 "* pack" : "set_image",
201 "utf8 icon_name" : "emblem-system",
209 " _this.windowstate.projectPopoverShow(this.el, _this.project);",
215 "string label" : "Edit Project Settings",
219 "$ tooltip_text" : "\"File Details\"",
222 "bool always_show_image" : true,
226 "* pack" : "set_image",
227 "utf8 icon_name" : "document-properties",
235 " // create a new file in project..",
236 " if (_this.project == null || _this.windowstate.file == null) {",
239 " _this.windowstate.file_details.show(",
240 " _this.windowstate.file, this.el",
249 "string label" : "Edit File Properties",
255 "bool always_show_image" : true,
261 " this.el.show_all();",
265 "* pack" : "set_popup",
274 " Resources.singleton().fetchStart();",
278 "string label" : "Download updated Resources",
287 " About.singleton().el.show();",
291 "string label" : "About the Builder",
299 "* pack" : "set_image",
300 "utf8 icon_name" : "dialog-information",
304 "string label" : "About",
305 "xtype" : "MenuButton"
309 "* pack" : "pack_start,true,true,0",
310 "string label" : " ",
317 " this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
320 " _this.mainpane.el.set_sensitive(true);",
324 " _this.mainpane.el.set_sensitive(false);",
326 " this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
327 " this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
333 "* pack" : "pack_start,true,true,0",
334 "bool show_text" : true,
336 "ulong handler_id" : "-1",
337 "xtype" : "ProgressBar"
342 "var description = Pango.FontDescription.from_string(\"monospace\");",
343 "\tdescription.set_size(8000);",
344 "\t this.el.override_font(description);",
348 "* pack" : "pack_start,false,true,0",
349 "id" : "search_entry",
350 "int width_request" : 300,
354 "\tif (this.el.text == \"\") {",
355 "\t\t_this.search_results.el.hide();",
359 "\tswitch(_this.windowstate.state) {",
360 "\t\tcase WindowState.State.CODEONLY:",
361 "\t\t///case WindowState.State.CODE:",
362 "\t\t\t// search the code being edited..",
363 "\t\t\tres = _this.windowstate.code_editor_tab.search(this.el.text);",
366 "\t\tcase WindowState.State.PREVIEW:",
367 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
368 "\t\t\t\t res = _this.windowstate.window_gladeview.search(this.el.text);",
370 "\t\t\t\t res = _this.windowstate.window_rooview.search(this.el.text);\t\t\t",
376 "\t_this.search_results.el.show();",
378 "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
380 "\t\t_this.search_results.el.label = \"No Matches\";",
388 "key_press_event" : [
391 " \tif (event.keyval == Gdk.Key.Return) {",
392 "\t\tthis.forwardSearch(false);",
396 " // print(event.key.keyval)",
403 "xtype" : "SearchEntry",
404 "| void forwardSearch" : [
405 "(bool change_focus) {",
406 "\tswitch(_this.windowstate.state) {",
407 "\t\tcase WindowState.State.CODEONLY:",
408 "\t\t//case WindowState.State.CODE:",
409 "\t\t\t// search the code being edited..",
410 "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
413 "\t\tcase WindowState.State.PREVIEW:",
414 "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
415 "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
417 "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
434 "Xcls_ValaCompileErrors popup" : "",
435 "bool always_show_image" : true,
436 "id" : "search_results",
440 "* pack" : "set_image",
441 "bool sensitive" : false,
442 "utf8 icon_name" : "system-search",
447 "button_press_event" : [
450 " if (this.popup == null) {",
451 " this.popup = new Xcls_ValaCompileErrors();",
452 " this.popup.window = _this;",
456 " this.popup.show(this.notices, this.el);",
462 "string label" : "Matches",
463 "xtype" : "ImageMenuItem"
468 "id" : "statusbar_compilestatus_label",
469 "string label" : "Compile Status:",
473 "# Json.Object notices" : "new Json.Object() ",
476 "Xcls_ValaCompileErrors popup" : "",
477 "bool always_show_image" : true,
478 "id" : "statusbar_errors",
482 "* pack" : "set_image",
483 "utf8 icon_name" : "dialog-error",
488 "button_press_event" : [
490 " if (this.popup == null) {",
491 " this.popup = new Xcls_ValaCompileErrors();",
492 " this.popup.window = _this;",
496 " this.popup.show(this.notices, this.el);",
501 "string label" : "Errors",
502 "xtype" : "ImageMenuItem",
503 "| void setNotices" : [
504 "(Json.Object nots, int qty) {",
506 " this.el.label = qty.to_string() + \" Errors\";",
507 " this.notices = nots;",
514 "# Json.Object notices" : "new Json.Object()",
517 "Xcls_ValaCompileErrors popup" : "",
518 "bool always_show_image" : true,
519 "id" : "statusbar_warnings",
523 "* pack" : "set_image",
524 "utf8 icon_name" : "dialog-warning",
529 "button_press_event" : [
531 " if (this.popup == null) {",
532 " this.popup = new Xcls_ValaCompileErrors();",
533 " this.popup.window = _this;",
536 " this.popup.show(this.notices, this.el);",
541 "string label" : "Warnings",
542 "xtype" : "ImageMenuItem",
543 "| void setNotices" : [
544 "(Json.Object nots, int qty) {",
546 " this.el.label = qty.to_string() + \" Warnings\";",
547 " this.notices = nots;",
554 "# Json.Object notices" : "new Json.Object()",
557 "Xcls_ValaCompileErrors popup" : "",
558 "bool always_show_image" : true,
559 "id" : "statusbar_depricated",
563 "* pack" : "set_image",
564 "utf8 icon_name" : "dialog-information",
569 "button_press_event" : [
571 " if (this.popup == null) {",
572 " this.popup = new Xcls_ValaCompileErrors();",
573 " this.popup.window = _this;",
577 " this.popup.show(this.notices, this.el);",
582 "string label" : "Depricated",
583 "xtype" : "ImageMenuItem",
584 "| void setNotices" : [
585 "(Json.Object nots, int qty) {",
587 " this.el.label = qty.to_string() + \" Depricated\";",
588 " this.notices = nots;",
597 "Xcls_ValaCompileErrors popup" : "",
598 "bool always_show_image" : true,
599 "id" : "statusbar_run",
603 "* pack" : "set_image",
604 "utf8 icon_name" : "media-playback-start",
609 "button_press_event" : [
611 "\tif (_this.windowstate.file == null) {",
614 "\t_this.windowstate.valasource.spawnExecute(_this.windowstate.file);",
616 "\t_this.windowstate.compile_results.show(this.el,true);",
622 "string label" : "Run",
623 "xtype" : "ImageMenuItem"
626 "string tooltip_text" : "Update Resources / About Roobuilder",
632 "id" : "statusbar_compile_spinner",
633 "string tooltip_text" : "Compiling",
638 " this.el.start(); ",
665 " Xcls_MainWindow.singleton().no_windows--;",
667 " Resources.singleton().disconnect(_this.statusbar.handler_id);",
670 " if (Xcls_MainWindow.singleton().no_windows < 1) {",
676 "key_release_event" : [
679 " if (this.search_entry.el.is_visible()) {",
680 "\t\tif (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
681 "\t\t print(\"SAVE: ctrl-f pressed\");",
682 "\t\t\tthis.search_entry.el.grab_focus();",
683 "\t\t return false;",
686 "\t\tif (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
687 "\t\t print(\"SAVE: ctrl-g pressed\");",
688 "\t\t\tthis.search_entry.forwardSearch(true);",
689 "\t\t return false;",
694 "\tif (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
695 "\t\tprint(\"SAVE: ctrl-n pressed\");",
696 "\t\tthis.openNewWindow();",
700 " // print(event.key.keyval)",
710 " // hide the file editing..",
712 " //this.hideViewEditing();",
713 " _this.statusbar.el.hide();",
714 " _this.statusbar_errors.el.hide();",
715 " _this.statusbar_warnings.el.hide();",
716 " _this.statusbar_depricated.el.hide();",
717 " _this.statusbar_compile_spinner.el.hide();",
719 " Resources.singleton().checkResources();",
725 "| void setTitle" : [
727 " this.headerbar.el.set_title(this.title + \" - \" + str);",
734 " this.el.show_all();",
738 "| void initChildren" : [
740 " // this needs putting in a better place..",
741 " this.windowstate = new WindowState(this);",
753 "| void openNewWindow" : [
755 "\tXcls_MainWindow.singleton().no_windows++;",
756 " var w = new Xcls_MainWindow();",
760 " w.initChildren();",
761 " w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project);",
762 " // should open the file dialog...",
763 " //w.windowstate.switchState(WindowState.State.FILES);",
770 "name" : "MainWindow",
772 "path" : "/home/alan/gitlive/roobuilder/src/Builder4/MainWindow.bjs",