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


Python wx.PyCommandEvent方法代码示例

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


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

示例1: on_key_press

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def on_key_press(self, event):
        """ Create manually the event when the correct key is pressed."""
        keycode = event.GetKeyCode()
        if keycode == wx.WXK_F1:
            control.HelpCtrl.action(wx.PyCommandEvent(wx.wxEVT_BUTTON))
        elif keycode == settings.CONFIG.getint('DEFAULT', 'Recording Hotkey'):
            btnEvent = wx.CommandEvent(wx.wxEVT_TOGGLEBUTTON)
            btnEvent.EventObject = self.record_button
            if not self.record_button.Value:
                self.record_button.Value = True
                self.rbc.action(btnEvent)
            else:
                self.record_button.Value = False
                self.rbc.action(btnEvent)
        elif keycode == settings.CONFIG.getint('DEFAULT', 'Playback Hotkey'):
            if not self.play_button.Value:
                self.play_button.Value = True
                btnEvent = wx.CommandEvent(wx.wxEVT_TOGGLEBUTTON)
                btnEvent.EventObject = self.play_button
                control.PlayCtrl().action(btnEvent)
        else:
            event.Skip() 
开发者ID:RMPR,项目名称:atbswp,代码行数:24,代码来源:gui.py

示例2: _CommandEvent

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def _CommandEvent():
    """Generate new (CmdEvent, Binder) tuple
        e.g. MooCmdEvent, EVT_MOO = EgCommandEvent()
    """
    evttype = wx.NewEventType()

    class _Event(wx.PyCommandEvent):
        def __init__(self, id, **kw):
            wx.PyCommandEvent.__init__(self, evttype, id)
            self.__dict__.update(kw)
            if not hasattr(self, "value"):
                self.value = None

        def GetValue(self):
            return self.value

        def SetValue(self, value):
            self.value = value

    return _Event, wx.PyEventBinder(evttype, 1) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:22,代码来源:Core.py

示例3: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def __init__(self, eventType, eventId):
        """
        Default class constructor.

        :param `eventType`: the event type;
        :param `eventId`: the event identifier.
        """
        
        wx.PyCommandEvent.__init__(self, eventType, eventId)
        self.isDown = False
        self.theButton = None 
开发者ID:ActiveState,项目名称:code,代码行数:13,代码来源:recipe-577951.py

示例4: swap

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def swap(self, i, j):
        self.index_mapping[i], self.index_mapping[j] = self.index_mapping[j], self.index_mapping[i]
        self.SetString(i, self.data[self.index_mapping[i]])
        self.SetString(j, self.data[self.index_mapping[j]])
        self.selected_items[i], self.selected_items[j] = self.selected_items[j], self.selected_items[i]
        # self.update_selection()
        # print("Updated mapping:", self.index_mapping)
        new_event = wx.PyCommandEvent(wx.EVT_LISTBOX.typeId, self.GetId())
        self.GetEventHandler().ProcessEvent(new_event) 
开发者ID:bluenote10,项目名称:PandasDataFrameGUI,代码行数:11,代码来源:dfgui.py

示例5: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def __init__(self, id, value=0, object=None):
        wx.PyCommandEvent.__init__(self, CustomIntCtrl.wxEVT_COMMAND_CUSTOM_INT_UPDATED, id)

        self.__value = value
        self.SetEventObject(object) 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:7,代码来源:CustomIntCtrl.py

示例6: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def __init__(self, evtType):
        wx.PyCommandEvent.__init__(self, evtType, -1)
        self.veto = False 
开发者ID:JackonYang,项目名称:bookhub,代码行数:5,代码来源:OLVEvent.py

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def __init__(self, eventType=EVT_EXTERNAL_UPDATE.evtType[0], id=0):
        wx.PyCommandEvent.__init__(self, eventType, id)
        self.img = None
        self.title = None 
开发者ID:dials,项目名称:dials,代码行数:6,代码来源:rstbx_frame.py

示例8: SetSelection

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def SetSelection(self, index):
        if self._images.selected_index != index:
            # self._images.selected_index = index
            # print("Posting event from fake choice")
            # wx.PostEvent(self, wx.PyCommandEvent(wx.EVT_CHOICE.typeId, 1))
            self._loader(self._images[index]) 
开发者ID:dials,项目名称:dials,代码行数:8,代码来源:viewer_tools.py

示例9: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def __init__(self, etype, eid, filename=None):
        """Creates the event object"""
        wx.PyCommandEvent.__init__(self, etype, eid)
        self._filename = filename 
开发者ID:dials,项目名称:dials,代码行数:6,代码来源:spotfinder_frame.py

示例10: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def __init__(self, eventType, id):
        """Construct a PySlip event.

        eventType  type of event
        id         unique event number

        Event will be adorned with attributes by raising code.
        """

        wx.PyCommandEvent.__init__(self, eventType, id)


###############################################################################
# The wxPython pySlip widget proper
############################################################################### 
开发者ID:dials,项目名称:dials,代码行数:17,代码来源:pyslip.py

示例11: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def __init__(self, windowID, data):
        wx.PyCommandEvent.__init__(self, self.eventType, windowID)
        self.data = data 
开发者ID:nccgroup,项目名称:Zulu,代码行数:5,代码来源:serialEvent.py


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