+ "button_press_event" : [
+ " ( ev) => {",
+ " //console.log(\"button press?\");",
+ " this.button_is_pressed = true;",
+ " print(\"BUTTON DOWN\\n\");",
+ " ",
+ " this.lastEventSource = \"tree\";",
+ " if (! _this.before_node_change() ) {",
+ " ",
+ " return true;",
+ " }",
+ " ",
+ "",
+ " ",
+ " if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {",
+ " //print(\"click\" + ev.type);",
+ " return false;",
+ " }",
+ " Gtk.TreePath res;",
+ " if (!_this.view.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {",
+ " return true;",
+ " }",
+ " ",
+ " this.el.get_selection().select_path(res);",
+ " ",
+ " //if (!this.get('/LeftTreeMenu').el) { ",
+ " // this.get('/LeftTreeMenu').init(); ",
+ " // }",
+ " ",
+ " _this.LeftTreeMenu.el.set_screen(Gdk.Screen.get_default());",
+ " _this.LeftTreeMenu.el.show_all();",
+ " _this.LeftTreeMenu.el.popup(null, null, null, 3, ev.time);",
+ " // print(\"click:\" + res.path.to_string());",
+ " return true;",
+ "}"
+ ],
+ "button_release_event" : [
+ "(ev) => { ",
+ " this.button_is_pressed = false;",
+ " return false;",
+ "}"
+ ],
+ "cursor_changed" : [
+ " ( ) => {",
+ " print(\"LEFT TREE Cursor Changed\\n\");",
+ "\tif (!this.button_is_pressed && !this.key_is_pressed) {",
+ "\t\t// then event was started by some other action",
+ "\t\t// which should manually trigger all the events..",
+ "\t\tprint(\"SKIPPING select - no button or key pressed\\n\");",
+ "\t\treturn;",
+ "\t}",
+ "",
+ "",
+ " if (this.blockChanges) { // probably not needed.. ",
+ "\t\tprint(\"SKIPPING select - blockchanges set..\\n\"); ",
+ " return ;",
+ " }",
+ " if (!_this.before_node_change( ) ) {",
+ "\t this.blockChanges = true;",
+ "\t this.el.get_selection().unselect_all();",
+ "\t this.blockChanges = false;",
+ "\t ",
+ "\t return;",
+ " }",
+ " if (_this.main_window.windowstate.file == null) {",
+ " \t\tprint(\"SKIPPING select windowstate file is not set...\\n\"); ",
+ " return;",
+ " } ",
+ " ",
+ " //var render = this.get('/LeftTree').getRenderer(); ",
+ " print(\"LEFT TREE -> view -> selection changed called\\n\");",
+ " ",
+ " ",
+ " // -- it appears that the selection is not updated.",
+ " ",
+ " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
+ " print(\"LEFT TREE -> view -> selection changed TIMEOUT CALLED\\n\");",
+ "",
+ " if (this.el.get_selection().count_selected_rows() < 1) {",
+ "",
+ " print(\"selected rows < 1\\n\");",
+ " //??this.model.load( false);",
+ " _this.node_selected(null, this.lastEventSource);",
+ " ",
+ " return false ;",
+ " }",
+ " ",
+ " //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();",
+ " print (\"calling left_tree.node_selected\\n\");",
+ " _this.node_selected(node, this.lastEventSource);",
+ " while (Gtk.events_pending()) {",
+ " Gtk.main_iteration();",
+ " }",
+ " var cp = mod.get_path(iter);",
+ " Gtk.TreePath sp, ep;",
+ " this.el.get_visible_range(out sp, out ep);",
+ " // if sp is before cp then retuns 1.",
+ " // if cp is before ep then retuns 1.",
+ " if (cp.compare(sp) >= 0 && ep.compare(cp) >=1) {",
+ " return false;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " this.el.scroll_to_cell(new Gtk.TreePath.from_string(_this.model.activePath), null, true, 0.1f,0.0f);",
+ " ",
+ " return false;",
+ " }); ",
+ " //_this.after_node_change(node);",
+ "",
+ "// _this.model.file.changed(node, \"tree\");",
+ " ",
+ " //Seed.print( value.get_string());",
+ " return ;",
+ " ",
+ "}"
+ ],
+ "drag_begin" : [
+ "( ctx) => {",
+ "\t//print('SOURCE: drag-begin');",
+ " ",
+ " ",
+ " //this.targetData = \"\";",
+ " ",
+ " // find what is selected in our tree...",
+ " ",
+ " var s = _this.view.el.get_selection();",
+ " if (s.count_selected_rows() < 1) {",
+ " return;",
+ " }",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ " s.get_selected(out mod, out iter);",
+ "",
+ " ",
+ "",
+ " // set some properties of the tree for use by the dropped element.",
+ " GLib.Value value;",
+ " _this.model.el.get_value(iter, 2, out value);",
+ " var tp = mod.get_path(iter).to_string();",
+ " var data = (JsRender.Node)(value.dup_object());",
+ " var xname = data.fqn();",
+ " print (\"XNAME IS \" + xname+ \"\\n\");",
+ " this.dragData = tp;",
+ " this.dropList = _this.main_window.windowstate.file.palete().getDropList(xname);",
+ " ",
+ " print (\"DROP LIST IS \" + string.joinv(\", \", this.dropList) + \"\\n\");",
+ " ",
+ "",
+ " // make the drag icon a picture of the node that was selected",
+ " ",
+ " ",
+ " // by default returns the path..",
+ " var path = _this.model.el.get_path(iter);",
+ "",
+ " ",
+ " var pix = this.el.create_row_drag_icon ( path);",
+ " ",
+ " Gtk.drag_set_icon_surface (ctx, pix) ;",
+ " ",
+ " return;",
+ "}"
+ ],
+ "drag_data_get" : [
+ "( drag_context, data, info, time) => {",
+ " ",
+ " ",
+ " //print(\"drag-data-get\");",
+ " var s = this.el.get_selection();",
+ " if (s.count_selected_rows() < 1) {",
+ " data.set_text(\"\",0); ",
+ " print(\"return empty string - no selection..\");",
+ " return;",
+ " }",
+ " ",
+ " Gtk.TreeIter iter;",
+ " Gtk.TreeModel mod;",
+ " ",
+ " s.get_selected(out mod, out iter);",
+ " ",
+ " ",
+ " ",
+ " GLib.Value value;",
+ " _this.model.el.get_value(iter, 2, out value);",
+ " var ndata = (JsRender.Node)(value.dup_object());",
+ " ",
+ " ",
+ " ",
+ " var tp = mod.get_path(iter).to_string();",
+ " // by default returns the path..",
+ " ",
+ " if ( info != Gdk.Atom.intern(\"STRING\",true) ) {",
+ " tp = ndata.toJsonString();",
+ " } ",
+ " ",
+ " //data.set_text(tp,tp.length); ",
+ " ",
+ " data.set (data.get_target (), 8, (uchar[]) tp.to_utf8 ());",
+ " ",
+ " ",
+ " // print(\"return \" + tp);",
+ " }"
+ ],
+ "drag_data_received" : [
+ " (ctx, x, y, sel, info, time) => {",
+ " ",
+ " // THIS CODE ONLY RELATES TO drag or drop of \"NEW\" elements or \"FROM another tree..\"",
+ " ",
+ " ",
+ " // print(\"Tree: drag-data-received\\n\");",
+ " var selection_text = (string)sel.get_data();",
+ " //print(\"selection_text= %s\\n\",selection_text);",
+ "",
+ " var is_drag = this.drag_in_motion;",
+ " ",
+ " ",
+ "",
+ "\t\tGLib.debug(\"Is Drag %s\\n\", is_drag ? \"Y\": \"N\");",
+ " var targetData = \"\";",
+ " ",
+ " Gtk.TreePath path;",
+ " Gtk.TreeViewDropPosition pos;",
+ " var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);",
+ " ",
+ " // if there are not items in the tree.. the we have to set isOver to true for anything..",
+ " var isEmpty = false;",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " GLib.debug(\"got NO children?\\n\");",
+ " isOver = true; //??? ",
+ " isEmpty = true;",
+ " pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;",
+ " }",
+ " ",
+ " ",
+ " //console.log(\"LEFT-TREE: drag-motion\");",
+ " var src = Gtk.drag_get_source_widget(ctx);",
+ " ",
+ " // a drag from self - this should be handled by drop and motion.",
+ " if (src == this.el) {",
+ " GLib.debug(\"Source == this element should not happen.. ? \\n\");",
+ " return;",
+ " }",
+ " //print(\"drag_data_recieved from another element\");",
+ " ",
+ " ",
+ " ",
+ " ",
+ " if (selection_text == null || selection_text.length < 1 || !isOver) {",
+ " // nothing valid foudn to drop...",
+ " GLib.debug(\"empty sel text or not over\");",
+ " if (is_drag) {",
+ " Gdk.drag_status(ctx, 0, time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return;",
+ " }",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " // no drop action...",
+ " return; ",
+ " ",
+ " }",
+ " var dropNode = new JsRender.Node(); ",
+ " ",
+ " var dropNodeType = selection_text;",
+ " var show_templates = true;",
+ " // for drop",
+ " if (dropNodeType[0] == '{') {",
+ " var pa = new Json.Parser();",
+ " try {",
+ " pa.load_from_data(dropNodeType);",
+ " } catch (Error e) {",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " // no drop action...",
+ " return; ",
+ " }",
+ " ",
+ " dropNode.loadFromJson( pa.get_root().get_object(), 2);",
+ " dropNodeType = dropNode.fqn();",
+ " show_templates = false;",
+ " ",
+ " ",
+ " } else {",
+ " \tif (selection_text.contains(\":\")) {",
+ "\t \tvar bits = selection_text.split(\":\");",
+ "\t dropNode.setFqn(bits[0]);",
+ "\t dropNode.props.set(\"* prop\", bits[1]);",
+ " \t} else {",
+ "",
+ "\t dropNode.setFqn(selection_text);",
+ " }",
+ " }",
+ "",
+ " ",
+ " // dropList --- need to gather this ... ",
+ " GLib.debug(\"get dropList for : %s\\n\",dropNodeType); ",
+ " var dropList = _this.main_window.windowstate.file.palete().getDropList(dropNodeType);",
+ " ",
+ " GLib.debug(\"dropList: %s\\n\", string.joinv(\" , \", dropList));",
+ " ",
+ " // if drag action is link ... then we can drop it anywahere...",
+ " if ((ctx.get_actions() & Gdk.DragAction.LINK) > 0) {",
+ " // if path is null?? dragging into an empty tree?",
+ " targetData = (path == null ? \"\" : path.to_string()) + \"|%d\".printf((int)pos);",
+ " } else {",
+ " ",
+ " ",
+ " targetData = _this.model.findDropNodeByPath( isEmpty ? \"\" : path.to_string(), dropList, pos);",
+ " }",
+ " ",
+ " ",
+ " ",
+ " GLib.debug(\"targetDAta: %s\", targetData );",
+ " ",
+ " if (targetData.length < 1) {",
+ " ",
+ " // invalid drop path..",
+ " if (this.drag_in_motion) {",
+ " Gdk.drag_status(ctx, 0, time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return;",
+ " }",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " // no drop action...",
+ " return;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " var td_ar = targetData.split(\"|\");",
+ " ",
+ " ",
+ " if (this.drag_in_motion) { ",
+ " Gdk.drag_status(ctx, Gdk.DragAction.COPY ,time);",
+ "",
+ " this.highlightDropPath( td_ar[0] , (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));",
+ " return;",
+ " }",
+ " // continue on to allow drop..",
+ " ",
+ "",
+ " // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..",
+ " //targetData",
+ " \t\t// {parent}|{pos}|{prop}",
+ " ",
+ "",
+ " _this.model.dropNode(targetData, dropNode, show_templates);",
+ " GLib.debug(\"ADD new node!!!\\n\");",
+ " ",
+ " ///Xcls_DialogTemplateSelect.singleton().show( _this.model.file.palete(), node);",
+ " ",
+ " Gtk.drag_finish (ctx, false, false,time);",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "}"
+ ],
+ "drag_drop" : [
+ " ( ctx, x, y, time) => {",
+ " //Seed.print(\"TARGET: drag-drop\");",
+ " ",
+ " ",
+ " var src = Gtk.drag_get_source_widget(ctx);",
+ " ",
+ " if (src != this.el) {",
+ " ",
+ " ",
+ " ",
+ " this.drag_in_motion = false; ",
+ " // request data that will be recieved by the recieve... ",
+ " Gtk.drag_get_data",
+ " (",
+ " this.el, // will receive 'drag-data-received' signal ",
+ " ctx, // represents the current state of the DnD ",
+ " Gdk.Atom.intern(\"application/json\",true), // the target type we want ",
+ " time // time stamp ",
+ " );",
+ "",
+ " ",
+ " // No target offered by source => error",
+ " ",
+ "",
+ " return false;",
+ " }",
+ " ",
+ " // handle drop around self..",
+ " ",
+ " ",
+ " ",
+ " //print(\"GETTING POS\");",
+ " var targetData = \"\";",
+ " ",
+ " Gtk.TreePath path;",
+ " Gtk.TreeViewDropPosition pos;",
+ " var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);",
+ " ",
+ " // if there are not items in the tree.. the we have to set isOver to true for anything..",
+ " var isEmpty = false;",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " print(\"got NO children?\\n\");",
+ " isOver = true; //??? ",
+ " isEmpty = true;",
+ " pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " //var action = Gdk.DragAction.COPY;",
+ " // unless we are copying!!! ctl button..",
+ " ",
+ " var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ?",
+ " Gdk.DragAction.COPY : Gdk.DragAction.MOVE ;",
+ " // Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;",
+ "",
+ " ",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " // no children.. -- asume it's ok..",
+ " ",
+ " targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);",
+ " ",
+ " // continue through to allow drop...",
+ "",
+ " } else {",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " //print(\"ISOVER? \" + isOver);",
+ " if (!isOver) {",
+ " ",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " return true; // not over apoint!?! - no action on drop or motion..",
+ " }",
+ " ",
+ " // drag node is parent of child..",
+ " //console.log(\"SRC TREEPATH: \" + src.treepath);",
+ " //console.log(\"TARGET TREEPATH: \" + data.path.to_string());",
+ " ",
+ " // nned to check a few here..",
+ " //Gtk.TreeViewDropPosition.INTO_OR_AFTER",
+ " //Gtk.TreeViewDropPosition.INTO_OR_BEFORE",
+ " //Gtk.TreeViewDropPosition.AFTER",
+ " //Gtk.TreeViewDropPosition.BEFORE",
+ " ",
+ " // locally dragged items to not really use the ",
+ " var selection_text = this.dragData;",
+ " ",
+ " ",
+ " ",
+ " if (selection_text == null || selection_text.length < 1) {",
+ " //print(\"Error - drag selection text returned NULL\");",
+ " ",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " return true; /// -- fixme -- this is not really correct..",
+ " } ",
+ " ",
+ " // see if we are dragging into ourself?",
+ " print (\"got selection text of \" + selection_text);",
+ " ",
+ " var target_path = path.to_string();",
+ " //print(\"target_path=\"+target_path);",
+ "",
+ " // ",
+ " if (selection_text == target_path) {",
+ " print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");",
+ " ",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ "",
+ " return true; /// -- fixme -- this is not really correct..",
+ "",
+ " }",
+ " ",
+ " // check that ",
+ " //print(\"DUMPING DATA\");",
+ " //console.dump(data);",
+ " // path, pos",
+ " ",
+ " //print(data.path.to_string() +' => '+ data.pos);",
+ " ",
+ " // dropList is a list of xtypes that this node could be dropped on.",
+ " // it is set up when we start to drag..",
+ " ",
+ " ",
+ " targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);",
+ " ",
+ " print(\"targetDAta: \" + targetData +\"\\n\");",
+ " ",
+ " if (targetData.length < 1) {",
+ " //print(\"Can not find drop node path\");",
+ " ",
+ " Gtk.drag_finish (ctx, false, false, time); // drop failed..",
+ " return true;",
+ " }",
+ " ",
+ " ",
+ " ",
+ " // continue on to allow drop..",
+ " }",
+ " // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..",
+ "",
+ "",
+ " var delete_selection_data = false;",
+ " ",
+ " if (action == Gdk.DragAction.ASK) {",
+ " /* Ask the user to move or copy, then set the ctx action. */",
+ " }",
+ "",
+ " if (action == Gdk.DragAction.MOVE) {",
+ " delete_selection_data = true;",
+ " }",
+ " ",
+ " // drag around.. - reorder..",
+ " _this.model.moveNode(targetData, action);",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " // we can send stuff to souce here...",
+ "",
+ "",
+ "// do we always say failure, so we handle the reall drop?",
+ " Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);",
+ "",
+ " return true;",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "}"
+ ],
+ "drag_end" : [
+ " (drag_context) => {",
+ "\t//Seed.print('LEFT-TREE: drag-end');",
+ " this.dragData = \"\";",
+ " this.dropList = null;",
+ "// this.targetData = \"\";",
+ " this.highlightDropPath(\"\",0);",
+ "// return true;",
+ "}"
+ ],
+ "drag_motion" : [
+ " ( ctx, x, y, time) => {",
+ " print(\"got drag motion\\n\");",
+ " var src = Gtk.drag_get_source_widget(ctx);",
+ " this.drag_x = x;",
+ " this.drag_y = y; ",
+ "",
+ " if (src != this.el) {",
+ " ",
+ " ",
+ " ",
+ " // the point of this is to detect where an item could be dropped..",
+ " print(\"requesting drag data\\n\");",
+ " this.drag_in_motion = true;",
+ " ",
+ " // request data that will be recieved by the recieve... ",
+ " Gtk.drag_get_data",
+ " (",
+ " this.el, // will receive 'drag-data-received' signal ",
+ " ctx, // represents the current state of the DnD ",
+ " Gdk.Atom.intern(\"STRING\",true), // the target type we want ",
+ " time // time stamp ",
+ " );",
+ " return true;",
+ " } ",
+ "",
+ "",
+ " print(\"action: %d\\n\", ctx.get_actions());",
+ " //print(\"GETTING POS\");",
+ " var targetData = \"\";",
+ "",
+ " Gtk.TreePath path;",
+ " Gtk.TreeViewDropPosition pos;",
+ " var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);",
+ "",
+ " // if there are not items in the tree.. the we have to set isOver to true for anything..",
+ " var isEmpty = false;",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " print(\"got NO children?\\n\");",
+ " isOver = true; //??? ",
+ " isEmpty = true;",
+ " pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;",
+ " }",
+ "",
+ "",
+ " // ------------- a drag from self..",
+ "",
+ "",
+ " //var action = Gdk.DragAction.COPY;",
+ " // unless we are copying!!! ctl button..",
+ " ",
+ " var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ?",
+ " Gdk.DragAction.COPY : Gdk.DragAction.MOVE ;",
+ " // Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;",
+ "",
+ "",
+ " if (_this.model.el.iter_n_children(null) < 1) {",
+ " // no children.. -- asume it's ok..",
+ " ",
+ " targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);",
+ " ",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); ",
+ " Gdk.drag_status(ctx, action ,time);",
+ " return true;",
+ " ",
+ " // continue through to allow drop...",
+ "",
+ " } ",
+ " ",
+ " ",
+ "",
+ " ",
+ " ",
+ " //print(\"ISOVER? \" + isOver);",
+ " if (!isOver) {",
+ " ",
+ " Gdk.drag_status(ctx, 0 ,time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0); ",
+ " return false;",
+ "",
+ " }",
+ " ",
+ " // drag node is parent of child..",
+ " //console.log(\"SRC TREEPATH: \" + src.treepath);",
+ " //console.log(\"TARGET TREEPATH: \" + data.path.to_string());",
+ " ",
+ " // nned to check a few here..",
+ " //Gtk.TreeViewDropPosition.INTO_OR_AFTER",
+ " //Gtk.TreeViewDropPosition.INTO_OR_BEFORE",
+ " //Gtk.TreeViewDropPosition.AFTER",
+ " //Gtk.TreeViewDropPosition.BEFORE",
+ " ",
+ " // locally dragged items to not really use the ",
+ " var selection_text = this.dragData;",
+ " ",
+ " ",
+ " ",
+ " if (selection_text == null || selection_text.length < 1) {",
+ " //print(\"Error - drag selection text returned NULL\");",
+ " Gdk.drag_status(ctx, 0 ,time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return false;",
+ " }",
+ " ",
+ " ",
+ " // see if we are dragging into ourself?",
+ " var target_path = path.to_string(); ",
+ " print (\"Drag %s onto %s--%d\\n \", selection_text, target_path, pos);",
+ " ",
+ " // pos : 3 = ontop - 0 = after, 1 = before",
+ " //print(\"target_path=\"+target_path);",
+ "",
+ " // ",
+ " if (selection_text == target_path) {",
+ " print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");",
+ " ",
+ " Gdk.drag_status(ctx, 0 ,time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return false;",
+ "// -- fixme -- this is not really correct..",
+ "",
+ " }",
+ " ",
+ " // check that ",
+ " //print(\"DUMPING DATA\");",
+ " //console.dump(data);",
+ " // path, pos",
+ " ",
+ " //print(data.path.to_string() +' => '+ data.pos);",
+ " ",
+ " // dropList is a list of xtypes that this node could be dropped on.",
+ " // it is set up when we start to drag..",
+ " ",
+ " ",
+ " targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);",
+ " ",
+ " print(\"targetDAta: \" + targetData +\"\\n\");",
+ " ",
+ " if (targetData.length < 1) {",
+ " //print(\"Can not find drop node path\");",
+ " ",
+ " Gdk.drag_status(ctx, 0, time);",
+ " this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);",
+ " return false;",
+ " }",
+ " ",
+ " var td_ar = targetData.split(\"|\");",
+ " ",
+ " ",
+ "",
+ " Gdk.drag_status(ctx, action ,time);",
+ " this.highlightDropPath(td_ar[0], (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));",
+ " return true;",
+ " ",
+ " ",
+ "}"
+ ],
+ "key_press_event" : [
+ "(ev) => {",
+ " this.key_is_pressed = true;",
+ " return false;",
+ "}"
+ ],
+ "key_release_event" : [
+ "(ev) => {",
+ " this.key_is_pressed = false;",
+ " return false;",
+ "}",
+ ""
+ ]