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


Python wx.EVT_LEFT_UP属性代码示例

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


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

示例1: do_layout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [as 别名]
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 
开发者ID:ME-ICA,项目名称:me-ica,代码行数:25,代码来源:components.py

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [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

示例3: get_summary_widgets

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [as 别名]
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)
        ] 
开发者ID:theRealTacoTime,项目名称:poclbm,代码行数:24,代码来源:guiminer.py

示例4: do_layout

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [as 别名]
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 
开发者ID:lrq3000,项目名称:pyFileFixity,代码行数:24,代码来源:components.py

示例5: OnLeftUp

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [as 别名]
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() 
开发者ID:ActiveState,项目名称:code,代码行数:23,代码来源:recipe-577951.py

示例6: OnDragEnd

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [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

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [as 别名]
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) 
开发者ID:Wyliodrin,项目名称:pybass,代码行数:10,代码来源:wx_bass_control.py

示例8: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [as 别名]
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) 
开发者ID:Wyliodrin,项目名称:pybass,代码行数:10,代码来源:wx_ctrl_phoenix.py

示例9: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [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

示例10: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [as 别名]
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.") 
开发者ID:jantman,项目名称:python-wifi-survey-heatmap,代码行数:15,代码来源:ui.py

示例11: _bind_events

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [as 别名]
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) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:35,代码来源:wm_core.py

示例12: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [as 别名]
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) 
开发者ID:hvqzao,项目名称:report-ng,代码行数:10,代码来源:yamled.py

示例13: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [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

示例14: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [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

示例15: bind_movement_binds

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_LEFT_UP [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


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