gui/tools/designer.py
def mouse_up(self, evt, wx_obj=None):
        "Release the selected object (pass a wx_obj if the event was captured)"
        self.resizing = False
        if self.current: 
            wx_obj = self.current
            if self.parent.wx_obj.HasCapture():
                self.parent.wx_obj.ReleaseMouse()
            self.current = None
            if self.overlay:
                # When the mouse is released we reset the overlay and it 
                # restores the former content to the window. 
                dc = wx.ClientDC(wx_obj)
                odc = wx.DCOverlay(self.overlay, dc)
                odc.Clear()
                del odc
                self.overlay.Reset()                
                self.overlay = None
                pos = evt.GetPosition()
                # convert to relative client coordinates of the container:
                if evt.GetEventObject() != wx_obj:
                    pos = evt.GetEventObject().ClientToScreen(pos)  # frame
                    pos = wx_obj.ScreenToClient(pos)                # panel
                # finish the multiple selection using the mouse:
                rect = wx.RectPP(self.pos, pos)
                for obj in wx_obj.obj:
                    # only check child controls (not menubar/statusbar)
                    if isinstance(obj, Control):
                        obj_rect = obj.wx_obj.GetRect()
                        if rect.ContainsRect(obj_rect):
                            self.select(obj, keep_selection=True)
                self.pos = None 

        if self.inspector and wx_obj:
            self.inspector.inspect(wx_obj.obj)
        if DEBUG: print "SELECTION", self.selection
def mouse_up(self, evt, wx_obj=None):
        "Release the selected object (pass a wx_obj if the event was captured)"
        self.resizing = False
        if self.current: 
            wx_obj = self.current
            if self.parent.wx_obj.HasCapture():
                self.parent.wx_obj.ReleaseMouse()
            self.current = None
            if self.overlay:
                # When the mouse is released we reset the overlay and it 
                # restores the former content to the window. 
                dc = wx.ClientDC(wx_obj)
                odc = wx.DCOverlay(self.overlay, dc)
                odc.Clear()
                del odc
                self.overlay.Reset()                
                self.overlay = None
                pos = evt.GetPosition()
                # convert to relative client coordinates of the container:
                if evt.GetEventObject() != wx_obj:
                    pos = evt.GetEventObject().ClientToScreen(pos)  # frame
                    pos = wx_obj.ScreenToClient(pos)                # panel
                # finish the multiple selection using the mouse:
                rect = wx.RectPP(self.pos, pos)
                for obj in wx_obj.obj:
                    # only check child controls (not menubar/statusbar)
                    if isinstance(obj, Control):
                        obj_rect = obj.wx_obj.GetRect()
                        if rect.ContainsRect(obj_rect):
                            self.select(obj, keep_selection=True)
                self.pos = None 

        if self.inspector and wx_obj:
            self.inspector.inspect(wx_obj.obj)
        if DEBUG: print "SELECTION", self.selection
def mouse_up ( self , evt , wx_obj = None ) : self . resizing = False if self . current : wx_obj = self . current if self . parent . wx_obj . HasCapture ( ) : self . parent . wx_obj . ReleaseMouse ( ) self . current = None if self . overlay : # When the mouse is released we reset the overlay and it  # restores the former content to the window.  dc = wx . ClientDC ( wx_obj ) odc = wx . DCOverlay ( self . overlay , dc ) odc . Clear ( ) del odc self . overlay . Reset ( ) self . overlay = None pos = evt . GetPosition ( ) # convert to relative client coordinates of the container: if evt . GetEventObject ( ) != wx_obj : pos = evt . GetEventObject ( ) . ClientToScreen ( pos ) # frame pos = wx_obj . ScreenToClient ( pos ) # panel # finish the multiple selection using the mouse: rect = wx . RectPP ( self . pos , pos ) for obj in wx_obj . obj : # only check child controls (not menubar/statusbar) if isinstance ( obj , Control ) : obj_rect = obj . wx_obj . GetRect ( ) if rect . ContainsRect ( obj_rect ) : self . select ( obj , keep_selection = True ) self . pos = None if self . inspector and wx_obj : self . inspector . inspect ( wx_obj . obj ) if DEBUG : print "SELECTION" , self . selection
Release the selected object (pass a wx_obj if the event was captured)
Release the selected object ( pass a wx_obj if the event was captured )