def __onInsertLink (self, event): linkController = LinkDialogContoller (self, self.codeEditor.GetSelectedText()) if linkController.showDialog() == wx.ID_OK: text = u'<a href="{link}">{comment}</a>'.format (comment=linkController.comment, link=linkController.link) self.codeEditor.replaceText (text)
def insertLink (application): codeEditor = application.mainWindow.pagePanel.pageView.codeEditor config = WikiConfig (application.config) linkController = LinkDialogContoller (application.mainWindow, codeEditor.GetSelectedText()) if linkController.showDialog() == wx.ID_OK: linkCreator = LinkCreator (config) text = linkCreator.create (linkController.link, linkController.comment) codeEditor.replaceText (text)
def insertLink (application): assert application.mainWindow != None assert application.mainWindow.pagePanel != None codeEditor = application.mainWindow.pagePanel.pageView.codeEditor linkController = LinkDialogContoller (application.mainWindow, codeEditor.GetSelectedText()) if linkController.showDialog() == wx.ID_OK: text = u'<a href="{link}">{comment}</a>'.format (comment=linkController.comment, link=linkController.link) codeEditor.replaceText (text)
def __onInsertLink (self, event): linkController = LinkDialogContoller (self, self.codeEditor.GetSelectedText()) if linkController.showDialog() == wx.ID_OK: linkCreator = LinkCreator (self.config) text = linkCreator.create (linkController.link, linkController.comment) self.codeEditor.replaceText (text)