3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
10 console = imports.console;
11 XObject = imports.XObject.XObject;
12 WindowRightPalete=new XObject({
15 pack : "pack_start,false,false",
18 _this.buttonbar.el.show();
19 _this.viewbox.el.hide();
20 // print("TRIED TO HIDE");
22 'void:show' : function() {
23 _this.buttonbar.el.hide();
24 _this.viewbox.el.show();
25 // this.get('model').expanded();
41 pack : "pack_start,false,true",
46 stock : Gtk.STOCK_GOTO_FIRST,
47 icon_size : Gtk.IconSize.MENU
54 enter_notify_event : (self, event) => {
62 init : this.el.add_events ( Gdk.EventMask.BUTTON_MOTION_MASK );
73 pack : "pack_start,false,true",
83 clicked : function (self) {
84 _this.RightPalete.hide();
87 pack : "pack_start,false,true",
92 stock : Gtk.STOCK_GOTO_LAST,
93 icon_size : Gtk.IconSize.MENU
100 xtype: Gtk.ScrolledWindow,
102 init : this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
103 this.el.set_size_request(-1,200);,
104 shadow_type : Gtk.ShadowType.IN,
109 drag_begin : ( ctx) => {
110 // we could fill this in now...
111 // Seed.print('SOURCE: drag-begin');
116 var s = _this.selection;
118 s.get_selected(_this.model.el, out iter);
119 var path = _this.model.el.get_path(iter);
121 /// pix is a surface..
122 var pix = this.el.create_row_drag_icon ( path);
125 Gtk.drag_set_icon_surface (ctx, pix);
129 _this.model.el.get_value(iter, 0, out value);
130 if (_this.provider == null) {
133 //if (!this.get('/RightPalete').provider) {
136 this.dropList = _this.provider.getDropList((string)value);
137 this.dragData = (string) value;
142 drag_data_get : (drag_context, selection_data, info, time) => {
143 //Seed.print('Palete: drag-data-get: ' + target_type);
144 if (this.el.dragData.length > 0 ) {
145 selection_data.set_text(this.dragData ,this.dragData.length);
149 //this.el.dragData = "TEST from source widget";
153 drag_end : ( drag_context) => {
154 //Seed.print('SOURCE: drag-end');
157 this.dropList = null;
158 _this.drag_end(); // call signal..
159 //this.get('/LeftTree.view').highlight(false);
162 button_press_event : ( event) => {
164 // if (!this.get('/Editor').save()) {
165 // // popup!! - click handled..
172 enable_tree_lines : true,
173 headers_visible : false,
175 this.el.set_size_request(150,-1);
176 // set_reorderable: [1]
178 var description = new Pango.FontDescription();
179 description.set_size(8000);
180 this.el.modify_font(description);
182 var selection = this.el.get_selection();
183 selection.set_mode( Gtk.SelectionMode.SINGLE);
184 // this.selection.signal['changed'].connect(function() {
185 // _view.listeners['cursor-changed'].apply(_view, [ _view, '']);
187 // see: http://live.gnome.org/GnomeLove/DragNDropTutorial
189 Gtk.drag_source_set (
190 this.el, /* widget will be drag-able */
191 Gdk.ModifierType.BUTTON1_MASK, /* modifier that will start a drag */
192 null, /* lists of target to support */
193 0, /* size of list */
194 Gdk.DragAction.COPY /* what to do with data after dropped */
196 //Gtk.drag_source_set_target_list(this.el, LeftTree.targetList);
198 Gtk.drag_source_set_target_list(this.el, Application.targetList);
199 Gtk.drag_source_add_text_targets(this.el);
204 xtype: Gtk.ListStore,
205 columns : "typeof(string),typeof(string)",
209 'void:load' : (GLib.List<string> tr, Gtk.TreeIter? iter)
214 //console.log('Project tree load: ' + tr.length);
217 //this.insert(citer,iter,0);
218 for(var i =0 ; i < tr.length(); i++) {
221 this.el.append(out citer);
223 this.el.insert(out citer,iter,-1);
226 var r = tr.nth_data(i);
228 this.el.set_value(citer, 0, r ); // title
230 //this.el.set_value(citer, 1, new GObject.Value( r)); //id
231 //if (r.cn && r.cn.length) {
232 // this.load(r.cn, citer);
238 'string:getValue' : (Gtk.TreeIter iter, int col) {
240 this.el.get_value(iter, col , out gval);
247 xtype: Gtk.TreeViewColumn,
248 pack : "append_column",
249 init : this.el.add_attribute(_this.txtrender , "markup", 0 );,
252 xtype: Gtk.CellRendererText,
266 WindowRightPalete.init();
267 XObject.cache['/WindowRightPalete'] = WindowRightPalete;