Python wx 模块,StockCursor() 实例源码

我们从Python开源项目中,提取了以下12个代码示例,用于说明如何使用wx.StockCursor()

项目:beremiz    作者:nucleron    | 项目源码 | 文件源码
def OnMotion(self, event):
        if wx.Platform == '__WXMSW__':
            if not event.Dragging():
                x, y = event.GetPosition()
                margin_width = reduce(
                        lambda x, y: x + y,
                        [self.GetMarginWidth(i)
                         for i in xrange(3)],
                        0)
                if x <= margin_width:
                    self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))
                else:
                    self.SetCursor(wx.StockCursor(wx.CURSOR_IBEAM))
            else:
                event.Skip()
        else:
            event.Skip()
项目:beremiz    作者:nucleron    | 项目源码 | 文件源码
def SetMode(self, mode):
        if self.Mode != mode or mode == MODE_SELECTION:
            if self.Mode == MODE_MOTION:
                wx.CallAfter(self.Editor.SetCursor, wx.NullCursor)
            self.Mode = mode
            self.SavedMode = False
        else:
            self.SavedMode = True
        # Reset selection
        if self.Mode != MODE_SELECTION and self.SelectedElement:
            self.SelectedElement.SetSelected(False)
            self.SelectedElement = None
        if self.Mode == MODE_MOTION:
            wx.CallAfter(self.Editor.SetCursor, wx.StockCursor(wx.CURSOR_HAND))
            self.SavedMode = True

    # Return current drawing mode
项目:beremiz    作者:nucleron    | 项目源码 | 文件源码
def OnLeftDown(self, event, dc, scaling):
        """
        Called when left mouse is pressed on Viewer. Starts to edit a new
        rubberband bounding box
        @param event: Mouse event
        @param dc: Device Context of Viewer
        @param scaling: PLCOpen scaling applied on Viewer
        """
        # Save the point where mouse was pressed in Viewer unit, position may
        # be modified by scroll and zoom applied on viewer
        self.StartPoint = GetScaledEventPosition(event, dc, scaling)

        # Initialize rubberband bounding box
        self.CurrentBBox = wx.Rect(self.StartPoint.x, self.StartPoint.y, 0, 0)

        # Change viewer mouse cursor to reflect a rubberband bounding box is
        # edited
        self.DrawingSurface.SetCursor(wx.StockCursor(wx.CURSOR_CROSS))

        self.Redraw()
项目:CAAPR    作者:Stargrazer82301    | 项目源码 | 文件源码
def on_cursor_enter(self, event):
        self.saved_cursor = self.figure.canvas.GetCursor()
        self.figure.canvas.SetCursor(wx.StockCursor(wx.CURSOR_CROSS))
项目:CAAPR    作者:Stargrazer82301    | 项目源码 | 文件源码
def on_cursor_enter(self, event):
        self.saved_cursor = self.figure.canvas.GetCursor()
        self.figure.canvas.SetCursor(wx.StockCursor(wx.CURSOR_CROSS))
项目:bonsu    作者:bonsudev    | 项目源码 | 文件源码
def _CursorChangedEvent(self, obj, evt):
        cur = self._cursor_map[obj.GetCurrentCursor()]
        if IsNotWX4():
            c = wx.StockCursor(cur)
        else:
            c = wx.Cursor(cur)
        self.SetCursor(c)
项目:bonsu    作者:bonsudev    | 项目源码 | 文件源码
def HideCursor(self):
        if IsNotWX4():
            c = wx.StockCursor(wx.CURSOR_BLANK)
        else:
            c = wx.Cursor(wx.CURSOR_BLANK)
        self.SetCursor(c)
项目:bonsu    作者:bonsudev    | 项目源码 | 文件源码
def ShowCursor(self):
        rw = self._Iren.GetRenderWindow()
        cur = self._cursor_map[rw.GetCurrentCursor()]
        if IsNotWX4():
            c = wx.StockCursor(cur)
        else:
            c = wx.Cursor(cur)
        self.SetCursor(c)
项目:Turrican2Editor    作者:GitExl    | 项目源码 | 文件源码
def viewport_mouse_right_down(self, event):
        if not self._camera:
            return
        if not self._world:
            return

        self._mouse_state = MouseState.MOVE
        self.Viewport.SetCursor(wx.StockCursor(wx.CURSOR_SIZING))
        self._move_last_pos = event.GetPosition()
项目:Turrican2Editor    作者:GitExl    | 项目源码 | 文件源码
def viewport_mouse_right_up(self, event):
        if not self._camera:
            return
        if not self._world:
            return

        self._mouse_state = MouseState.NONE
        self.Viewport.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))
项目:Turrican2Editor    作者:GitExl    | 项目源码 | 文件源码
def set_viewport_cursor(self, stock_cursor):
        self.Viewport.SetCursor(wx.StockCursor(stock_cursor))
项目:beremiz    作者:nucleron    | 项目源码 | 文件源码
def ResetCursors():
    global CURSORS
    if CURSORS is None:
        CURSORS = [wx.NullCursor,
                   wx.StockCursor(wx.CURSOR_HAND),
                   wx.StockCursor(wx.CURSOR_SIZENWSE),
                   wx.StockCursor(wx.CURSOR_SIZENESW),
                   wx.StockCursor(wx.CURSOR_SIZEWE),
                   wx.StockCursor(wx.CURSOR_SIZENS)]