Python wx.EVT_MOTION Examples
The following are 30
code examples of wx.EVT_MOTION().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: trelby.py From trelby with GNU General Public License v2.0 | 7 votes |
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)
Example #2
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 6 votes |
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)
Example #3
Source File: WindowDragFinder.py From EventGhost with GNU General Public License v2.0 | 6 votes |
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)
Example #4
Source File: HtmlWindow.py From EventGhost with GNU General Public License v2.0 | 6 votes |
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)
Example #5
Source File: mask_frame.py From dials with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, *args, **kwds): super(MaskSettingsPanel, self).__init__(*args, **kwds) self.params = args[0].phil_params self._pyslip = self.GetParent().GetParent().pyslip self.border_ctrl = None self.d_min_ctrl = None self.d_max_ctrl = None self.resolution_range_d_min_ctrl = None self.resolution_range_d_max_ctrl = None self.ice_rings_d_min_ctrl = None self.ice_rings_width_ctrl = None self._mode_rectangle_layer = None self._mode_polygon_layer = None self._mode_circle_layer = None self._rectangle_x0y0 = None self._rectangle_x1y1 = None self._mode_rectangle = False self._mode_polygon = False self._mode_polygon_points = [] self._mode_circle = False self._resolution_range_d_min = 0 self._resolution_range_d_max = 0 self._pyslip.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) self._pyslip.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) self._pyslip.Bind(wx.EVT_MOTION, self.OnMove) self.draw_settings() self.UpdateMask()
Example #6
Source File: CustomStyledTextCtrl.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, *args, **kwargs): wx.stc.StyledTextCtrl.__init__(self, *args, **kwargs) self.Bind(wx.EVT_MOTION, self.OnMotion)
Example #7
Source File: LogViewer.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, size): wx.Panel.__init__(self, parent, size=size) 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_ERASE_BACKGROUND, self.OnEraseBackground) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_SIZE, self.OnResize) self.ThumbPosition = 0. # -1 <= ThumbPosition <= 1 self.ThumbScrollingStartPos = None
Example #8
Source File: TextCtrlAutoComplete.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, choices=None): wx.PopupWindow.__init__(self, parent, wx.BORDER_SIMPLE) self.ListBox = wx.ListBox(self, -1, style=wx.LB_HSCROLL | wx.LB_SINGLE | wx.LB_SORT) choices = [] if choices is None else choices self.SetChoices(choices) self.ListBox.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) self.ListBox.Bind(wx.EVT_MOTION, self.OnMotion)
Example #9
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def OnDragEnd(self, event): # unbind the unneeded events self.Unbind(wx.EVT_MOTION) self.Unbind(wx.EVT_LEFT_UP) # stop processing the mouse capture self.ReleaseMouse()
Example #10
Source File: viewer_low_level_util.py From dials with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, outer_panel, i_bmp_in): super(multi_img_scrollable, self).__init__(outer_panel) self.parent_panel = outer_panel self.lst_2d_bmp = i_bmp_in self.SetBackgroundColour(wx.Colour(200, 200, 200)) self.mainSizer = wx.BoxSizer(wx.VERTICAL) self.n_img = 0 self.img_lst_v_sizer = wx.BoxSizer(wx.VERTICAL) self.set_scroll_content() self.mainSizer.Add(self.img_lst_v_sizer, 0, wx.CENTER | wx.ALL, 10) self.SetSizer(self.mainSizer) self.SetupScrolling() self.SetScrollRate(1, 1) self.Mouse_Pos_x = -1 self.Mouse_Pos_y = -1 self.old_Mouse_Pos_x = -1 self.old_Mouse_Pos_y = -1 self.Bind(wx.EVT_MOUSEWHEEL, self.OnMouseWheel) self.Bind(wx.EVT_MOTION, self.OnMouseMotion) self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftButDown) self.Bind(wx.EVT_LEFT_UP, self.OnLeftButUp) self.Bind(wx.EVT_IDLE, self.OnIdle) self.scroll_rot = 0
Example #11
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def __init__(self, parent=None): wx.Frame.__init__( self, parent, style=wx.NO_BORDER|wx.FRAME_NO_TASKBAR|wx.CLIP_CHILDREN ) self.drawing = None self.displayNum = 0 self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_LEFT_DCLICK, self.LeftDblClick) self.Bind(wx.EVT_KEY_DOWN, self.OnChar) self.Bind(wx.EVT_MOTION, self.ShowCursor) self.timer = None self.SetBackgroundColour((0, 0, 0))
Example #12
Source File: mask_frame.py From dials with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __del__(self): if self._mode_rectangle_layer: self._pyslip.DeleteLayer(self._mode_rectangle_layer) if self._mode_polygon_layer: self._pyslip.DeleteLayer(self._mode_polygon_layer) if self._mode_circle_layer: self._pyslip.DeleteLayer(self._mode_circle_layer) self._pyslip.Unbind(wx.EVT_LEFT_DOWN, handler=self.OnLeftDown) self._pyslip.Unbind(wx.EVT_LEFT_UP, handler=self.OnLeftUp) self._pyslip.Unbind(wx.EVT_MOTION, handler=self.OnMove)
Example #13
Source File: charmapdlg.py From trelby with GNU General Public License v2.0 | 5 votes |
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)
Example #14
Source File: WindowDragFinder.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def OnDragboxClick(self, event): """ Handle left-click on findtool """ if self.HasCapture(): event.Skip() return self.startFunc() #nothing targeted in the beginning self.lastTarget = None wx.SetCursor(self.cursor) # hide the image while dragging self.dragBoxImage.Hide() self.dragBoxText.SetLabel(self.text.drag2) self.Layout() # from now on we want all mouse motion events self.Bind(wx.EVT_MOTION, self.OnDrag) # and the left up event self.Bind(wx.EVT_LEFT_UP, self.OnDragEnd) # and call Skip in for handling focus events etc. event.ResumePropagation(wx.EVENT_PROPAGATE_MAX) event.Skip() # start capturing the mouse exclusivly self.CaptureMouse()
Example #15
Source File: Mailbox.py From admin4 with Apache License 2.0 | 5 votes |
def Go(self, user=None, acl=None, knownUsers=None): self.User=user self.knownUsers=knownUsers self.statusbar.Show() if user: self['User'].Disable() self['Rights'].GetValue = self['Rights'].GetChecked else: sv=self.node.GetServer() if sv.user not in sv.userList: self['User'].Append(sv.user) self['User'].Append("anyone") for user in sv.userList: if self.nameValid(user): self['User'].Append(user) self.Bind('User Rights') self.Bind('RoRights', self.OnRoClick) self.Bind('RwRights', self.OnRwClick) self.Bind('AllRights', self.OnAllClick) self.Bind('NoRights', self.OnNoClick) self.Bind(wx.EVT_MOTION, self.OnMouseMoveRights) for right in self.rightList: i=self['Rights'].Append("%s %s" % (right, xlt(self.rightDict[right][0]))) if acl and right in acl: self['Rights'].Check(i) self.SetUnchanged() self.OnCheck()
Example #16
Source File: _explain.py From admin4 with Apache License 2.0 | 5 votes |
def __init__(self, parent): wxOgl.ShapeCanvas.__init__(self, parent) self.SetDiagram(wxOgl.Diagram()) self.GetDiagram().SetCanvas(self) self.SetBackgroundColour(wx.WHITE) self.lastShape=None self.Bind(wx.EVT_MOTION, self.OnMouseMove)
Example #17
Source File: Group.py From admin4 with Apache License 2.0 | 5 votes |
def __init__(self, dlg, notebook, resname=None): SpecificEntry.__init__(self, dlg, notebook, resname) self.memberUidOid=self.GetServer().GetOid("memberUid") self.Bind("AddMember", self.OnAddMember) self.Bind("DelMember", self.OnDelMember) self.Bind("GenerateGid", self.OnGenerate) lv=self['Members'] lv.AddColumn(xlt("User Id"), 20) lv.AddColumn(xlt("Description")) lv.Bind(wx.EVT_LIST_COL_END_DRAG, self.OnListColResize) lv.Bind(wx.EVT_MOTION, self.OnMouseMove)
Example #18
Source File: GenericEntry.py From admin4 with Apache License 2.0 | 5 votes |
def __init__(self, dlg, notebook, resname=None): adm.NotebookPanel.__init__(self, dlg, notebook, resname) self.grid.Bind(wxpg.EVT_PG_CHANGED, self.OnGridChange) self.grid.Bind(wx.EVT_RIGHT_DOWN, self.OnGridRightClick) self.grid.Bind(wx.EVT_MOTION, self.OnMouseMove) self.availableObjectClasses={} self.may=[] self.lastRdnOid=None self.dialog.BindMenuId(self.OnDelAttrs) self.Bind("ObjectClass", self.OnClassChange) self.Bind("AddObjectClass", self.OnAddObjectClass) self.Bind("DelObjectClass", self.OnDelObjectClass) self.Bind("RDN", self.OnRDN)
Example #19
Source File: tydesk.py From tydesk with GNU General Public License v3.0 | 5 votes |
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)
Example #20
Source File: MeshCanvas.py From laplacian-meshes with GNU General Public License v3.0 | 5 votes |
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)
Example #21
Source File: wm_legend.py From wafer_map with GNU General Public License v3.0 | 5 votes |
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)
Example #22
Source File: import_OpenGL_cube_and_cone.py From Python-GUI-Programming-Cookbook-Second-Edition with MIT License | 5 votes |
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)
Example #23
Source File: wxPython_Wallpaper.py From Python-GUI-Programming-Cookbook-Second-Edition with MIT License | 5 votes |
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)
Example #24
Source File: wxPython_OpenGL_GUI.py From Python-GUI-Programming-Cookbook-Second-Edition with MIT License | 5 votes |
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)
Example #25
Source File: wxPython_Wallpaper_simple.py From Python-GUI-Programming-Cookbook-Second-Edition with MIT License | 5 votes |
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)
Example #26
Source File: gui.py From superpaper with MIT License | 5 votes |
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)
Example #27
Source File: listviews.py From pyFileFixity with MIT License | 5 votes |
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()
Example #28
Source File: dfgui.py From PandasDataFrameGUI with MIT License | 5 votes |
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()
Example #29
Source File: widgets.py From youtube-dl-gui with The Unlicense | 5 votes |
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
Example #30
Source File: ctl_adm.py From admin4 with Apache License 2.0 | 5 votes |
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=[]