当前位置: 首页>>代码示例>>Python>>正文


Python wx.EVT_MOTION属性代码示例

本文整理汇总了Python中wx.EVT_MOTION属性的典型用法代码示例。如果您正苦于以下问题:Python wx.EVT_MOTION属性的具体用法?Python wx.EVT_MOTION怎么用?Python wx.EVT_MOTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在wx的用法示例。


在下文中一共展示了wx.EVT_MOTION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(self, parent, id):
        style = wx.WANTS_CHARS | wx.FULL_REPAINT_ON_RESIZE | wx.NO_BORDER
        wx.Control.__init__(self, parent, id, style = style)

        self.panel = parent

        wx.EVT_SIZE(self, self.OnSize)
        wx.EVT_PAINT(self, self.OnPaint)
        wx.EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
        wx.EVT_LEFT_DOWN(self, self.OnLeftDown)
        wx.EVT_LEFT_UP(self, self.OnLeftUp)
        wx.EVT_LEFT_DCLICK(self, self.OnLeftDown)
        wx.EVT_RIGHT_DOWN(self, self.OnRightDown)
        wx.EVT_MOTION(self, self.OnMotion)
        wx.EVT_MOUSEWHEEL(self, self.OnMouseWheel)
        wx.EVT_CHAR(self, self.OnKeyChar)

        self.createEmptySp()
        self.updateScreen(redraw = False) 
开发者ID:trelby,项目名称:trelby,代码行数:21,代码来源:trelby.py

示例2: OnDragEnd

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def OnDragEnd(self, dummyEvent):
        # unbind the unneeded 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()

        # revert box to normal image
        self.dragBoxText.SetLabel(self.text.drag1)
        self.dragBoxImage.Show()
        self.Layout()
        self.dragBoxImage.SetBitmap(self.dragBoxBitmap) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:21,代码来源:WindowDragFinder.py

示例3: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(
        self,
        parent,
        id=-1,
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
        style=HW_DEFAULT_STYLE,
        name="htmlWindow"
    ):
        wxHtmlWindow.__init__(self, parent, id, pos, size, style, name)
        self.SetForegroundColour(parent.GetForegroundColour())
        self.SetBackgroundColour(parent.GetBackgroundColour())

        #if wx.html.HW_NO_SELECTION & style:
        #    self.Bind(wx.EVT_MOTION, self.OnIdle)
        #    self.handCursor = wx.StockCursor(wx.CURSOR_HAND)
        #    self.x1, self.y1 = self.GetScrollPixelsPerUnit()
        #    self.isSet = False
        self.Bind(EVT_HTML_LINK_CLICKED, self.OnHtmlLinkClicked) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:21,代码来源:HtmlWindow.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(self, size=(-1, -1), pic_path=None, display=0):
        wx.Frame.__init__(
            self,
            None,
            -1,
            "ShowPictureFrame",
            style=wx.NO_BORDER | wx.FRAME_NO_TASKBAR  #| wx.STAY_ON_TOP
        )
        self.SetBackgroundColour(wx.Colour(0, 0, 0))
        self.Bind(wx.EVT_LEFT_DCLICK, self.LeftDblClick)
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        bitmap = wx.EmptyBitmap(1, 1)
        self.staticBitmap = wx.StaticBitmap(self, -1, bitmap)
        self.staticBitmap.Bind(wx.EVT_LEFT_DCLICK, self.LeftDblClick)
        self.staticBitmap.Bind(wx.EVT_MOTION, self.ShowCursor)
        self.timer = Timer(2.0, self.HideCursor) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:18,代码来源:__init__.py

示例5: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(self, parent):
        wx.Window.__init__(self, parent, -1)

        self.selected = None

        # all valid characters
        self.chars = ""

        for i in xrange(256):
            if util.isValidInputChar(i):
                self.chars += chr(i)

        self.cols = 16
        self.rows = len(self.chars) // self.cols
        if len(self.chars) % 16:
            self.rows += 1

        # offset of grid
        self.offset = 5

        # size of a single character cell
        self.cellSize = 32

        # size of the zoomed-in character boxes
        self.boxSize = 60

        self.smallFont = util.createPixelFont(18,
            wx.FONTFAMILY_SWISS, wx.NORMAL, wx.NORMAL)
        self.normalFont = util.createPixelFont(self.cellSize - 2,
            wx.FONTFAMILY_MODERN, wx.NORMAL, wx.BOLD)
        self.bigFont = util.createPixelFont(self.boxSize - 2,
            wx.FONTFAMILY_MODERN, wx.NORMAL, wx.BOLD)

        wx.EVT_PAINT(self, self.OnPaint)
        wx.EVT_LEFT_DOWN(self, self.OnLeftDown)
        wx.EVT_MOTION(self, self.OnMotion)
        wx.EVT_SIZE(self, self.OnSize)

        util.setWH(self, self.cols * self.cellSize + 2 * self.offset, 460) 
开发者ID:trelby,项目名称:trelby,代码行数:41,代码来源:charmapdlg.py

示例6: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(self, parent):
        attribs = (glcanvas.WX_GL_RGBA, glcanvas.WX_GL_DOUBLEBUFFER, glcanvas.WX_GL_DEPTH_SIZE, 24)
        glcanvas.GLCanvas.__init__(self, parent, -1, attribList = attribs)    
        self.context = glcanvas.GLContext(self)
        
        self.parent = parent
        #Camera state variables
        self.size = self.GetClientSize()
        #self.camera = MouseSphericalCamera(self.size.x, self.size.y)
        self.camera = MousePolarCamera(self.size.width, self.size.height)
        
        #Main state variables
        self.MousePos = [0, 0]
        self.bbox = BBox3D()  
        
        #Face mesh variables and manipulation variables
        self.mesh = None
        self.meshCentroid = None
        self.displayMeshFaces = True
        self.displayMeshEdges = False
        self.displayMeshVertices = True
        self.displayVertexNormals = False
        self.displayFaceNormals = False
        self.useLighting = True
        self.useTexture = False
        
        self.GLinitialized = False
        #GL-related events
        wx.EVT_ERASE_BACKGROUND(self, self.processEraseBackgroundEvent)
        wx.EVT_SIZE(self, self.processSizeEvent)
        wx.EVT_PAINT(self, self.processPaintEvent)
        #Mouse Events
        wx.EVT_LEFT_DOWN(self, self.MouseDown)
        wx.EVT_LEFT_UP(self, self.MouseUp)
        wx.EVT_RIGHT_DOWN(self, self.MouseDown)
        wx.EVT_RIGHT_UP(self, self.MouseUp)
        wx.EVT_MIDDLE_DOWN(self, self.MouseDown)
        wx.EVT_MIDDLE_UP(self, self.MouseUp)
        wx.EVT_MOTION(self, self.MouseMotion) 
开发者ID:bmershon,项目名称:laplacian-meshes,代码行数:41,代码来源:MeshCanvas.py

示例7: _bind_events

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def _bind_events(self):
        """Bind events to various event handlers."""
        self.Bind(wx.EVT_PAINT, self._on_paint)
        self.Bind(wx.EVT_SIZE, self._on_size)
#        self.Bind(wx.EVT_MOTION, self.on_mouse_move)
#        self.Bind(wx.EVT_LEFT_DOWN, self.on_mouse_left_down)
#        self.Bind(wx.EVT_RIGHT_DOWN, self.on_mouse_right_down) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:9,代码来源:wm_legend.py

示例8: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(self, parent):
        glcanvas.GLCanvas.__init__(self, parent, -1)
        self.init = False
        self.context = glcanvas.GLContext(self)         # <== this was missing when I wrote the book in 2015...
        
        # initial mouse position
        self.lastx = self.x = 30
        self.lasty = self.y = 30
        self.size = None
        self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Bind(wx.EVT_PAINT, self.OnPaint)
        self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseDown)
        self.Bind(wx.EVT_LEFT_UP, self.OnMouseUp)
        self.Bind(wx.EVT_MOTION, self.OnMouseMotion) 
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:17,代码来源:import_OpenGL_cube_and_cone.py

示例9: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(self, parent):
        glcanvas.GLCanvas.__init__(self, parent, -1)        
        self.context = glcanvas.GLContext(self)
        self.init = False

        # Cube 3D start rotation
        self.last_X = self.x = 30
        self.last_Y = self.y = 30
        
        self.Bind(wx.EVT_SIZE, self.sizeCallback)
        self.Bind(wx.EVT_PAINT, self.paintCallback)
        self.Bind(wx.EVT_LEFT_DOWN, self.mouseDownCallback)
        self.Bind(wx.EVT_LEFT_UP, self.mouseUpCallback)
        self.Bind(wx.EVT_MOTION, self.mouseMotionCallback) 
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:16,代码来源:wxPython_Wallpaper.py

示例10: bind_movement_binds

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def bind_movement_binds(self, toggle):
        """Bind or unbind DragImage dragging bindings."""
        if toggle:
            self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
            self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
            self.Bind(wx.EVT_MOTION, self.OnMotion)
            self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
        else:
            self.Unbind(wx.EVT_LEFT_DOWN)
            self.Unbind(wx.EVT_LEFT_UP)
            self.Unbind(wx.EVT_MOTION)
            self.Unbind(wx.EVT_LEAVE_WINDOW) 
开发者ID:hhannine,项目名称:superpaper,代码行数:14,代码来源:gui.py

示例11: CreateControls

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def CreateControls(self):
        """Create our sub-controls"""
        wx.EVT_LIST_COL_CLICK(self, self.GetId(), self.OnReorder)
        wx.EVT_LIST_ITEM_SELECTED(self, self.GetId(), self.OnNodeSelected)
        wx.EVT_MOTION(self, self.OnMouseMove)
        wx.EVT_LIST_ITEM_ACTIVATED(self, self.GetId(), self.OnNodeActivated)
        self.CreateColumns() 
开发者ID:lrq3000,项目名称:pyFileFixity,代码行数:9,代码来源:listviews.py

示例12: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(self, parent, size, data, *args, **kwargs):

        wx.ListBox.__init__(self, parent, size, **kwargs)

        if isinstance(data,(pd.RangeIndex,pd.Int64Index)):
            # RangeIndex is not supported by self._update_columns
            data = pd.Index([str(i) for i in data])
        self.data = data

        self.InsertItems(self.data, 0)

        self.Bind(wx.EVT_LISTBOX, self.on_selection_changed)

        self.Bind(wx.EVT_LEFT_DOWN, self.on_left_down)

        self.Bind(wx.EVT_RIGHT_DOWN, self.on_right_down)
        self.Bind(wx.EVT_RIGHT_UP, self.on_right_up)
        self.Bind(wx.EVT_MOTION, self.on_move)

        self.index_iter = range(len(self.data))

        self.selected_items = [True] * len(self.data)
        self.index_mapping = list(range(len(self.data)))

        self.drag_start_index = None

        self.update_selection()
        self.SetFocus() 
开发者ID:bluenote10,项目名称:PandasDataFrameGUI,代码行数:30,代码来源:dfgui.py

示例13: Create

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def Create(self, parent):
        self.__listbox = ListBoxWithHeaders(parent, style=wx.LB_SINGLE)

        self.__listbox.Bind(wx.EVT_MOTION, self._on_motion)
        self.__listbox.Bind(wx.EVT_LEFT_DOWN, self._on_left_down)

        sizer = wx.BoxSizer()
        sizer.Add(self.__listbox, 1, wx.EXPAND)
        self.SetSizer(sizer)
        return True 
开发者ID:MrS0m30n3,项目名称:youtube-dl-gui,代码行数:12,代码来源:widgets.py

示例14: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(self, *args, **kw):
    super(Link, self).__init__(*args, **kw)

    self.font1 = wx.Font(11, wx.SWISS, wx.NORMAL, wx.NORMAL, True, u'微软雅黑')
    self.font2 = wx.Font(11, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'微软雅黑')

    self.SetFont(self.font2)
    self.SetForegroundColour('#0000ff')

    self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvent)
    self.Bind(wx.EVT_MOTION, self.OnMouseEvent) 
开发者ID:tydesk,项目名称:tydesk,代码行数:13,代码来源:tydesk.py

示例15: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_MOTION [as 别名]
def __init__(self, parentWin, defaultImageName="", id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.LC_REPORT):
    unused=style
    style=wx.LC_REPORT
    wx.ListView.__init__(self, parentWin, id, pos, size, style)
    if adm:
      self.SetImageList(adm.images, wx.IMAGE_LIST_SMALL)
      self.defaultImageId=adm.images.GetId(defaultImageName)
    self.Bind(wx.EVT_MOTION, self.OnMouseMove)
    self.getToolTipTextProc=None
    self.getToolTipCol=None
    self.colInfos=[] 
开发者ID:andreas-p,项目名称:admin4,代码行数:13,代码来源:ctl_adm.py


注:本文中的wx.EVT_MOTION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。