Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
 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)