Python RootWikiPage Example

说明

python rootwikipage示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: Python

命名空间/包名称: outwikercoretree

示例#1

    def validateBeforeCreation (self, parentPage):
        if not self._validateCommon (parentPage, None):
            return False

        if (parentPage is not None and
                not RootWikiPage.testDublicate (parentPage, self.pageTitle)):
            MessageBox (_(u"A page with some title already exists"),
                        _(u"Error"),
                        wx.ICON_ERROR | wx.OK)
            return False

        return True

示例#2
文件: pagedialog.py项目: s200999900/outwiker

    def onOk (self, event):
        if not testPageTitle (self.pageTitle):
            self.generalPanel.titleTextCtrl.SetFocus()
            self.generalPanel.titleTextCtrl.SetSelection (-1, -1)
            return

        if (self.parentPage != None and
                not RootWikiPage.testDublicate(self.parentPage, self.pageTitle)):
            outwiker.core.commands.MessageBox (_(u"A page with this title already exists"), _(u"Error"), wx.ICON_ERROR | wx.OK)
            return

        self.saveParams()
        self.lastCreatedPageType.value = self.selectedFactory.getTypeString()
        event.Skip()

展开阅读全文