Python wx.EVT_LEFT_UP Examples
The following are 30
code examples of wx.EVT_LEFT_UP().
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: guiminer.py From poclbm with GNU General Public License v3.0 | 6 votes |
def get_summary_widgets(self, summary_panel): """Return a list of summary widgets suitable for sizer.AddMany.""" self.summary_panel = summary_panel self.summary_name = wx.StaticText(summary_panel, -1, self.name) self.summary_name.Bind(wx.EVT_LEFT_UP, self.show_this_panel) self.summary_status = wx.StaticText(summary_panel, -1, STR_STOPPED) self.summary_shares_accepted = wx.StaticText(summary_panel, -1, "0") self.summary_shares_invalid = wx.StaticText(summary_panel, -1, "0") self.summary_start = wx.Button(summary_panel, -1, self.get_start_stop_state(), style=wx.BU_EXACTFIT) self.summary_start.Bind(wx.EVT_BUTTON, self.toggle_mining) self.summary_autostart = wx.CheckBox(summary_panel, -1) self.summary_autostart.Bind(wx.EVT_CHECKBOX, self.toggle_autostart) self.summary_autostart.SetValue(self.autostart) return [ (self.summary_name, 0, wx.ALIGN_CENTER_HORIZONTAL), (self.summary_status, 0, wx.ALIGN_CENTER_HORIZONTAL, 0), (self.summary_shares_accepted, 0, wx.ALIGN_CENTER_HORIZONTAL, 0), (self.summary_shares_invalid, 0, wx.ALIGN_CENTER_HORIZONTAL, 0), (self.summary_start, 0, wx.ALIGN_CENTER, 0), (self.summary_autostart, 0, wx.ALIGN_CENTER, 0) ]
Example #3
Source File: components.py From pyFileFixity with MIT License | 6 votes |
def do_layout(self, parent): self.panel = wx.Panel(parent) self.widget = wx.CheckBox(self.panel) self.title = self.createTitle(self.panel) self.help_msg = self.createHelpMsgWidget(self.panel) self.help_msg.SetMinSize((0, -1)) self.help_msg.Bind(wx.EVT_LEFT_UP, lambda event: self.widget.SetValue(not self.widget.GetValue())) vertical_container = wx.BoxSizer(wx.VERTICAL) vertical_container.Add(self.title) horizontal_sizer = wx.BoxSizer(wx.HORIZONTAL) horizontal_sizer.Add(self.widget, 0, wx.EXPAND | wx.RIGHT, 10) horizontal_sizer.Add(self.help_msg, 1, wx.EXPAND) vertical_container.Add(horizontal_sizer, 0, wx.EXPAND) self.panel.SetSizer(vertical_container) self.panel.Bind(wx.EVT_SIZE, self.onResize) return self.panel
Example #4
Source File: components.py From me-ica with GNU Lesser General Public License v2.1 | 6 votes |
def do_layout(self, parent, title, msg): self.panel = wx.Panel(parent) self.widget = wx.CheckBox(self.panel) # self.widget.SetValue(self.default_value) self.title = self.format_title(self.panel, title) self.help_msg = self.format_help_msg(self.panel, msg) self.help_msg.SetMinSize((0, -1)) # self.help_msg.Bind(wx.EVT_LEFT_UP, lambda event: self.widget.SetValue(not self.widget.GetValue())) vertical_container = wx.BoxSizer(wx.VERTICAL) vertical_container.Add(self.title) horizontal_sizer = wx.BoxSizer(wx.HORIZONTAL) horizontal_sizer.Add(self.widget, 0, wx.EXPAND | wx.RIGHT, 10) horizontal_sizer.Add(self.help_msg, 1, wx.EXPAND) vertical_container.Add(horizontal_sizer, 0, wx.EXPAND) self.panel.SetSizer(vertical_container) self.panel.Bind(wx.EVT_SIZE, self.onResize) return self.panel
Example #5
Source File: recipe-577951.py From code with MIT License | 6 votes |
def OnLeftUp(self, event): """ Handles the ``wx.EVT_LEFT_UP`` event for L{RoundButton}. :param `event`: a `wx.MouseEvent` event to be processed. """ if not self.IsEnabled() or not self.HasCapture(): return if self.HasCapture(): self.ReleaseMouse() if self._containsEvent(event): self._mouseAction = HOVER self.Notify() else: self._mouseAction = None self.Refresh() event.Skip()
Example #6
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 #7
Source File: TextCtrlAutoComplete.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, choices=None, dropDownClick=True, element_path=None, **therest): """ Constructor works just like wx.TextCtrl except you can pass in a list of choices. You can also change the choice list at any time by calling setChoices. """ therest['style'] = wx.TE_PROCESS_ENTER | therest.get('style', 0) wx.TextCtrl.__init__(self, parent, **therest) # Some variables self._dropDownClick = dropDownClick self._lastinsertionpoint = None self._hasfocus = False self._screenheight = wx.SystemSettings.GetMetric(wx.SYS_SCREEN_Y) self.element_path = element_path self.listbox = None self.SetChoices(choices) # gp = self # while ( gp != None ) : # gp.Bind ( wx.EVT_MOVE , self.onControlChanged, gp ) # gp.Bind ( wx.EVT_SIZE , self.onControlChanged, gp ) # gp = gp.GetParent() self.Bind(wx.EVT_KILL_FOCUS, self.OnControlChanged) self.Bind(wx.EVT_TEXT_ENTER, self.OnControlChanged) self.Bind(wx.EVT_TEXT, self.OnEnteredText) self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) # If need drop down on left click if dropDownClick: self.Bind(wx.EVT_LEFT_DOWN, self.OnClickToggleDown) self.Bind(wx.EVT_LEFT_UP, self.OnClickToggleUp)
Example #8
Source File: recipe-577951.py From code with MIT License | 5 votes |
def __init__(self, parent, id=wx.ID_ANY, label="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER, validator=wx.DefaultValidator, name="roundbutton"): """ Default class constructor. :param `parent`: the L{RoundButton} parent; :param `id`: window identifier. A value of -1 indicates a default value; :param `label`: the button text label; :param `pos`: the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform; :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; :param `style`: the button style (unused); :param `validator`: the validator associated to the button; :param `name`: the button name. """ wx.PyControl.__init__(self, parent, id, pos, size, style, validator, name) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_ERASE_BACKGROUND, lambda event: None) self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave) self.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnter) self.Bind(wx.EVT_SET_FOCUS, self.OnGainFocus) self.Bind(wx.EVT_KILL_FOCUS, self.OnLoseFocus) self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) self.Bind(wx.EVT_KEY_UP, self.OnKeyUp) self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDown) self._mouseAction = None self._hasFocus = False self._buttonRadius = 0 self.SetLabel(label) self.InheritAttributes() self.SetInitialSize(size)
Example #9
Source File: benchmarks.py From nuxhash with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, algorithm): self.checkbox = wx.CheckBox(parent) self.label = wx.StaticText(parent, label=algorithm.name) self.label.Bind(wx.EVT_LEFT_UP, self._onclick) self.speeds = SpeedCtrl(parent)
Example #10
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def OnToolBarLeftUp(self, event): """ Handles the wx.EVT_LEFT_UP events for the toolbar. """ if self.lastClickedTool: self.lastClickedTool = None self.egEvent.SetShouldEnd() event.Skip()
Example #11
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 #12
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def OnLeftDown(self, event): x1, y1 = GetCursorPos() x2, y2 = self.parent.GetScreenPosition() self.offset = (x1 - x2, y1 - y2) # 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 exclusively self.CaptureMouse()
Example #13
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 #14
Source File: CustomTree.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, *args, **kwargs): CT.CustomTreeCtrl.__init__(self, *args, **kwargs) self.BackgroundBitmap = None self.BackgroundAlign = wx.ALIGN_LEFT | wx.ALIGN_TOP self.AddMenu = None self.Enabled = False self.Bind(wx.EVT_SCROLLWIN, self.OnScroll) self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
Example #15
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 #16
Source File: DebugVariableTextViewer.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, window, items=None): """ Constructor @param parent: Parent wx.Window of DebugVariableText @param window: Reference to the Debug Variable Panel @param items: List of DebugVariableItem displayed by Viewer """ DebugVariableViewer.__init__(self, window, items) wx.Panel.__init__(self, parent) # Set panel background colour self.SetBackgroundColour(wx.WHITE) # Define panel drop target self.SetDropTarget(DebugVariableTextDropTarget(self, window)) # Bind events self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick) self.Bind(wx.EVT_ENTER_WINDOW, self.OnEnter) self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeave) self.Bind(wx.EVT_SIZE, self.OnResize) self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) self.Bind(wx.EVT_PAINT, self.OnPaint) # Define panel min size for parent sizer layout self.SetMinSize(wx.Size(0, 25)) # Add buttons to Viewer for bitmap, callback in [("force", self.OnForceButton), ("release", self.OnReleaseButton), ("delete_graph", self.OnCloseButton)]: self.Buttons.append(GraphButton(0, 0, bitmap, callback))
Example #17
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 #18
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 #19
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 #20
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 #21
Source File: wx_bass_control.py From pybass with Apache License 2.0 | 5 votes |
def __init__(self, *args, **kwargs): wx.Slider.__init__(self, *args, **kwargs) self.player_ctrl = args[0] self.Bind(wx.EVT_LEFT_DOWN, self.event_left_down) self.Bind(wx.EVT_LEFT_UP, self.event_left_up) self.timer_interval = 500 self.timer = wx.Timer(self) self.Bind(wx.EVT_TIMER, self.event_timer)
Example #22
Source File: wx_ctrl_phoenix.py From pybass with Apache License 2.0 | 5 votes |
def __init__(self, *args, **kwargs): self.timer_interval = 500 self.player_ctrl = args[0] wx.Slider.__init__(self, *args, **kwargs) self.timer = wx.Timer(self) self.Bind(wx.EVT_LEFT_DOWN, self.event_left_down) self.Bind(wx.EVT_LEFT_UP, self.event_left_up) self.Bind(wx.EVT_TIMER, self.event_timer)
Example #23
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 #24
Source File: ui.py From python-wifi-survey-heatmap with GNU Affero General Public License v3.0 | 5 votes |
def __init__(self, parent): super(FloorplanPanel, self).__init__(parent) self.parent = parent self.img_path = parent.img_path self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) self.Bind(wx.EVT_LEFT_UP, self.onClick) self.Bind(wx.EVT_PAINT, self.on_paint) self.survey_points = [] self.data_filename = '%s.json' % self.parent.survey_title if os.path.exists(self.data_filename): self._load_file(self.data_filename) self.collector = Collector(self.parent.interface, self.parent.server) self.parent.SetStatusText("Ready.")
Example #25
Source File: wm_core.py From wafer_map with GNU General Public License v3.0 | 5 votes |
def _bind_events(self): """ Bind panel and canvas events. Note that key-down is bound again - this allws hotkeys to work even if the main Frame, which defines hotkeys in menus, is not present. wx sents the EVT_KEY_DOWN up the chain and, if the Frame and hotkeys are present, executes those instead. At least I think that's how that works... See http://wxpython.org/Phoenix/docs/html/events_overview.html for more info. """ # Canvas Events self.canvas.Bind(FloatCanvas.EVT_MOTION, self.on_mouse_move) self.canvas.Bind(FloatCanvas.EVT_MOUSEWHEEL, self.on_mouse_wheel) self.canvas.Bind(FloatCanvas.EVT_MIDDLE_DOWN, self.on_mouse_middle_down) self.canvas.Bind(FloatCanvas.EVT_MIDDLE_UP, self.on_mouse_middle_up) self.canvas.Bind(wx.EVT_PAINT, self._on_first_paint) # XXX: Binding the EVT_LEFT_DOWN seems to cause Issue #24. # What seems to happen is: If I bind EVT_LEFT_DOWN, then the # parent panel or application can't set focus to this # panel, which prevents the EVT_MOUSEWHEEL event from firing # properly. # self.canvas.Bind(wx.EVT_LEFT_DOWN, self.on_mouse_left_down) # self.canvas.Bind(wx.EVT_RIGHT_DOWN, self.on_mouse_right_down) # self.canvas.Bind(wx.EVT_LEFT_UP, self.on_mouse_left_up) # self.canvas.Bind(wx.EVT_KEY_DOWN, self._on_key_down) # This is supposed to fix flicker on mouse move, but it doesn't work. # self.Bind(wx.EVT_ERASE_BACKGROUND, None) # Panel Events self.Bind(csel.EVT_COLOURSELECT, self.on_color_change)
Example #26
Source File: yamled.py From report-ng with GNU General Public License v2.0 | 5 votes |
def __init__(self, parent, frame, *args, **kwargs): self.frame = frame wx.TextCtrl.__init__(self, parent, *args, **kwargs) self.SetEditable(False) self.Bind(wx.EVT_MOUSE_EVENTS, self.__OnMouseEvent) self.Bind(wx.EVT_SET_FOCUS, self.__OnSetFocus) self.Bind(wx.EVT_KILL_FOCUS, self.__OnKillFocus) self.Bind(wx.EVT_LEFT_UP, self.__OnLeftUp)
Example #27
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 #28
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 #29
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 #30
Source File: panel_monitor.py From RF-Monitor with GNU General Public License v2.0 | 4 votes |
def __init__(self, parent, eventHandler): Monitor.__init__(self, None, False, False, None, None, False, [], []) self._eventHandler = eventHandler self._isRecording = False self._isRunning = False self._isLow = True self._colours = [] pre = wx.PrePanel() self._ui = load_ui('PanelMonitor.xrc') handlerNumCtrl = XrcHandlerNumCtrl() handlerMeter = XrcHandlerMeter() self._ui.AddHandler(handlerNumCtrl) self._ui.AddHandler(handlerMeter) self._ui.LoadOnPanel(pre, parent, 'PanelMonitor') self.PostCreate(pre) self._panelColour = xrc.XRCCTRL(pre, 'panelColour') self._checkEnable = xrc.XRCCTRL(pre, 'checkEnable') self._checkAlert = xrc.XRCCTRL(pre, 'checkAlert') self._checkDynamic = xrc.XRCCTRL(pre, 'checkDynamic') self._choiceFreq = xrc.XRCCTRL(pre, 'choiceFreq') self._textSignals = xrc.XRCCTRL(pre, 'textSignals') # TODO: hackish for child in self.GetChildren(): if isinstance(child, WidgetMeter): self._meterLevel = child self._sliderThreshold = xrc.XRCCTRL(pre, 'sliderThreshold') self._buttonDel = xrc.XRCCTRL(pre, 'buttonDel') self.__set_records() self._on_del = None self._panelColour.Bind(wx.EVT_LEFT_UP, self.__on_colour) self.Bind(wx.EVT_CHECKBOX, self.__on_enable, self._checkEnable) self.Bind(wx.EVT_CHECKBOX, self.__on_alert, self._checkAlert) self.Bind(wx.EVT_CHECKBOX, self.__on_dynamic, self._checkDynamic) self.Bind(wx.EVT_CHOICE, self.__on_freq, self._choiceFreq) self.Bind(wx.EVT_SLIDER, self.__on_threshold, self._sliderThreshold) self.Bind(wx.EVT_BUTTON, self.__on_del, self._buttonDel)