Example #1
0
    def execute(self):
        mT = archyState.mainText
        mT.setSelection('selection', *self.wordRange)

        self.removeSpellcheck = RemoveSpellcheckCommand()
        self.delText = archyState.commandMap.findSystemCommand("DeleteText")
        self.addText = archyState.commandMap.findSystemCommand("AddText")
        self.addText.setinfo(self.suggestion)

        self.removeSpellcheck.execute()
        self.delText.execute()
        self.addText.execute()

        foundNext = 0
        pos = mT.getCursorPos()
        start = pos

        while not foundNext and pos < mT.getLength() and abs(pos -
                                                             start) < 2000:
            if mT.behaviorArray.hasAction("SPELLCHECK", pos):
                foundNext = 1
            else:
                pos += 1

        messages.unqueue('persistant')

        if foundNext <> 0:
            mT.setCursor(pos)
            mT.setSelection('selection', mT.cursorPosInText)
            messages.display()
Example #2
0
    def execute(self):
        mT = archyState.mainText
        mT.setSelection('selection', *self.wordRange)
        
        self.removeSpellcheck = RemoveSpellcheckCommand()
        self.delText = archyState.commandMap.findSystemCommand("DeleteText")
        self.addText = archyState.commandMap.findSystemCommand("AddText")
        self.addText.setinfo(self.suggestion)

        self.removeSpellcheck.execute()
        self.delText.execute()
        self.addText.execute()

        foundNext = 0
        pos = mT.getCursorPos()
        start = pos

        while not foundNext and pos < mT.getLength() and abs(pos-start)<2000:
            if mT.behaviorArray.hasAction("SPELLCHECK", pos):
                foundNext = 1
            else:
                pos += 1
        
        messages.unqueue('persistant')

        if foundNext <> 0:
            mT.setCursor(pos)
            mT.setSelection('selection', mT.cursorPosInText)
            messages.display()
Example #3
0
    def execute(self):
        c = getSpellChecker()
        c.addToDictionary(self.word)

        mT = archyState.mainText
        oldSel = mT.getSelection('selection')
        mT.setSelection('selection', *self.wordRange)

        self.removeSP = RemoveSpellcheckCommand()
        self.removeSP.execute()

        mT.setSelection('selection', *oldSel)

        foundNext = 0
        pos = mT.getCursorPos()
        start = pos

        while not foundNext and pos < mT.getLength() and abs(pos -
                                                             start) < 2000:
            if mT.behaviorArray.hasAction("SPELLCHECK", pos):
                foundNext = 1
            else:
                pos += 1

        messages.unqueue('persistant')

        if foundNext <> 0:
            mT.setCursor(pos)
            mT.setSelection('selection', mT.cursorPosInText)
            messages.display()
Example #4
0
    def execute(self):
        c = getSpellChecker()
        c.addToDictionary(self.word)

        mT = archyState.mainText
        oldSel = mT.getSelection('selection')
        mT.setSelection('selection', *self.wordRange)
        
        self.removeSP = RemoveSpellcheckCommand()
        self.removeSP.execute()

        mT.setSelection('selection', *oldSel)

        
        foundNext = 0
        pos = mT.getCursorPos()
        start = pos

        while not foundNext and pos < mT.getLength() and abs(pos-start)<2000:
            if mT.behaviorArray.hasAction("SPELLCHECK", pos):
                foundNext = 1
            else:
                pos += 1
        
        messages.unqueue('persistant')

        if foundNext <> 0:
            mT.setCursor(pos)
            mT.setSelection('selection', mT.cursorPosInText)
            messages.display()
Example #5
0
    def execute(self):
        mT = archyState.mainText
        spRange = self.findExtent(mT)

        oldSel = mT.getSelection('selection')

        mT.setSelection('selection', *spRange)
        self.removeSP = RemoveSpellcheckCommand()
        self.removeSP.execute()
        messages.unqueue('persistant')

        mT.setSelection('selection', *oldSel)
Example #6
0
    def execute(self):
        mT = archyState.mainText
        spRange = self.findExtent(mT)

        oldSel = mT.getSelection('selection')

        mT.setSelection('selection', *spRange)
        self.removeSP = RemoveSpellcheckCommand()
        self.removeSP.execute()
        messages.unqueue('persistant')

        mT.setSelection('selection', *oldSel)
Example #7
0
 def onExit(self):
     self.parent.hideWhitespace()
     self.parent.hidePreselection()
     messages.unqueue('leap')
     messages.hide()
     if self.leapCommand.status() == 1:
         archyState.commandHistory.addToHistory(self.leapCommand)
         archyState.commandHistory.setLastCommand(self.leapCommand)
     else:
         self.restoreViewSettings()
         if  self.leapCommand.status() == 0:
             pass
         else:
             messages.queue(self.info, 'instant')
             self.playFailedLeapSound()
Example #8
0
    def execute(self):
        mT = archyState.mainText
    
        self.cursorPos = mT.getCursorPos()
        self.origSel = mT.getSelection('selection')

        pos = mT.textArray.find(self.searchTerm, self.cursorPos)
        if pos < self.searchEnd and pos > 0:
            mT.setSelection('selection', pos, pos+len(self.searchTerm)-1)
            mT.setCursor(pos+len(self.searchTerm))
        else:
            messages.unqueue('persistant')
            archyState.commandMap.unregisterCommand(FindNextCommand())
            archyState.commandMap.unregisterCommand(AcceptReplaceCommand())
            raise commands.AbortCommandException("Last \"%s\" found within selected range." % (self.searchTerm))
Example #9
0
 def execute(self):
     messages.unqueue('persistant')
Example #10
0
 def onAbort(self):
     self.parent.hideWhitespace()
     self.parent.hidePreselection()
     messages.unqueue('command')
     messages.hide()
Example #11
0
 def execute(self):
     messages.unqueue('persistant')
     archyState.commandMap.unregisterCommand(FindNextCommand())
     archyState.commandMap.unregisterCommand(AcceptReplaceCommand())
     archyState.commandMap.unregisterCommand(EndReplaceCommand())
Example #12
0
 def execute(self):
     messages.unqueue('persistant')
     archyState.commandMap.unregisterCommand(FindNextCommand())
     archyState.commandMap.unregisterCommand(AcceptReplaceCommand())
     archyState.commandMap.unregisterCommand(EndReplaceCommand())
Example #13
0
 def execute(self):
     messages.unqueue('persistant')