src/Builder4/WindowLeftProps.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 1 Jun 2015 09:16:28 +0000 (17:16 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 1 Jun 2015 09:16:28 +0000 (17:16 +0800)
src/Builder4/WindowLeftProps.vala

src/Builder4/WindowLeftProps.bjs
src/Builder4/WindowLeftProps.vala

index 94a4fae..0dfcf01 100644 (file)
@@ -24,9 +24,9 @@
    "|              void deleteSelected" : " () {\n    \n        Gtk.TreeIter iter;\n        Gtk.TreeModel mod;\n        \n        var s = this.view.el.get_selection();\n        s.get_selected(out mod, out iter);\n             \n              \n        GLib.Value gval;\n        mod.get_value(iter, 0 , out gval);\n        var type = (string)gval;\n        \n        mod.get_value(iter, 1 , out gval);\n        var key = (string)gval;\n        \n        switch(type) {\n            case \"listener\":\n                this.node.listeners.unset(key);\n                break;\n                \n            case \"props\":\n                this.node.props.unset(key);\n                break;\n        }\n        this.load(this.file, this.node);\n        \n        _this.changed();\n}",
    "$ xns" : "Gtk",
    "|              void startEditingKey" : "( Gtk.TreePath path) {\n    \n     if (!this.stop_editor()) {\n        return;\n     }\n  \n    // others... - fill in options for true/false?\n    \n       \n    GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n        this.allow_edit  = true;\n        this.keyrender.el.editable = true;\n     \n        this.view.el.set_cursor_on_cell(\n            path,\n            this.keycol.el,\n            this.keyrender.el,\n            true\n        );\n               \n        return false;\n    });\n      \n    \n}\n",
-   "| return_type XXXX" : "() {\n\n}\n",
    "@ void show_add_props" : "(string type)",
    "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+   "| Gtk.TreeIter keyToIter" : "() {\n\n}\n",
    "$ homogeneous" : "false   ",
    "# Xcls_MainWindow main_window" : "null",
    "|              void addProp" : " (string in_type, string key, string value, string value_type) {\n      // info includes key, val, skel, etype..\n      //console.dump(info);\n        //type = info.type.toLowerCase();\n        //var data = this.toJS();\n          \n    var type = in_type == \"signals\" ? \"listener\" : in_type;\n      \n    var fkey = (value_type.length > 0 ? value_type + \" \" : \"\") + key;\n              \n    if (type == \"listener\") {\n        if (this.node.listeners.has_key(key)) {\n            return;\n        }\n        this.node.listeners.set(key,value);\n    } else  {\n    \n        if (this.node.props.has_key(fkey)) {\n            return;\n        }\n        this.node.props.set(fkey,value);\n    }\n            \n      \n    // add a row???\n    this.load(this.file, this.node);\n    \n    \n    \n    /// need to find the row which I've just added..\n    \n    \n    var s = this.view.el.get_selection();\n    s.unselect_all();\n    \n    print(\"trying to find new iter\");\n  \n    this.model.el.foreach((model, path, iter) => {\n        GLib.Value gval;\n    \n        this.model.el.get_value(iter, 0 , out gval);\n        if ((string)gval != type) {\n            print(\"not type: %s = %s\\n\", (string)gval , type);\n            return false;\n        }\n        this.model.el.get_value(iter, 1 , out gval);\n        if ((string)gval != fkey) {\n            print(\"not key: %s = %s\\n\", (string)gval , fkey);\n            return false;\n        }\n        // delay this?\n        GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {\n        \n            this.startEditingValue(this.model.el.get_path(iter));\n            return false;\n        });\n        //s.select_iter(iter);\n        return true; \n    });\n    \n    \n    \n              \n}\n",
index 197420f..7e2d413 100644 (file)
@@ -435,7 +435,7 @@ public class Xcls_LeftProps : Object
           
         
     }
-    public return_type XXXX () {
+    public Gtk.TreeIter keyToIter () {
     
     }
     public              void addProp (string in_type, string key, string value, string value_type) {