daboide Commit Revision 641 Date: 2006-09-30 06:50:22 -0700 (Sat, 30 Sep 2006) Author: ed
Changed: U trunk/ClassDesignerFormMixin.py
Log: More fixes for the behaviors when working with controls nested inside of panels in the Designer. Marquee selection now works, and so does multiple item moving and sizing.
Diff: Modified: trunk/ClassDesignerFormMixin.py =================================================================== --- trunk/ClassDesignerFormMixin.py 2006-09-29 02:10:33 UTC (rev 640) +++ trunk/ClassDesignerFormMixin.py 2006-09-30 13:50:22 UTC (rev 641) @@ -869,24 +869,26 @@ drobj = self._draggedObjects dabo.ui.callAfter(self._clearDraggedObjects) if self._selecting: + mp = evt.mousePosition + ac = self.ActiveContainer # Clear the marquee self.drawMarquee(self._dragDrawPos) self._selecting = False origPos = self._dragOrigPos if obj: - endPos = obj.formCoordinates(evt.mousePosition) + endPos = obj.containerCoordinates(ac, mp) else: - endPos = evt.mousePosition + endPos = mp # Was there a selected class? cls = self.app.SelectedClass if cls is not None: - self.app.addDrawnClass(cls, self.ActiveContainer, + self.app.addDrawnClass(cls, ac, self._dragOrigPos, self._dragDrawPos) else: #self._drawSurface = None # Any selected? - sel = [ctl for ctl in self.ActiveContainer.Children + sel = [ctl for ctl in ac.Children if self.intesects(ctl, origPos, endPos) and not isinstance(ctl, DragHandle)] self.selectControl(sel, evt.shiftDown) @@ -999,8 +1001,10 @@ ox, oy = self._dragOrigPos nx, ny = obj.containerCoordinates(self.ActiveContainer, evt.mousePosition) dist = abs(nx-ox) + abs(ny-oy) - if self._selecting and (dist > 2): + wasSelecting = self._selecting + if wasSelecting and (dist > 2): self.onLeftUp(evt, obj) + return if (self._draggedObjects is not None) and (dist > 2): # We're finishing a drag operation self.app.Selection = self._draggedObjects @@ -1008,7 +1012,8 @@ return srcObj = self.DragObject if not srcObj: - self.objectClick(obj, evt.shiftDown) + if obj is not self.ActiveContainer or wasSelecting: + self.objectClick(obj, evt.shiftDown) else: # Clear the reference self.DragObject = None
©2006 Ed Leafe |