def onImportProfile(self, event): context = ZMenuActionContext(self) menu = ZModelBasedMenu(self.importMenuModel, context, self) (w, h) = self.importButton.GetSizeTuple() #@UnusedVariable pos = wx.Point(1, h - 2) self.importButton.PopupMenu(menu, pos) event.Skip()
def onDetectImport(self): osutil = getOSUtil() if osutil.getOperatingSystemId() == u"win32": #$NON-NLS-1$ action = ZDetectImportAction(self, self.model) context = ZMenuActionContext(self) action.runAction(context) pass
def _createChoiceMenu(self): menuModel = self._createChoiceMenuModel() menuContext = ZMenuActionContext(self) contentProvider = ZModelBasedMenuContentProvider( menuModel, menuContext) eventHandler = ZModelBasedMenuEventHandler(menuModel, menuContext) self.menu = ZMenu(self, menuModel.getRootNode(), contentProvider, eventHandler)
def _popupGlyphMenu(self, menuNode, glyph): context = ZMenuActionContext(self) provider = ZActiveModelBasedMenuContentProvider(menuNode, context) handler = ZActiveModelBasedMenuEventHandler(context) menu = ZMenu(self, menuNode, provider, handler) (x, y) = glyph.GetPositionTuple() #@UnusedVariable (w, h) = glyph.GetSizeTuple() #@UnusedVariable self.PopupMenuXY(menu, x, y + h - 1)
def _createMenuBar(self): # FIXME (EPW) this should be supplied by the perspective menuContext = ZMenuActionContext(self) menuBarModel = ZBlogAppMainMenuBarModel(self.perspectives) provider = ZModelBasedMenuContentProvider(menuBarModel, menuContext) eventHandler = ZModelBasedMenuEventHandler(menuBarModel, menuContext) self.menuBar = ZMenuBar(self, provider, eventHandler) self.SetMenuBar(self.menuBar)
def onSettings(self): context = ZMenuActionContext(self) self.settingsAction.runAction(context)
def onNewMediaStorage(self): context = ZMenuActionContext(self) self.newStorageAction.runAction(context)
def onCreateAccount(self): context = ZMenuActionContext(self) self.newAccountAction.runAction(context)
def CreatePopupMenu(self): menuContext = ZMenuActionContext(self.mainWindow) provider = ZModelBasedMenuContentProvider(self.menuModel, menuContext) handler = ZModelBasedMenuEventHandler(self.menuModel, menuContext) return ZMenu(self, self.menuModel.getRootNode(), provider, handler)
def onDoubleClick(self, event): if self.mainWindow.IsIconized(): menuContext = ZMenuActionContext(self.mainWindow) self.restoreAction.runAction(menuContext) event.Skip()
def getMenuActionContext(self): return ZMenuActionContext(self)
def _createMenuContext(self): return ZMenuActionContext(self.tab)
def onWritePost(self): context = ZMenuActionContext(self) self.writePostAction.runAction(context)
def _createActionContext(self): return ZMenuActionContext(getApplicationModel().getTopWindow())
def _createActionContext(self): return ZMenuActionContext(self.dialog)