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


Python wx.ITEM_NORMAL属性代码示例

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


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

示例1: _init_toolbar

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _init_toolbar(self):
        DEBUG_MSG("_init_toolbar", 1, self)

        self._parent = self.canvas.GetParent()

        self.wx_ids = {}
        for text, tooltip_text, image_file, callback in self.toolitems:
            if text is None:
                self.AddSeparator()
                continue
            self.wx_ids[text] = (
                self.AddTool(
                    -1,
                    bitmap=_load_bitmap(image_file + ".png"),
                    bmpDisabled=wx.NullBitmap,
                    label=text, shortHelp=text, longHelp=tooltip_text,
                    kind=(wx.ITEM_CHECK if text in ["Pan", "Zoom"]
                          else wx.ITEM_NORMAL))
                .Id)
            self.Bind(wx.EVT_TOOL, getattr(self, callback),
                      id=self.wx_ids[text])

        self.Realize() 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:25,代码来源:backend_wx.py

示例2: RefreshProfileMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def RefreshProfileMenu(self):
        if self.EDITMENU_ID is not None:
            profile = self.Manager.GetCurrentProfileName()
            edititem = self.Frame.EditMenu.FindItemById(self.EDITMENU_ID)
            if edititem:
                length = self.Frame.AddMenu.GetMenuItemCount()
                for i in xrange(length-6):
                    additem = self.Frame.AddMenu.FindItemByPosition(6)
                    self.Frame.AddMenu.Delete(additem.GetId())
                if profile not in ("None", "DS-301"):
                    edititem.SetText(_("%s Profile")%profile)
                    edititem.Enable(True)
                    self.Frame.AddMenu.AppendSeparator()
                    for text, indexes in self.Manager.GetCurrentSpecificMenu():
                        new_id = wx.NewId()
                        self.Frame.AddMenu.Append(help='', id=new_id, kind=wx.ITEM_NORMAL, text=text)
                        self.Frame.Bind(wx.EVT_MENU, self.GetProfileCallBack(text), id=new_id)
                else:
                    edititem.SetText(_("Other Profile"))
                    edititem.Enable(False)
        
#-------------------------------------------------------------------------------
#                            Buffer Functions
#------------------------------------------------------------------------------- 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:26,代码来源:nodeeditortemplate.py

示例3: _init_coll_SubindexGridMenu_Items

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _init_coll_SubindexGridMenu_Items(self, parent):
        parent.Append(help='', id=ID_EDITINGPANELMENU1ITEMS0,
              kind=wx.ITEM_NORMAL, text=_('Add subindexes'))
        parent.Append(help='', id=ID_EDITINGPANELMENU1ITEMS1,
              kind=wx.ITEM_NORMAL, text=_('Delete subindexes'))
        parent.AppendSeparator()
        parent.Append(help='', id=ID_EDITINGPANELMENU1ITEMS3,
              kind=wx.ITEM_NORMAL, text=_('Default value'))
        if not self.Editable:
            parent.Append(help='', id=ID_EDITINGPANELMENU1ITEMS4,
                  kind=wx.ITEM_NORMAL, text=_('Add to DCF'))
        self.Bind(wx.EVT_MENU, self.OnAddSubindexMenu,
              id=ID_EDITINGPANELMENU1ITEMS0)
        self.Bind(wx.EVT_MENU, self.OnDeleteSubindexMenu,
              id=ID_EDITINGPANELMENU1ITEMS1)
        self.Bind(wx.EVT_MENU, self.OnDefaultValueSubindexMenu,
              id=ID_EDITINGPANELMENU1ITEMS3)
        if not self.Editable:
            self.Bind(wx.EVT_MENU, self.OnAddToDCFSubindexMenu,
                  id=ID_EDITINGPANELMENU1ITEMS4) 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:22,代码来源:subindextable.py

示例4: _init_coll_FileMenu_Items

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _init_coll_FileMenu_Items(self, parent):
        parent.Append(help='', id=wx.ID_NEW,
              kind=wx.ITEM_NORMAL, text=_('New\tCTRL+N'))
        parent.Append(help='', id=wx.ID_OPEN,
              kind=wx.ITEM_NORMAL, text=_('Open\tCTRL+O'))
        parent.Append(help='', id=wx.ID_CLOSE,
              kind=wx.ITEM_NORMAL, text=_('Close\tCTRL+W'))
        parent.AppendSeparator()
        parent.Append(help='', id=wx.ID_SAVE,
              kind=wx.ITEM_NORMAL, text=_('Save\tCTRL+S'))
        parent.AppendSeparator()
        parent.Append(help='', id=wx.ID_EXIT,
              kind=wx.ITEM_NORMAL, text=_('Exit'))
        self.Bind(wx.EVT_MENU, self.OnNewProjectMenu, id=wx.ID_NEW)
        self.Bind(wx.EVT_MENU, self.OnOpenProjectMenu, id=wx.ID_OPEN)
        self.Bind(wx.EVT_MENU, self.OnCloseProjectMenu, id=wx.ID_CLOSE)
        self.Bind(wx.EVT_MENU, self.OnSaveProjectMenu, id=wx.ID_SAVE)
        self.Bind(wx.EVT_MENU, self.OnQuitMenu, id=wx.ID_EXIT) 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:20,代码来源:networkedit.py

示例5: _init_coll_AddMenu_Items

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _init_coll_AddMenu_Items(self, parent):
        parent.Append(help='', id=ID_NETWORKEDITADDMENUSDOSERVER,
              kind=wx.ITEM_NORMAL, text=_('SDO Server'))
        parent.Append(help='', id=ID_NETWORKEDITADDMENUSDOCLIENT,
              kind=wx.ITEM_NORMAL, text=_('SDO Client'))
        parent.Append(help='', id=ID_NETWORKEDITADDMENUPDOTRANSMIT,
              kind=wx.ITEM_NORMAL, text=_('PDO Transmit'))
        parent.Append(help='', id=ID_NETWORKEDITADDMENUPDORECEIVE,
              kind=wx.ITEM_NORMAL, text=_('PDO Receive'))
        parent.Append(help='', id=ID_NETWORKEDITADDMENUMAPVARIABLE,
              kind=wx.ITEM_NORMAL, text=_('Map Variable'))
        parent.Append(help='', id=ID_NETWORKEDITADDMENUUSERTYPE,
              kind=wx.ITEM_NORMAL, text=_('User Type'))
        self.Bind(wx.EVT_MENU, self.OnAddSDOServerMenu,
              id=ID_NETWORKEDITADDMENUSDOSERVER)
        self.Bind(wx.EVT_MENU, self.OnAddSDOClientMenu,
              id=ID_NETWORKEDITADDMENUSDOCLIENT)
        self.Bind(wx.EVT_MENU, self.OnAddPDOTransmitMenu,
              id=ID_NETWORKEDITADDMENUPDOTRANSMIT)
        self.Bind(wx.EVT_MENU, self.OnAddPDOReceiveMenu,
              id=ID_NETWORKEDITADDMENUPDORECEIVE)
        self.Bind(wx.EVT_MENU, self.OnAddMapVariableMenu,
              id=ID_NETWORKEDITADDMENUMAPVARIABLE)
        self.Bind(wx.EVT_MENU, self.OnAddUserTypeMenu,
              id=ID_NETWORKEDITADDMENUUSERTYPE) 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:27,代码来源:networkedit.py

示例6: _set_tools

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _set_tools(self):
        if not self._tb: return  # nothing left to do
        self._tb.ClearTools()
        # now add all the tools
        for tool in self.tools:
            if tool.id == '---':  # the tool is a separator
                self._tb.AddSeparator()
            else:
                bmp1 = self.get_preview_obj_bitmap(tool.bitmap1)
                bmp2 = self.get_preview_obj_bitmap(tool.bitmap2) if tool.bitmap2.strip() else None
                kinds = [wx.ITEM_NORMAL, wx.ITEM_CHECK, wx.ITEM_RADIO]
                try:
                    kind = kinds[int(tool.type)]
                except (ValueError, IndexError):
                    kind = wx.ITEM_NORMAL
                ADD = self._tb.AddLabelTool  if compat.IS_CLASSIC else  self._tb.AddTool
                if bmp2 is not None:
                    ADD( wx.NewId(), misc.wxstr(tool.label), bmp1, bmp2, kind,
                         misc.wxstr(tool.short_help), misc.wxstr(tool.long_help) )
                else:
                    ADD( wx.NewId(), misc.wxstr(tool.label), bmp1, shortHelp=misc.wxstr(tool.short_help) )
        # this is required to refresh the toolbar properly
        self._refresh_widget() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:25,代码来源:toolbar.py

示例7: GetConfNodeMenuItems

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def GetConfNodeMenuItems(self):
        if self.Editable:
            add_menu = [(wx.ITEM_NORMAL, (_('SDO Server'), ID_SLAVEEDITORADDMENUSDOSERVER, '', self.OnAddSDOServerMenu)),
                        (wx.ITEM_NORMAL, (_('SDO Client'), ID_SLAVEEDITORADDMENUSDOCLIENT, '', self.OnAddSDOClientMenu)),
                        (wx.ITEM_NORMAL, (_('PDO Transmit'), ID_SLAVEEDITORADDMENUPDOTRANSMIT, '', self.OnAddPDOTransmitMenu)),
                        (wx.ITEM_NORMAL, (_('PDO Receive'), ID_SLAVEEDITORADDMENUPDORECEIVE, '', self.OnAddPDOReceiveMenu)),
                        (wx.ITEM_NORMAL, (_('Map Variable'), ID_SLAVEEDITORADDMENUMAPVARIABLE, '', self.OnAddMapVariableMenu)),
                        (wx.ITEM_NORMAL, (_('User Type'), ID_SLAVEEDITORADDMENUUSERTYPE, '', self.OnAddUserTypeMenu))]

            profile = self.Controler.GetCurrentProfileName()
            if profile not in ("None", "DS-301"):
                other_profile_text = _("%s Profile") % profile
                add_menu.append((wx.ITEM_SEPARATOR, None))
                for text, _indexes in self.Manager.GetCurrentSpecificMenu():
                    add_menu.append((wx.ITEM_NORMAL, (text, wx.NewId(), '', self.GetProfileCallBack(text))))
            else:
                other_profile_text = _('Other Profile')

            return [(wx.ITEM_NORMAL, (_('DS-301 Profile'), ID_SLAVEEDITORCONFNODEMENUDS301PROFILE, '', self.OnCommunicationMenu)),
                    (wx.ITEM_NORMAL, (_('DS-302 Profile'), ID_SLAVEEDITORCONFNODEMENUDS302PROFILE, '', self.OnOtherCommunicationMenu)),
                    (wx.ITEM_NORMAL, (other_profile_text, ID_SLAVEEDITORCONFNODEMENUDSOTHERPROFILE, '', self.OnEditProfileMenu)),
                    (wx.ITEM_SEPARATOR, None),
                    (add_menu, (_('Add'), ID_SLAVEEDITORCONFNODEMENUADD))]
        return [] 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:26,代码来源:SlaveEditor.py

示例8: _init_coll_HelpMenu_Items

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _init_coll_HelpMenu_Items(self, parent):
        AppendMenu(parent, help='', id=wx.ID_HELP,
                   kind=wx.ITEM_NORMAL, text=_(u'PLCOpenEditor') + '\tF1')
        # AppendMenu(parent, help='', id=wx.ID_HELP_CONTENTS,
        #      kind=wx.ITEM_NORMAL, text=u'PLCOpen\tF2')
        # AppendMenu(parent, help='', id=wx.ID_HELP_CONTEXT,
        #      kind=wx.ITEM_NORMAL, text=u'IEC 61131-3\tF3')

        def handler(event):
            return wx.MessageBox(
                version.GetCommunityHelpMsg(),
                _(u'Community support'),
                wx.OK | wx.ICON_INFORMATION)

        id = wx.NewId()
        parent.Append(help='', id=id, kind=wx.ITEM_NORMAL, text=_(u'Community support'))
        self.Bind(wx.EVT_MENU, handler, id=id)

        AppendMenu(parent, help='', id=wx.ID_ABOUT,
                   kind=wx.ITEM_NORMAL, text=_(u'About'))
        self.Bind(wx.EVT_MENU, self.OnPLCOpenEditorMenu, id=wx.ID_HELP)
        # self.Bind(wx.EVT_MENU, self.OnPLCOpenMenu, id=wx.ID_HELP_CONTENTS)
        self.Bind(wx.EVT_MENU, self.OnAboutMenu, id=wx.ID_ABOUT) 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:25,代码来源:PLCOpenEditor.py

示例9: CreateMenuBar

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def CreateMenuBar(self):
        # Create menu
        m_menubar = wx.MenuBar(0)

        # File menu
        m_menuFile = wx.Menu()
        m_menuItemQuit = wx.MenuItem(m_menuFile, wx.ID_ANY, u'&Quit' + u'\t' + u'Ctrl+Q',
                                     wx.EmptyString, wx.ITEM_NORMAL)
        m_menuFile.Append(m_menuItemQuit)
        m_menubar.Append(m_menuFile, u'&File')

        # About menu
        m_menuAbout = wx.Menu()
        m_menuItemAbout = wx.MenuItem(m_menuAbout, wx.ID_ANY, u'&About' + u'\t' + u'Shift+?',
                                      wx.EmptyString, wx.ITEM_NORMAL)
        m_menuAbout.Append(m_menuItemAbout)
        m_menubar.Append(m_menuAbout, u'&Help')

        # Set menu
        self.SetMenuBar(m_menubar)

        self.Bind(wx.EVT_MENU, self.OnMenuQuit, id=m_menuItemQuit.GetId())
        self.Bind(wx.EVT_MENU, self.OnMenuAbout, id=m_menuItemAbout.GetId()) 
开发者ID:Erriez,项目名称:R421A08-rs485-8ch-relay-board,代码行数:25,代码来源:wxpython_toggle.py

示例10: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def __init__(self, *args, **kwds):
        # begin wxGlade: MainFrame.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        
        # Menu Bar
        self.frame_2_menubar = wx.MenuBar()
        wxglade_tmp_menu = wx.Menu()
        self.opf = wx.MenuItem(wxglade_tmp_menu, wx.NewId(), "Open folder..", "", wx.ITEM_NORMAL)
        wxglade_tmp_menu.AppendItem(self.opf)

        self.opfi = wx.MenuItem(wxglade_tmp_menu, wx.NewId(), "Open file..", "", wx.ITEM_NORMAL)
        wxglade_tmp_menu.AppendItem(self.opfi)
        wxglade_tmp_menu.AppendSeparator()
        self.ana = wx.MenuItem(wxglade_tmp_menu, wx.NewId(), "Analyze", "", wx.ITEM_NORMAL)
        wxglade_tmp_menu.AppendItem(self.ana)
        self.frame_2_menubar.Append(wxglade_tmp_menu, "File")
        self.SetMenuBar(self.frame_2_menubar)
        # Menu Bar end
        self.list_ctrl_1 = wx.ListCtrl(self, -1, style=wx.LC_REPORT | wx.SUNKEN_BORDER)
        for i in range(512):
            self.list_ctrl_1.InsertColumn(i, str(i), width=30)
        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_MENU, self.of, self.opf)
        self.Bind(wx.EVT_MENU, self.anlz, self.ana)
        self.Bind(wx.EVT_MENU, self.ofi, self.opfi)
        # end wxGlade 
开发者ID:c3c,项目名称:E-Safenet,代码行数:31,代码来源:esafenet_gui.py

示例11: _ToolBar_AddSimpleTool

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _ToolBar_AddSimpleTool(self, toolId, bitmap, shortHelpString="", longHelpString="", isToggle=0):
    """
    Old style method to add a tool to the toolbar.
    """
    kind = wx.ITEM_NORMAL
    if isToggle: kind = wx.ITEM_CHECK
    return self.AddTool(toolId, '', bitmap, wx.NullBitmap, kind,
                        shortHelpString, longHelpString) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:10,代码来源:core.py

示例12: _ToolBar_AddLabelTool

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _ToolBar_AddLabelTool(self, id, label, bitmap, bmpDisabled=wx.NullBitmap, kind=wx.ITEM_NORMAL, shortHelp="", longHelp="", clientData=None):
    """
    Old style method to add a tool in the toolbar.
    """
    return self.AddTool(id, label, bitmap, bmpDisabled, kind,
                        shortHelp, longHelp, clientData) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:8,代码来源:core.py

示例13: _ToolBar_InsertSimpleTool

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _ToolBar_InsertSimpleTool(self, pos, toolId, bitmap, shortHelpString="", longHelpString="", isToggle=0):
    """
    Old style method to insert a tool in the toolbar.
    """
    kind = wx.ITEM_NORMAL
    if isToggle: kind = wx.ITEM_CHECK
    return self.InsertTool(pos, toolId, '', bitmap, wx.NullBitmap, kind,
                           shortHelpString, longHelpString) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:10,代码来源:core.py

示例14: _ToolBar_InsertLabelTool

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def _ToolBar_InsertLabelTool(self, pos, id, label, bitmap, bmpDisabled=wx.NullBitmap, kind=wx.ITEM_NORMAL, shortHelp="", longHelp="", clientData=None):
    """
    Old style method to insert a tool in the toolbar.
    """
    return self.InsertTool(pos, id, label, bitmap, bmpDisabled, kind,
                           shortHelp, longHelp, clientData) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:8,代码来源:core.py

示例15: add_toolitem

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ITEM_NORMAL [as 别名]
def add_toolitem(
        self, name, group, position, image_file, description, toggle):

        before, group = self._add_to_group(group, name, position)
        idx = self.GetToolPos(before.Id)
        if image_file:
            bmp = _load_bitmap(image_file)
            kind = wx.ITEM_NORMAL if not toggle else wx.ITEM_CHECK
            tool = self.InsertTool(idx, -1, name, bmp, wx.NullBitmap, kind,
                                   description or "")
        else:
            size = (self.GetTextExtent(name)[0]+10, -1)
            if toggle:
                control = wx.ToggleButton(self, -1, name, size=size)
            else:
                control = wx.Button(self, -1, name, size=size)
            tool = self.InsertControl(idx, control, label=name)
        self.Realize()

        def handler(event):
            self.trigger_tool(name)

        if image_file:
            self.Bind(wx.EVT_TOOL, handler, tool)
        else:
            control.Bind(wx.EVT_LEFT_DOWN, handler)

        self._toolitems.setdefault(name, [])
        group.insert(position, tool)
        self._toolitems[name].append((tool, handler)) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:32,代码来源:backend_wx.py


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