本文整理汇总了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()
示例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)
示例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
示例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)
示例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)
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import PyCommandEvent [as 别名]
def __init__(self, evtType):
wx.PyCommandEvent.__init__(self, evtType, -1)
self.veto = False
示例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
示例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])
示例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
示例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
###############################################################################
示例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