From: Alan Knowles Date: Sat, 22 May 2010 11:56:38 +0000 (+0800) Subject: sync X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=commitdiff_plain;h=ef35cdcb1cdd44f514b51030f8e981046f466e07;hp=-c sync --- ef35cdcb1cdd44f514b51030f8e981046f466e07 diff --combined Builder/RightGtkView.js index 609e07955,7211eed73..fdd912886 --- a/Builder/RightGtkView.js +++ b/Builder/RightGtkView.js @@@ -71,11 -71,11 +71,8 @@@ RightGtkView = new XObject( xtype : Gtk.Fixed, init : function () { XObject.prototype.init.call(this); - // this.el.set_hadjustment(this.parent.el.get_hadjustment()); - //this.el.set_hadjustment(this.parent.el.get_hadjustment()); -- //this.el.set_vadjustment(this.parent.el.get_vadjustment()); -- }, - pack : 'add_with_viewport', + pack : 'add_with_viewport' , items: [ { id : 'view', @@@ -86,7 -86,7 +83,7 @@@ }, */ - pack : 'put,15,15', + pack : 'put,10,10', ready : false, init : function() { XObject.prototype.init.call(this); @@@ -349,13 -349,14 +346,17 @@@ this.renderedEl = false; } - var tree = this.get('/LeftTree.model').toJS()[0]; + var tree = this.get('/LeftTree.model').toJS(false,true)[0]; // in theory tree is actually window.. this.renderedEl = this.viewAdd(tree.items[0], this.get('view').el); + this.get('view').el.set_size_request( + tree.default_width * 1 || 400, tree.default_height * 1 || 400 + ) ; + this.renderedEl.set_size_request( + tree.default_width || 600, + tree.default_height || 400 + ); this.get('view').el.show_all(); return; @@@ -594,13 -595,53 +595,53 @@@ _this.viewAdd(ch, el); }); + + + // add the signal handlers. + // is it a widget!?!!? + + + try { + + + el.signal.expose_event.connect(XObject.createDelegate(this.widgetExposeEvent, this, [ item ], true)); + el.signal.drag_motion.connect(XObject.createDelegate(this.widgetDragMotionEvent, this,[ item ], true)); + el.signal.drag_drop.connect(XObject.createDelegate(this.widgetDragDropEvent, this, [ item ], true)); + el.signal.button_press_event.connect(XObject.createDelegate(this.widgetPressEvent, this, [ item ], true )); + } catch(e) { + // ignore! + } + + + return el; + }, + widgetExposeEvent : function() + { + print("WIDGET EXPOSE"); // draw highlight?? + return false; + }, + widgetDragMotionEvent : function() + { + print("WIDGET DRAGMOTION"); + return true; + }, + widgetDragDropEvent : function() + { + print("WIDGET DRAGDROP"); + return true; + }, + widgetPressEvent : function(w,e,u,d) + { + print("WIDGET PRESs" + d.xtreepath ); + + return false; } - } + } );