当前位置: 首页>>代码示例>>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;未经允许,请勿转载。