當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.Cursor方法代碼示例

本文整理匯總了Python中wx.Cursor方法的典型用法代碼示例。如果您正苦於以下問題:Python wx.Cursor方法的具體用法?Python wx.Cursor怎麽用?Python wx.Cursor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wx的用法示例。


在下文中一共展示了wx.Cursor方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: on_mouse_move

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def on_mouse_move(self, event):
        if not event.Dragging():
            return
        else:
            self.SetCursor(wx.Cursor(wx.CURSOR_HAND))
        if self.previous_window_position is None:
            return
        pos = event.GetPosition()
        window_position = pos.x, pos.y
        scene_position = self.convert_window_to_scene([window_position[0], window_position[1]])
        sdx = (scene_position[0] - self.previous_scene_position[0])
        sdy = (scene_position[1] - self.previous_scene_position[1])
        wdx = (window_position[0] - self.previous_window_position[0])
        wdy = (window_position[1] - self.previous_window_position[1])
        if self.corner_drag is None:
            self.scene_post_pan(wdx, wdy)
        else:
            self.perspective[self.corner_drag][0] += sdx
            self.perspective[self.corner_drag][1] += sdy
            self.device.perspective = repr(self.perspective)
        self.previous_window_position = window_position
        self.previous_scene_position = scene_position 
開發者ID:meerk40t,項目名稱:meerk40t,代碼行數:24,代碼來源:CameraInteface.py

示例2: on_mouse_middle_down

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def on_mouse_middle_down(self, event):
        """Start the drag."""
        self.drag = True

        # Update various positions
        self.start_move_loc = np.array(event.GetPosition())
        self.mid_move_loc = self.start_move_loc
        self.prev_move_loc = (0, 0)
        self.end_move_loc = None

        # Change the cursor to a drag cursor
        self.SetCursor(wx.Cursor(wx.CURSOR_SIZING)) 
開發者ID:dougthor42,項目名稱:wafer_map,代碼行數:14,代碼來源:wm_core.py

示例3: on_mouse_middle_up

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def on_mouse_middle_up(self, event):
        """End the drag."""
        self.drag = False

        # update various positions
        if self.start_move_loc is not None:
            self.end_move_loc = np.array(event.GetPosition())
            self.diff_loc = self.mid_move_loc - self.end_move_loc
            self.canvas.MoveImage(self.diff_loc, 'Pixel', ReDraw=True)

        # change the cursor back to normal
        self.SetCursor(wx.Cursor(wx.CURSOR_ARROW)) 
開發者ID:dougthor42,項目名稱:wafer_map,代碼行數:14,代碼來源:wm_core.py

示例4: set_cursor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def set_cursor(self, cursor):
        cursor = wx.Cursor(cursord[cursor])
        self.canvas.SetCursor(cursor)
        self.canvas.Update() 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:6,代碼來源:backend_wx.py

示例5: ChangeCursor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def ChangeCursor(self, event):
        self.figure_canvas.SetCursor(wx.Cursor(wx.CURSOR_BULLSEYE)) 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:4,代碼來源:wxcursor_demo_sgskip.py

示例6: OnMotion

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def OnMotion(self, evt):
        # Ignore mouse movement if we're not dragging.
        if not self.drag_shape or not evt.Dragging() or not evt.LeftIsDown():
            return

        # if we have a shape, but haven't started dragging yet
        if self.drag_shape and not self.drag_image:

            # only start the drag after having moved a couple pixels
            tolerance = 2
            pt = evt.GetPosition()
            dx = abs(pt.x - self.dragStartPos.x)
            dy = abs(pt.y - self.dragStartPos.y)
            if dx <= tolerance and dy <= tolerance:
                return

            # refresh the area of the window where the shape was so it
            # will get erased.
            self.drag_shape.shown = False
            self.RefreshRect(self.drag_shape.GetRect(), True)
            self.Update()

            item = self.drag_shape.text if self.drag_shape.text else self.drag_shape.bmp
            self.drag_image = wx.DragImage(item,
                                         wx.Cursor(wx.CURSOR_HAND))

            hotspot = self.dragStartPos - self.drag_shape.pos
            self.drag_image.BeginDrag(hotspot, self, self.drag_shape.fullscreen)

            self.drag_image.Move(pt)
            self.drag_image.Show()

        # if we have shape and image then move it, posibly highlighting another shape.
        elif self.drag_shape and self.drag_image:
            # now move it and show it again if needed
            self.drag_image.Move(evt.GetPosition()) 
開發者ID:hhannine,項目名稱:superpaper,代碼行數:38,代碼來源:gui.py

示例7: OnMouseEvent

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def OnMouseEvent(self, e):
    if e.Moving():
      self.SetCursor(wx.Cursor(wx.CURSOR_HAND))
      self.SetFont(self.font1)

    elif e.LeftUp():
      OpenWith(self.openWith, self.url)
    else:
      self.SetCursor(wx.NullCursor)
      self.SetFont(self.font2)
    e.Skip() 
開發者ID:tydesk,項目名稱:tydesk,代碼行數:13,代碼來源:tydesk.py

示例8: SetCursor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def SetCursor(window, cursor):
        window.SetCursor(wx.Cursor(cursor)) 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:4,代碼來源:compat.py

示例9: on_mouse_left_up

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def on_mouse_left_up(self, event):
        self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
        self.previous_window_position = None
        self.previous_scene_position = None
        self.corner_drag = None 
開發者ID:meerk40t,項目名稱:meerk40t,代碼行數:7,代碼來源:CameraInteface.py

示例10: on_mouse_middle_down

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def on_mouse_middle_down(self, event):
        self.SetCursor(wx.Cursor(wx.CURSOR_HAND))
        self.previous_window_position = event.GetPosition()
        self.previous_scene_position = self.convert_window_to_scene(self.previous_window_position) 
開發者ID:meerk40t,項目名稱:meerk40t,代碼行數:6,代碼來源:CameraInteface.py

示例11: on_mouse_middle_up

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Cursor [as 別名]
def on_mouse_middle_up(self, event):
        self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
        self.previous_window_position = None
        self.previous_scene_position = None 
開發者ID:meerk40t,項目名稱:meerk40t,代碼行數:6,代碼來源:CameraInteface.py


注:本文中的wx.Cursor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。