當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.EVT_CONTEXT_MENU屬性代碼示例

本文整理匯總了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) 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:10,代碼來源:CustomWidgets.py

示例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) 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:7,代碼來源:ListCtrl.py

示例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 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:10,代碼來源:SettingsWindow.py

示例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) 
開發者ID:Erriez,項目名稱:R421A08-rs485-8ch-relay-board,代碼行數:45,代碼來源:relay_board_gui.py


注:本文中的wx.EVT_CONTEXT_MENU屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。