src/Builder4/WindowLeftProps.bjs
[app.Builder.js] / src / Builder4 / WindowLeftProps.bjs
index 8eb2e4e..6212a22 100644 (file)
@@ -49,9 +49,9 @@
          "$ xns" : "Gtk",
          "items" : [
           {
-           "* pack" : "add",
            "xtype" : "Image",
            "$ stock" : "Gtk.STOCK_ADD",
+           "* pack" : "add",
            "$ xns" : "Gtk",
            "$ icon_size" : "Gtk.IconSize.MENU"
           },
           },
           {
            "listeners" : {
-            "activate" : "  ( ) =>{\n\n    _this.addProp( \"prop\", \"XXXX\", \"\", \"@ void\");\n}"
+            "activate" : "  ( ) =>{\n\n    _this.addProp( \"prop\", \"XXXX\", \"()\", \"@ void\");\n}"
            },
            "label" : "Vala Signal",
            "xtype" : "MenuItem",
            "* pack" : "append",
            "tooltip_markup" : "Add a vala signal",
            "$ xns" : "Gtk"
+          },
+          {
+           "* pack" : "add",
+           "xtype" : "SeparatorMenuItem",
+           "$ xns" : "Gtk"
+          },
+          {
+           "listeners" : {
+            "activate" : "  ( ) =>{\n\n    _this.addProp(\"prop\",  \"flexy:if\", \"value_or_condition\", \"string\");\n}"
+           },
+           "label" : "Flexy - If",
+           "xtype" : "MenuItem",
+           "* pack" : "append",
+           "tooltip_markup" : "Add a flexy if (for HTML templates)",
+           "$ xns" : "Gtk"
+          },
+          {
+           "listeners" : {
+            "activate" : "  ( ) =>{\n\n    _this.addProp(\"prop\",  \"flexy:include\", \"name_of_file.html\", \"string\");\n}"
+           },
+           "label" : "Flexy - Include",
+           "* pack" : "append",
+           "xtype" : "MenuItem",
+           "tooltip_markup" : "Add a flexy include (for HTML templates)",
+           "$ xns" : "Gtk"
+          },
+          {
+           "listeners" : {
+            "activate" : "  ( ) =>{\n\n    _this.addProp(\"prop\",  \"flexy:foreach\", \"array,key,value\", \"string\");\n}"
+           },
+           "label" : "Flexy - Foreach",
+           "* pack" : "append",
+           "xtype" : "MenuItem",
+           "tooltip_markup" : "Add a flexy foreach (for HTML templates)",
+           "$ xns" : "Gtk"
           }
          ]
         }
         "button_press_event" : "  ( ev)  => {\n \n    Gtk.TreeViewColumn col;\n    int cell_x;\n    int cell_y;\n    Gtk.TreePath path;\n    if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {\n        print(\"nothing selected on click\");\n        GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n            this.el.get_selection().unselect_all();\n\n            return false;\n        });\n         _this.before_edit();\n        return false; //not on a element.\n    }\n    \n    \n     // right click.\n     if (ev.type == Gdk.EventType.2BUTTON_PRESS  && ev.button == 1 && col.title == \"Name\") {    \n        // show popup!.   \n        \n \n         _this.before_edit();\n         \n         _this.keyrender.el.stop_editing(false);\n         _this.keyrender.el.editable  =false;\n    \n         _this.valrender.el.stop_editing(false);\n         _this.valrender.el.editable  =false;\n           \n          _this.startEditingKey(path); \n         \n        return false;\n    }\n    \n    \n    \n    \n     // right click.\n     if (ev.type == Gdk.EventType.BUTTON_PRESS  && ev.button == 3) {    \n        // show popup!.   \n        //if (col.title == \"Value\") {\n         //     _this.before_edit();\n         //    return false;\n         //}\n\n        var p = _this.ContextMenu;\n\n        p.el.set_screen(Gdk.Screen.get_default());\n        p.el.show_all();\n        p.el.popup(null, null, null,  ev.button, ev.time);\n        //Seed.print(\"click:\" + res.column.title);\n        // select the \n        GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n  \n            this.el.get_selection().select_path(path);\n            return false;\n        });\n         _this.before_edit();\n        return false;\n    }\n    \n     \n    if (col.title != \"Value\") {\n        print(\"col title != Value\");\n        \n        GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n            this.el.get_selection().select_path(path);\n            return false;\n        });\n        \n        _this.before_edit();\n          //  XObject.error(\"column is not value?\");\n        return false; // ignore.. - key click.. ??? should we do this??\n    }\n    \n    \n    // if the cell can be edited with a pulldown\n    // then we should return true... - and let the start_editing handle it?\n    \n    \n    \n    \n    \n      \n   //             _this.before_edit(); <<< we really need to stop the other editor..\n     _this.keyrender.el.stop_editing(false);\n    _this.keyrender.el.editable  =false;\n    \n           \n    return _this.startEditingValue(path); // assumes selected row..\n        \n   \n\n              \n   \n}"
        },
        "id" : "view",
-       "* init" : "{\n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n    var description = new Pango.FontDescription();\n    description.set_size(8000);\n    this.el.modify_font(description);\n}\n",
+       "* init" : "{\n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n    var description = new Pango.FontDescription();\n    description.set_size(10000);\n    this.el.modify_font(description);\n}\n",
        "tooltip_column" : 5,
        "xtype" : "TreeView",
        "$ enable_tree_lines" : true,