本文整理汇总了Python中wx.EVT_CONTEXT_MENU属性的典型用法代码示例。如果您正苦于以下问题:Python wx.EVT_CONTEXT_MENU属性的具体用法?Python wx.EVT_CONTEXT_MENU怎么用?Python wx.EVT_CONTEXT_MENU使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.EVT_CONTEXT_MENU属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CONTEXT_MENU [as 别名]
def __init__(self, listctrl):
# I'll be nice and ignore you.
if not isinstance(listctrl, wx.ListCtrl):
return
self.listctrl = listctrl
self.Bind(wx.EVT_LEFT_DOWN, self.LeftDown)
self.Bind(wx.EVT_LEFT_DCLICK, self.LeftDClick)
self.Bind(wx.EVT_CONTEXT_MENU, self.ContextMenu)
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CONTEXT_MENU [as 别名]
def __init__(self):
self.context_menu = None
self.column_context_menu = None
self.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu)
self.Bind(wx.EVT_LIST_COL_RIGHT_CLICK, self.OnColumnContextMenu)
示例3: new_sample
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CONTEXT_MENU [as 别名]
def new_sample(self, sample_class, value):
sample = sample_class(self, size=wx.Size(-1, 20), style=wx.SUNKEN_BORDER)
# I happen to know 200 is the right number because I looked.
sample.SetValue(self.sample_value, 'running', (200, 0, self.sample_data))
sample.Bind(wx.EVT_LEFT_DOWN, self.sample)
sample.Bind(wx.EVT_CONTEXT_MENU, None)
sample.value = value
return sample
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CONTEXT_MENU [as 别名]
def __init__(self, parent, settings_file=None):
frmRelays.__init__(self, parent)
# Protect events when closing window
self.closing_window = False
# Set window size and minimum window size
self.SetSize(wx.Size(580, 650))
self.SetMinSize(wx.Size(580, 650))
# Set application icon
ico_path = resource_path('images/relay.ico')
if ico_path:
self.m_relay_icon = wx.Icon(ico_path)
self.SetIcon(self.m_relay_icon)
self.SetTitle('R421A08 Relay Control')
# Create taskbar icon
self.m_taskbar_icon = CustomTaskBarIcon(self, self.m_relay_icon)
# Create MODBUS object
self.m_relay_modbus = relay_modbus.Modbus()
# Refresh serial ports
self.OnRefreshPortsClick(None)
self.m_menuItemDisconnect.Enable(False)
# Load settings from file when available
self.m_settings_file = settings_file
self.m_panel_changed = False
if self.m_settings_file and os.path.exists(self.m_settings_file):
self.load_settings(self.m_settings_file)
else:
# Create default relay panel
self.new_relay_panel()
# Disable controls on relay panel
self.disable_relay_panels()
# Disable relay menu
self.disable_relay_menu()
self.m_notebook.Bind(wx.EVT_CONTEXT_MENU, self.OnContext)