2 "build_module" : "builder",
7 "@ void after_node_change(JsRender.Node? node)" : "",
8 "@ void before_node_change(JsRender.Node? node)" : "",
9 "@ void drag_end()" : "",
10 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
15 "* pack" : "pack_start,true,true,0",
16 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
20 "$ shadow_type" : "Gtk.ShadowType.IN",
23 " this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
24 " this.el.set_size_request(-1,200);",
28 "* pack" : "pack_start,true,true,0",
31 "# string dragData" : "",
32 "$ enable_tree_lines" : true,
33 "$ headers_visible" : true,
37 " this.el.set_size_request(150,-1);",
38 " // set_reorderable: [1]",
40 " var description = new Pango.FontDescription();",
41 " description.set_size(8000);",
42 " this.el.override_font(description);",
44 " var selection = this.el.get_selection();",
45 " selection.set_mode( Gtk.SelectionMode.SINGLE);",
46 " // this.selection.signal['changed'].connect(function() {",
47 " // _view.listeners['cursor-changed'].apply(_view, [ _view, '']);",
49 " // see: http://live.gnome.org/GnomeLove/DragNDropTutorial",
51 " Gtk.drag_source_set (",
52 " this.el, /* widget will be drag-able */",
53 " Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */",
54 " BuilderApplication.targetList, /* lists of target to support */",
55 " Gdk.DragAction.COPY /* what to do with data after dropped */",
57 " //Gtk.drag_source_set_target_list(this.el, LeftTree.targetList);",
59 " // Gtk.drag_source_set_target_list(this.el, Application.targetList);",
60 " // Gtk.drag_source_add_text_targets(this.el); ",
68 "$ columns" : "typeof(string),typeof(string)",
70 "* pack" : "set_model",
73 "xtype" : "ListStore",
74 "| string getValue" : [
75 " (Gtk.TreeIter iter, int col) {",
77 " this.el.get_value(iter, col , out gval);",
78 " return (string)gval;",
87 " this.el.add_attribute(_this.txtrender.el , \"markup\", 1 );",
91 "* pack" : "append_column",
95 "* pack" : "pack_start,true",
97 "xtype" : "CellRendererText"
100 "utf8 title" : "Drag to add Object",
101 "xtype" : "TreeViewColumn"
105 "button_press_event" : [
108 " //\tif (!this.get('/Editor').save()) {",
109 " //\t // popup!! - click handled.. ",
110 "// \t return true;",
117 " // we could fill this in now...",
118 "// Seed.print('SOURCE: drag-begin');",
122 " Gtk.TreeIter iter;",
123 " var s = this.el.get_selection();",
125 " Gtk.TreeModel mod;",
126 " s.get_selected(out mod, out iter);",
127 " var path = mod.get_path(iter);",
129 " /// pix is a surface..",
130 " var pix = this.el.create_row_drag_icon ( path);",
133 " Gtk.drag_set_icon_surface (ctx, pix);",
134 " GLib.Value value;",
137 " _this.model.el.get_value(iter, 0, out value);",
139 " this.dragData = (string) value;",
146 "(drag_context, selection_data, info, time) => {",
147 " \t//Seed.print('Palete: drag-data-get: ' + target_type);",
148 " if (this.dragData.length < 1 ) {",
152 " GLib.debug(\"setting drag data to %s\\n\", this.dragData);",
153 " // selection_data.set_text(this.dragData ,this.dragData.length);",
154 " selection_data.set (selection_data.get_target (), 8, (uchar[]) this.dragData.to_utf8 ());",
156 " //this.el.dragData = \"TEST from source widget\";",
162 "( drag_context) => {",
163 " \t GLib.debug(\"SOURCE: drag-end (call listener on this)\\n\");",
165 "\tthis.dragData = \"\";",
166 "\t//this.dropList = null;",
167 "\t_this.drag_end(); // call signal..",
168 "\t//this.get('/LeftTree.view').highlight(false);",
176 "xtype" : "ScrolledWindow"
185 " this.model.el.clear();",
189 " (Palete.Palete pal, string cls ) {",
191 " // this.get('model').expanded();",
193 " var tr = pal.getChildList(cls);",
194 " this.model.el.clear();",
197 " Gtk.TreeIter citer;",
199 " for(var i =0 ; i < tr.length; i++) {",
200 " this.model.el.append(out citer); ",
201 " var dname = tr[i];",
202 " if (dname.contains(\":\")) {",
203 "\t\t\tvar ar = dname.split(\":\");",
204 "\t\t\tdname = \"<b>\" + ar[1] +\"</b> - <i>\"+ar[0]+\"</i>\";",
207 " this.model.el.set_value(citer, 0, tr[i] ); // used data. ",
208 " this.model.el.set_value(citer, 1, dname ); // displayed value.",
211 " this.model.el.set_sort_column_id(1,Gtk.SortType.ASCENDING);",
220 "name" : "WindowRightPalete",
222 "path" : "/home/alan/gitlive/roobuilder/src/Builder4/WindowRightPalete.bjs",