gui/tools/designer.py
def mouse_down(self, evt): 
        "Get the selected object and store start position"
        if DEBUG: print "down!"
        if (not evt.ControlDown() and not evt.ShiftDown()) or evt.AltDown():
            for obj in self.selection:
                # clear marker
                if obj.sel_marker:
                    obj.sel_marker.show(False)
                    obj.sel_marker.destroy()
                    obj.sel_marker = None
            self.selection = []  # clear previous selection

        wx_obj = evt.GetEventObject()

        if wx_obj.Parent is None or evt.AltDown():
            if not evt.AltDown():
                evt.Skip()
            # start the rubberband effect (multiple selection using the mouse) 
            self.current = wx_obj
            self.overlay = wx.Overlay()
            self.pos = evt.GetPosition() 
            self.parent.wx_obj.CaptureMouse()
            #if self.inspector and hasattr(wx_obj, "obj"):
            #    self.inspector.inspect(wx_obj.obj)  # inspect top level window
            #self.dclick = False
        else:
            # create the selection marker and assign it to the control
            obj = wx_obj.obj
            self.overlay = None
            if DEBUG: print wx_obj
            sx, sy = wx_obj.ScreenToClient(wx_obj.GetPositionTuple())
            dx, dy = wx_obj.ScreenToClient(wx.GetMousePosition())
            self.pos = wx_obj.ScreenToClient(wx.GetMousePosition())
            self.start = (sx - dx, sy - dy)
            self.current = wx_obj
            if DEBUG: print "capture..."
            # do not capture on TextCtrl, it will fail (blocking) at least in gtk
            # do not capture on wx.Notebook to allow selecting the tabs
            if not isinstance(wx_obj, wx.Notebook):
                self.parent.wx_obj.CaptureMouse()
            self.select(obj, keep_selection=True)
def mouse_down(self, evt): 
        "Get the selected object and store start position"
        if DEBUG: print "down!"
        if (not evt.ControlDown() and not evt.ShiftDown()) or evt.AltDown():
            for obj in self.selection:
                # clear marker
                if obj.sel_marker:
                    obj.sel_marker.show(False)
                    obj.sel_marker.destroy()
                    obj.sel_marker = None
            self.selection = []  # clear previous selection

        wx_obj = evt.GetEventObject()

        if wx_obj.Parent is None or evt.AltDown():
            if not evt.AltDown():
                evt.Skip()
            # start the rubberband effect (multiple selection using the mouse) 
            self.current = wx_obj
            self.overlay = wx.Overlay()
            self.pos = evt.GetPosition() 
            self.parent.wx_obj.CaptureMouse()
            #if self.inspector and hasattr(wx_obj, "obj"):
            #    self.inspector.inspect(wx_obj.obj)  # inspect top level window
            #self.dclick = False
        else:
            # create the selection marker and assign it to the control
            obj = wx_obj.obj
            self.overlay = None
            if DEBUG: print wx_obj
            sx, sy = wx_obj.ScreenToClient(wx_obj.GetPositionTuple())
            dx, dy = wx_obj.ScreenToClient(wx.GetMousePosition())
            self.pos = wx_obj.ScreenToClient(wx.GetMousePosition())
            self.start = (sx - dx, sy - dy)
            self.current = wx_obj
            if DEBUG: print "capture..."
            # do not capture on TextCtrl, it will fail (blocking) at least in gtk
            # do not capture on wx.Notebook to allow selecting the tabs
            if not isinstance(wx_obj, wx.Notebook):
                self.parent.wx_obj.CaptureMouse()
            self.select(obj, keep_selection=True)
def mouse_down ( self , evt ) : if DEBUG : print "down!" if ( not evt . ControlDown ( ) and not evt . ShiftDown ( ) ) or evt . AltDown ( ) : for obj in self . selection : # clear marker if obj . sel_marker : obj . sel_marker . show ( False ) obj . sel_marker . destroy ( ) obj . sel_marker = None self . selection = [ ] # clear previous selection wx_obj = evt . GetEventObject ( ) if wx_obj . Parent is None or evt . AltDown ( ) : if not evt . AltDown ( ) : evt . Skip ( ) # start the rubberband effect (multiple selection using the mouse)  self . current = wx_obj self . overlay = wx . Overlay ( ) self . pos = evt . GetPosition ( ) self . parent . wx_obj . CaptureMouse ( ) #if self.inspector and hasattr(wx_obj, "obj"): #    self.inspector.inspect(wx_obj.obj)  # inspect top level window #self.dclick = False else : # create the selection marker and assign it to the control obj = wx_obj . obj self . overlay = None if DEBUG : print wx_obj sx , sy = wx_obj . ScreenToClient ( wx_obj . GetPositionTuple ( ) ) dx , dy = wx_obj . ScreenToClient ( wx . GetMousePosition ( ) ) self . pos = wx_obj . ScreenToClient ( wx . GetMousePosition ( ) ) self . start = ( sx - dx , sy - dy ) self . current = wx_obj if DEBUG : print "capture..." # do not capture on TextCtrl, it will fail (blocking) at least in gtk # do not capture on wx.Notebook to allow selecting the tabs if not isinstance ( wx_obj , wx . Notebook ) : self . parent . wx_obj . CaptureMouse ( ) self . select ( obj , keep_selection = True )
Get the selected object and store start position
Get the selected object and store start position