From: Alan Knowles Date: Thu, 28 May 2015 08:04:39 +0000 (+0800) Subject: src/Builder4/MainWindow.bjs X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=commitdiff_plain;h=894a6e977eb7751a32719b005842b9c8cf49c95b src/Builder4/MainWindow.bjs src/Builder4/MainWindow.vala --- diff --git a/src/Builder4/MainWindow.bjs b/src/Builder4/MainWindow.bjs index 0b8b2af83..a923a095d 100644 --- a/src/Builder4/MainWindow.bjs +++ b/src/Builder4/MainWindow.bjs @@ -31,8 +31,8 @@ "items" : [ { "id" : "headerbar", - "xtype" : "HeaderBar", "* pack" : "set_titlebar", + "xtype" : "HeaderBar", "bool show_close_button" : true, "$ xns" : "Gtk", "string title" : "Application Builder", @@ -45,8 +45,8 @@ "items" : [ { "bool use_popover" : false, - "xtype" : "MenuButton", "* pack" : "add", + "xtype" : "MenuButton", "$ xns" : "Gtk", "items" : [ { @@ -60,9 +60,9 @@ "listeners" : { "activate" : " ( ) => {\n Xcls_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}" }, + "* pack" : "append", "xtype" : "MenuItem", "string label" : "Open a new Window", - "* pack" : "append", "$ xns" : "Gtk" }, { @@ -74,26 +74,26 @@ "listeners" : { "activate" : " ( ) => {\n Resources.singleton().fetchStart();\n}" }, + "string label" : "Download updated Resources", "* pack" : "append", "xtype" : "MenuItem", - "string label" : "Download updated Resources", "$ xns" : "Gtk" }, { "listeners" : { "activate" : "() => {\n About.singleton().el.show();\n }" }, + "xtype" : "MenuItem", "string label" : "About the Builder", "* pack" : "append", - "xtype" : "MenuItem", "$ xns" : "Gtk" } ] }, { + "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "help-about", - "* pack" : "set_image", "$ xns" : "Gtk" } ] @@ -104,8 +104,8 @@ }, { "id" : "vbox", - "* pack" : "add", "xtype" : "Box", + "* pack" : "add", "$ xns" : "Gtk", "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", "$ homogeneous" : false, @@ -121,29 +121,29 @@ "items" : [ { "id" : "leftpane", - "xtype" : "Box", "* pack" : "add1", + "xtype" : "Box", "$ xns" : "Gtk", "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", "items" : [ { "id" : "editpane", - "xtype" : "Paned", "* pack" : "pack_start,true,true,0", + "xtype" : "Paned", "$ xns" : "Gtk", "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", "items" : [ { "id" : "tree", - "xtype" : "Box", "* pack" : "add1", + "xtype" : "Box", "$ xns" : "Gtk", "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL" }, { "id" : "props", - "xtype" : "Box", "* pack" : "add2", + "xtype" : "Box", "$ xns" : "Gtk", "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL" } @@ -224,8 +224,8 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "xtype" : "Actor", "* pack" : "add_child", + "xtype" : "Actor", "$ xns" : "GtkClutter", "items" : [ { @@ -233,16 +233,16 @@ "clicked" : " ( ) => {\n \n _this.windowstate.switchState(WindowState.State.PREVIEW);\n \n\n}" }, "utf8 tooltip_text" : "Back", - "* pack" : false, "xtype" : "Button", + "* pack" : false, "width_request" : 50, "$ xns" : "Gtk", "height_request" : 50, "items" : [ { + "utf8 icon_name" : "go-previous", "* pack" : "set_image", "xtype" : "Image", - "utf8 icon_name" : "go-previous", "$ xns" : "Gtk" } ] @@ -260,8 +260,8 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "* pack" : "add_child", "xtype" : "Actor", + "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { @@ -276,9 +276,9 @@ "$ tooltop_text" : "\"Open File\"", "items" : [ { + "xtype" : "Image", "utf8 icon_name" : "document-open", "* pack" : "set_image", - "xtype" : "Image", "$ xns" : "Gtk" } ] @@ -296,8 +296,8 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "* pack" : "add_child", "xtype" : "Actor", + "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { @@ -312,9 +312,9 @@ "height_request" : 50, "items" : [ { + "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "document-properties", - "* pack" : "set_image", "$ xns" : "Gtk" } ] @@ -332,8 +332,8 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "* pack" : "add_child", "xtype" : "Actor", + "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { @@ -348,9 +348,9 @@ "height_request" : 50, "items" : [ { + "utf8 icon_name" : "emblem-system", "* pack" : "set_image", "xtype" : "Image", - "utf8 icon_name" : "emblem-system", "$ xns" : "Gtk" } ] @@ -372,8 +372,8 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "* pack" : "add_child", "xtype" : "Actor", + "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { @@ -388,9 +388,9 @@ "height_request" : 50, "items" : [ { + "xtype" : "Image", "utf8 icon_name" : "list-add", "* pack" : "set_image", - "xtype" : "Image", "$ xns" : "Gtk" } ] @@ -408,8 +408,8 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "* pack" : "add_child", "xtype" : "Actor", + "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { @@ -424,9 +424,9 @@ "height_request" : 50, "items" : [ { + "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "format-justify-left", - "* pack" : "set_image", "$ xns" : "Gtk" } ] @@ -444,8 +444,8 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "* pack" : "add_child", "xtype" : "Actor", + "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { @@ -460,9 +460,9 @@ "height_request" : 50, "items" : [ { + "utf8 icon_name" : "appointment-new", "* pack" : "set_image", "xtype" : "Image", - "utf8 icon_name" : "appointment-new", "$ xns" : "Gtk" } ] @@ -480,8 +480,8 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "* pack" : "add_child", "xtype" : "Actor", + "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { @@ -496,9 +496,9 @@ "height_request" : 50, "items" : [ { + "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "folder-new", - "* pack" : "set_image", "$ xns" : "Gtk" } ] @@ -516,13 +516,13 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "* pack" : "add_child", "xtype" : "Actor", + "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { "listeners" : { - "clicked" : " () => {\n // create a new file in project..\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 \n \n var f = JsRender.JsRender.factory(proj.xtype, proj, \"\");\n _this.project = proj;\n \n _this.windowstate.file_details.show(\n f, this.el\n );\n \n \n return ; \n}" + "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}" }, "* pack" : false, "xtype" : "Button", @@ -532,9 +532,9 @@ "height_request" : 50, "items" : [ { + "xtype" : "Image", "utf8 icon_name" : "document-new", "* pack" : "set_image", - "xtype" : "Image", "$ xns" : "Gtk" } ] @@ -552,8 +552,8 @@ "items" : [ { "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);", - "* pack" : "add_child", "xtype" : "Actor", + "* pack" : "add_child", "$ xns" : "GtkClutter", "items" : [ { @@ -568,9 +568,9 @@ "height_request" : 50, "items" : [ { + "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "user-trash", - "* pack" : "set_image", "$ xns" : "Gtk" } ] @@ -589,21 +589,21 @@ }, { "bool homogeneous" : false, - "xtype" : "Box", "* pack" : "pack_end,false,true,0", + "xtype" : "Box", "$ xns" : "Gtk", "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", "items" : [ { + "xtype" : "Label", "string label" : " ", "* pack" : "pack_start,true,true,0", - "xtype" : "Label", "$ xns" : "Gtk" }, { "bool show_text" : true, - "id" : "statusbar", "ulong handler_id" : "-1", + "id" : "statusbar", "* 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", "xtype" : "ProgressBar", "* pack" : "pack_start,true,true,0", @@ -615,9 +615,9 @@ "$ xns" : "Gtk", "items" : [ { + "string label" : "Compile Status:", "* pack" : "add", "xtype" : "MenuItem", - "string label" : "Compile Status:", "$ xns" : "Gtk" }, { @@ -635,9 +635,9 @@ "$ xns" : "Gtk", "items" : [ { + "utf8 icon_name" : "dialog-error", "* pack" : "set_image", "xtype" : "Image", - "utf8 icon_name" : "dialog-error", "$ xns" : "Gtk" } ] @@ -657,9 +657,9 @@ "$ xns" : "Gtk", "items" : [ { + "xtype" : "Image", "utf8 icon_name" : "dialog-warning", "* pack" : "set_image", - "xtype" : "Image", "$ xns" : "Gtk" } ] @@ -679,9 +679,9 @@ "$ xns" : "Gtk", "items" : [ { + "* pack" : "set_image", "xtype" : "Image", "utf8 icon_name" : "dialog-information", - "* pack" : "set_image", "$ xns" : "Gtk" } ] @@ -699,9 +699,9 @@ "$ xns" : "Gtk", "items" : [ { + "xtype" : "Image", "utf8 icon_name" : "media-playback-start", "* pack" : "set_image", - "xtype" : "Image", "$ xns" : "Gtk" } ] diff --git a/src/Builder4/MainWindow.vala b/src/Builder4/MainWindow.vala index aeb5bf96a..1950321ab 100644 --- a/src/Builder4/MainWindow.vala +++ b/src/Builder4/MainWindow.vala @@ -2004,7 +2004,7 @@ public class Xcls_MainWindow : Object //listeners this.el.clicked.connect( () => { // create a new file in project.. - + print("add file selected\n"); // what's the currently selected project... var proj = _this.windowstate.left_projects.getSelectedProject(); @@ -2013,11 +2013,11 @@ public class Xcls_MainWindow : Object return ; } - + print("creating file?"); var f = JsRender.JsRender.factory(proj.xtype, proj, ""); _this.project = proj; - + print("showing popup?"); _this.windowstate.file_details.show( f, this.el );