Example #1
0
 def _createChoiceMenuModel(self):
     model = ZMenuModel()
     for (label, bitmap, id) in self.choices:
         action = ZTextBoxChoiceAction(id)
         menuId = model.addMenuItemWithAction(label, 0, action)
         model.setMenuItemCheckbox(menuId, True)
         model.setMenuItemBitmap(menuId, bitmap)
     return model
Example #2
0
 def _createChoiceMenuModel(self):
     model = ZMenuModel()
     for (label, bitmap, id) in self.choices:
         action = ZTextBoxChoiceAction(id)
         menuId = model.addMenuItemWithAction(label, 0, action)
         model.setMenuItemCheckbox(menuId, True)
         model.setMenuItemBitmap(menuId, bitmap)
     return model
Example #3
0
 def onPanelMenuButton(self, event):
     menuModel = ZMenuModel()
     for panelName in self.detailsContainer.getPanelNames():
         action = ZSummarySwitchDetailAction(self, panelName)
         menuId = menuModel.addMenuItemWithAction(panelName, 0, action)
         menuModel.setMenuItemCheckbox(menuId, True)
     menu = ZModelBasedMenu(menuModel, None, self)
     h = self.panelMenuButton.GetSizeTuple()[1]
     x = self.panelMenuButton.GetPositionTuple()[0]
     pos = wx.Point(x, h)
     self.PopupMenu(menu, pos)
     event.Skip()
Example #4
0
 def onPanelMenuButton(self, event):
     menuModel = ZMenuModel()
     for panelName in self.detailsContainer.getPanelNames():
         action = ZSummarySwitchDetailAction(self, panelName)
         menuId = menuModel.addMenuItemWithAction(panelName, 0, action)
         menuModel.setMenuItemCheckbox(menuId, True)
     menu = ZModelBasedMenu(menuModel, None, self)
     h = self.panelMenuButton.GetSizeTuple()[1]
     x = self.panelMenuButton.GetPositionTuple()[0]
     pos = wx.Point(x, h)
     self.PopupMenu(menu, pos)
     event.Skip()
Example #5
0
 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