From 9cb9ecc25280020a47fa1eb0827e7b7f2742c287 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 24 Sep 2014 15:45:25 +0800 Subject: [PATCH] Builder4/WindowLeftProps.bjs Builder4/WindowLeftProps.vala --- Builder4/WindowLeftProps.bjs | 2 +- Builder4/WindowLeftProps.vala | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Builder4/WindowLeftProps.bjs b/Builder4/WindowLeftProps.bjs index a831e352e..c071cf6fc 100644 --- a/Builder4/WindowLeftProps.bjs +++ b/Builder4/WindowLeftProps.bjs @@ -176,7 +176,7 @@ "items" : [ { "listeners" : { - "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) { \n // show popup!. \n if (col.title == \"Value\") {\n \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 \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 \n // currently editing???\n// if ( this.activePath) {\n \n // this.activePath = false;\n // stop editing!!!!\n /*\n if (this.get('/Editor').dirty) {\n //if (!this.get('/Editor.buffer').checkSyntax()) {\n // this.get('/StandardErrorDialog').show(\"Fix errors in code and save..\"); \n // return true;\n // // error Dialog\n //}\n if (!this.get('/Editor.view').save()) {\n return true;\n }\n } \n */\n \n //this.EditProps.editableColumn.items[0].el.stop_editing();\n //this.EditProps.editing = false;\n \n // XObject.error(\"Currently editing?\");\n // return false;\n // }\n \n // var renderer = this.valrender.el; // set has_entry..\n \n //var type = this.get('/LeftPanel.model').getType(res.path.to_string());\n \n // get options for this type -- this is to support option lists etc..\n //var provider = this.get('/LeftTree').getPaleteProvider();\n //var opts = provider.findOptions(type);\n \n// if (opts === false) {\n // it's text etnry\n// this.get('/LeftPanel').editableColumn.setOptions([]);\n// renderer.has_entry = true;\n// } else {\n// this.get('/LeftPanel').editableColumn.setOptions(opts);\n// renderer.has_entry = false;\n// }\n\n // we need to set the selected row..\n \n //Gtk.TreePath path;\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}" + "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) { \n // show popup!. \n if (col.title == \"Value\") {\n \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 \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 \n // currently editing???\n// if ( this.activePath) {\n \n // this.activePath = false;\n // stop editing!!!!\n /*\n if (this.get('/Editor').dirty) {\n //if (!this.get('/Editor.buffer').checkSyntax()) {\n // this.get('/StandardErrorDialog').show(\"Fix errors in code and save..\"); \n // return true;\n // // error Dialog\n //}\n if (!this.get('/Editor.view').save()) {\n return true;\n }\n } \n */\n \n //this.EditProps.editableColumn.items[0].el.stop_editing();\n //this.EditProps.editing = false;\n \n // XObject.error(\"Currently editing?\");\n // return false;\n // }\n \n // var renderer = this.valrender.el; // set has_entry..\n \n //var type = this.get('/LeftPanel.model').getType(res.path.to_string());\n \n // get options for this type -- this is to support option lists etc..\n //var provider = this.get('/LeftTree').getPaleteProvider();\n //var opts = provider.findOptions(type);\n \n// if (opts === false) {\n // it's text etnry\n// this.get('/LeftPanel').editableColumn.setOptions([]);\n// renderer.has_entry = true;\n// } else {\n// this.get('/LeftPanel').editableColumn.setOptions(opts);\n// renderer.has_entry = false;\n// }\n\n // we need to set the selected row..\n \n //Gtk.TreePath path;\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", diff --git a/Builder4/WindowLeftProps.vala b/Builder4/WindowLeftProps.vala index 21e573357..80546add2 100644 --- a/Builder4/WindowLeftProps.vala +++ b/Builder4/WindowLeftProps.vala @@ -1117,10 +1117,10 @@ public class Xcls_LeftProps : Object // right click. if (ev.type == Gdk.EventType.BUTTON_PRESS && ev.button == 3) { // show popup!. - if (col.title == "Value") { - _this.before_edit(); - return false; - } + //if (col.title == "Value") { + // _this.before_edit(); + // return false; + //} var p = _this.ContextMenu; -- 2.39.2