Пример #1
0
 def OnDrag(self, event):
     # get the mouse coordinates
     point = GetCursorPos()
     # find the window under cursor
     hwnd = BestWindowFromPoint(point)
     # do we have targeted a new window?
     if hwnd != self.lastTarget:
         if self.lastTarget is not None:
             # unhighlight previous window
             HighlightWindow(self.lastTarget)
         _, pid = GetWindowThreadProcessId(hwnd)
         if pid == eg.processId:
             self.lastTarget = None
         else:
             HighlightWindow(hwnd)
             self.lastTarget = hwnd
     event.Skip()
Пример #2
0
    def OnDragEnd(self, dummyEvent):
        # revert box to normal image
        self.dragBoxImage.SetBitmap(self.dragBoxBitmap)
        self.dragBoxText.SetLabel(self.text.drag1)

        # unbind the unneded events
        self.Unbind(wx.EVT_MOTION)
        self.Unbind(wx.EVT_LEFT_UP)

        # stop processing the mouse capture
        self.ReleaseMouse()

        if self.lastTarget is not None:
            # unhighlight last window if we have highlighted one
            HighlightWindow(self.lastTarget)

        self.endFunc()