"drag_motion": " ( ctx, x, y, time) => {\n \n // the point of this is to detect where an item could be dropped..\n \n this.drag_in_motion = true;\n this.drag_x = x;\n this.drag_y = y;\n \n // request data that will be recieved by the recieve... \n Gtk.drag_get_data\n (\n this.el, // will receive 'drag-data-received' signal \n ctx, // represents the current state of the DnD \n Gdk.Atom.intern(\"STRING\",true), // the target type we want \n time // time stamp \n );\n return true;\n \n}",
"drag_drop": " ( ctx, x, y, time) => {\n //Seed.print(\"TARGET: drag-drop\");\n this.drag_in_motion = false; \n // request data that will be recieved by the recieve... \n Gtk.drag_get_data\n (\n this.el, // will receive 'drag-data-received' signal \n ctx, // represents the current state of the DnD \n Gdk.Atom.intern(\"STRING\",true), // the target type we want \n time // time stamp \n );\n\n \n // No target offered by source => error\n \n\n return false;\n}",
"drag_data_received": " (ctx, x, y, sel, info, time) => {\n //print(\"Tree: drag-data-received\");\n\n\n \n \n //console.log(\"LEFT-TREE: drag-motion\");\n var src = Gtk.drag_get_source_widget(ctx);\n \n // a drag from elsewhere...- prevent drop..\n if (src != this.el) {\n //print(\"no drag data!\");\n // fix-me - this.. needs to handle comming from the palete...\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n // no drop action...\n return;\n }\n \n var targetData = \"\";\n //var action = Gdk.DragAction.COPY;\n // unless we are copying!!! ctl button..\n var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ? Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;\n \n \n if (_this.model.el.iter_n_children(null) < 1) {\n // no children.. -- asume it's ok..\n \n targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n if (this.drag_in_motion) { \n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); \n Gdk.drag_status(ctx, action ,time);\n return;\n }\n // continue through to allow drop...\n\n } else {\n \n \n\n //print(\"GETTING POS\");\n Gtk.TreePath path;\n Gtk.TreeViewDropPosition pos;\n var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n \n //print(\"ISOVER? \" + isOver);\n if (!isOver) {\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); \n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return; // not over apoint!?! - no action on drop or motion..\n }\n \n // drag node is parent of child..\n //console.log(\"SRC TREEPATH: \" + src.treepath);\n //console.log(\"TARGET TREEPATH: \" + data.path.to_string());\n \n // nned to check a few here..\n //Gtk.TreeViewDropPosition.INTO_OR_AFTER\n //Gtk.TreeViewDropPosition.INTO_OR_BEFORE\n //Gtk.TreeViewDropPosition.AFTER\n //Gtk.TreeViewDropPosition.BEFORE\n \n // what's in the selected data....\n var selection_text = sel.get_text();\n \n \n \n if (selection_text == null || selection_text.length < 1) {\n //print(\"Error - drag selection text returned NULL\");\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return; /// -- fixme -- this is not really correct..\n } \n \n // see if we are dragging into ourself?\n print (\"got selection text of \" + selection_text);\n \n var target_path = path.to_string();\n //print(\"target_path=\"+target_path);\n\n // \n if (selection_text == target_path) {\n print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0 ,time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n\n return; /// -- fixme -- this is not really correct..\n\n }\n \n // check that \n //print(\"DUMPING DATA\");\n //console.dump(data);\n // path, pos\n \n //print(data.path.to_string() +' => '+ data.pos);\n \n // dropList is a list of xtypes that this node could be dropped on.\n // it is set up when we start to drag..\n \n \n targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);\n \n print(\"targetDAta: \" + targetData +\"\\n\");\n \n if (targetData.length < 1) {\n //print(\"Can not find drop node path\");\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return;\n }\n \n var td_ar = targetData.split(\"|\");\n //print (\"highlight drop path\\n\");\n // drop ontop of same node?\n/* if (ctx.get_actions() == Gdk.DragAction.MOVE && td_ar[0] == selection_text && td_ar[1] == \"0\" ) {\n if (this.drag_in_motion) {\n Gdk.drag_status(ctx, 0, time);\n this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n return;\n }\n Gtk.drag_finish (ctx, false, false, time); // drop failed..\n return;\n \n }\n */ \n \n //console.dump(tg);\n \n \n if (this.drag_in_motion) { \n Gdk.drag_status(ctx, action ,time);\n this.highlightDropPath(td_ar[0], (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n return;\n }\n // continue on to allow drop..\n }\n\n // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n\n\n var delete_selection_data = false;\n \n if (ctx.get_actions() == Gdk.DragAction.ASK) {\n /* Ask the user to move or copy, then set the ctx action. */\n }\n\n if (ctx.get_actions() == Gdk.DragAction.MOVE) {\n delete_selection_data = true;\n }\n \n \n // drag around.. - reorder..\n _this.model.moveNode(targetData, ctx.get_actions());\n \n \n \n \n \n // we can send stuff to souce here...\n\n\n // do we always say failure, so we handle the reall drop?\n Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);\n \n}",
- "cursor_changed": " ( ) => {\n\n\n if (this.blockChanges) { // probably not needed.. \n return ;\n }\n _this.before_node_change(null);\n \n if (_this.model.file == null) {\n return;\n } \n \n //var render = this.get('/LeftTree').getRenderer(); \n \n \n if (this.el.get_selection().count_selected_rows() < 1) {\n\n\n //??this.model.load( false);\n _this.after_node_change(null);\n \n return ;\n }\n \n //console.log('changed');\n var s = this.el.get_selection();\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n s.get_selected(out mod, out iter);\n \n \n // var val = \"\";\n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n _this.model.activePath = mod.get_path(iter).to_string();\n \n var node = (JsRender.Node)value.dup_object();\n\n _this.after_node_change(node);\n\n// _this.model.file.changed(node, \"tree\");\n \n //Seed.print( value.get_string());\n return ;\n \n}",
+ "cursor_changed": " ( ) => {\n\n\n if (this.blockChanges) { // probably not needed.. \n return ;\n }\n _this.before_node_change(null);\n \n if (_this.model.file == null) {\n return;\n } \n \n //var render = this.get('/LeftTree').getRenderer(); \n \n \n if (this.el.get_selection().count_selected_rows() < 1) {\n\n\n //??this.model.load( false);\n _this.after_node_change(null);\n \n return ;\n}\n \n //console.log('changed');\n var s = this.el.get_selection();\n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n s.get_selected(out mod, out iter);\n \n \n // var val = \"\";\n GLib.Value value;\n _this.model.el.get_value(iter, 2, out value);\n _this.model.activePath = mod.get_path(iter).to_string();\n \n var node = (JsRender.Node)value.dup_object();\n _this.node_selected(node);\n \n //_this.after_node_change(node);\n\n// _this.model.file.changed(node, \"tree\");\n \n //Seed.print( value.get_string());\n return ;\n \n}",
"drag_data_get": " ( drag_context, data, info, time) => {\n\n\n print(\"drag-data-get\");\n var s = this.el.get_selection();\n if (s.count_selected_rows() < 1) {\n data.set_text(\"\",0); \n print(\"return empty string - no selection..\");\n return;\n }\n \n Gtk.TreeIter iter;\n Gtk.TreeModel mod;\n \n s.get_selected(out mod, out iter);\n \n \n var tp = mod.get_path(iter).to_string();\n data.set_text(tp,tp.length);\n print(\"return \" + tp);\n}"
},
".bool:blockChanges": "false",
_this.after_node_change(null);
return ;
- }
-
- //console.log('changed');
- var s = this.el.get_selection();
- Gtk.TreeIter iter;
- Gtk.TreeModel mod;
- s.get_selected(out mod, out iter);
-
-
- // var val = "";
- GLib.Value value;
- _this.model.el.get_value(iter, 2, out value);
- _this.model.activePath = mod.get_path(iter).to_string();
+ }
- var node = (JsRender.Node)value.dup_object();
-
- _this.after_node_change(node);
+ //console.log('changed');
+ var s = this.el.get_selection();
+ Gtk.TreeIter iter;
+ Gtk.TreeModel mod;
+ s.get_selected(out mod, out iter);
+
+
+ // var val = "";
+ GLib.Value value;
+ _this.model.el.get_value(iter, 2, out value);
+ _this.model.activePath = mod.get_path(iter).to_string();
+
+ var node = (JsRender.Node)value.dup_object();
+ _this.node_selected(node);
+
+ //_this.after_node_change(node);
// _this.model.file.changed(node, "tree");
-
- //Seed.print( value.get_string());
- return ;
+
+ //Seed.print( value.get_string());
+ return ;
},
drag_data_get : ( drag_context, data, info, time) => {
_this.after_node_change(null);
return ;
- }
-
- //console.log('changed');
- var s = this.el.get_selection();
- Gtk.TreeIter iter;
- Gtk.TreeModel mod;
- s.get_selected(out mod, out iter);
-
-
- // var val = "";
- GLib.Value value;
- _this.model.el.get_value(iter, 2, out value);
- _this.model.activePath = mod.get_path(iter).to_string();
+ }
- var node = (JsRender.Node)value.dup_object();
-
- _this.after_node_change(node);
+ //console.log('changed');
+ var s = this.el.get_selection();
+ Gtk.TreeIter iter;
+ Gtk.TreeModel mod;
+ s.get_selected(out mod, out iter);
+
+
+ // var val = "";
+ GLib.Value value;
+ _this.model.el.get_value(iter, 2, out value);
+ _this.model.activePath = mod.get_path(iter).to_string();
+
+ var node = (JsRender.Node)value.dup_object();
+ _this.node_selected(node);
+
+ //_this.after_node_change(node);
// _this.model.file.changed(node, "tree");
-
- //Seed.print( value.get_string());
- return ;
+
+ //Seed.print( value.get_string());
+ return ;
} );
this.el.drag_data_get.connect( ( drag_context, data, info, time) => {