示例#1
0
文件: toolbar.py 项目: mpm2050/Raven
 def _createContextMenuModel(self):
     menuModel = ZMenuModel()
     validSizes = self.contentProvider.getToolBitmapSizes()
     if len(validSizes) > 1:
         subMenuID = menuModel.addMenu(_extstr(u"toolbar.ToolSize"),
                                       0)  #$NON-NLS-1$
         for vsize in validSizes:
             menuID = menuModel.addMenuItemWithAction(
                 u"%d x %d" % (vsize, vsize), 0,
                 ZResizeToolbarAction(vsize), subMenuID)  #$NON-NLS-1$
             menuModel.setMenuItemCheckbox(menuID, True)
         menuModel.addSeparator(0)
     menuID = menuModel.addMenuItemWithAction(
         _extstr(u"toolbar.ShowText"), 0,
         ZShowTextMenuAction())  #$NON-NLS-1$
     menuModel.setMenuItemCheckbox(menuID, True)
     return menuModel