Example #1
0
 def execute(self):
     self.theStyle = archyState.commandMap.findSystemCommand("Style")
     self.theStyle.setinfo(backgroundColor = (245,245,245), foregroundColor = (200,70,70))
     self.theStyle.execute()
     
     self.theAction = behavior_editing.AddActionCommand("INITIAL DOCUMENT CHARACTER LOCK")
     self.theAction.execute()
Example #2
0
 def execute(self):
     selStart, selEnd = archyState.mainText.getSelection('selection')
     
     self.theStyle = archyState.commandMap.findSystemCommand("Style")
     self.theStyle.setinfo(backgroundColor = (245,245,245), foregroundColor = (200,70,70))
     self.theStyle.execute()
     
     self.theAction = behavior_editing.AddActionCommand("SYSTEM LOCK")
     self.theAction.execute()
Example #3
0
    def execute(self):
        self.origCursor = archyState.mainText.getCursorPos()
        moveOver = 0
        self.history = []

        startPos, endPos = self.findExtent(archyState.mainText)

        if self.origCursor == startPos:
            moveOver = 1
            archyState.mainText.setCursor(startPos)
        else:
            archyState.mainText.setCursor(endPos + 1)

        if moveOver:
            archyState.mainText.setSelection('selection', startPos, startPos)
            theAction = behavior_editing.RemoveActionCommand(
                self.behaviorName())
            addText = archyState.commandMap.findSystemCommand("AddText")
            addText.setinfo(self.newText, self.newTextStyle)
            theStyle = archyState.commandMap.findSystemCommand("Style")
            theStyle.setinfo(backgroundColor=(255, 255, 255),
                             foregroundColor=(0, 0, 0))

            theAction.execute()
            addText.execute()
            theStyle.execute()

            self.history.append(theAction)
            self.history.append(addText)
            self.history.append(theStyle)

            selStart, selEnd = archyState.mainText.getSelection('selection')
            archyState.mainText.setSelection('selection', selEnd + 1,
                                             selEnd + 1)
            self.theAction = behavior_editing.AddActionCommand(
                self.behaviorName())
            self.theAction.execute()
            self.history.append(self.theAction)

            archyState.mainText.setSelection('selection', selStart, selEnd)
        else:
            addText = archyState.commandMap.findSystemCommand("AddText")
            addText.setinfo(self.newText, self.newTextStyle)
            addText.execute()
            self.history.append(addText)
            messages.queue('You cannot type in Locked text.')
            messages.display()
Example #4
0
    def execute(self):
        mT = archyState.mainText
        selRange = mT.getSelection('selection')
        text, style = mT.getStyledText(*selRange)

        import behavior
        storage = PasswordStorage()
        storage.setPassword(text)
        mT.behaviorArray.setStorage("PASSWORD", storage)

        self.delText = archyState.commandMap.findSystemCommand("DeleteText")
        self.addText = archyState.commandMap.findSystemCommand("AddText")
        self.addText.setinfo(len(text) * '*')
        self.theAction = behavior_editing.AddActionCommand("PASSWORD")

        self.delText.execute()
        self.addText.execute()
        self.theAction.execute()
Example #5
0
    def execute(self):
        self.commandList = []

        mT = archyState.mainText
        self.origSel = mT.getSelection('selection')

        text = mT.textArray.getSubString(*self.origSel)
        words, wordRanges = self._findWordsAndRanges(text, self.origSel[0])

        c = getSpellChecker()

        firstWordPos = None
        for word, wordRange in zip(words, wordRanges):
            if c.check(word.lower()) or c.check(word.title()):
                pass
            else:
                mT.setSelection('selection', *wordRange)

                if firstWordPos == None:
                    firstWordPos = wordRange[0]

                styleCommand = archyState.commandMap.findSystemCommand("Style")
                styleCommand.setinfo(backgroundColor=(255, 100, 100))
                styleCommand.execute()
                self.commandList.append(styleCommand)

                storage = SpellcheckStorage()
                storage.setWord(word)
                mT.behaviorArray.setStorage("SPELLCHECK", storage)
                actionCommand = behavior_editing.AddActionCommand("SPELLCHECK")
                actionCommand.execute()
                self.commandList.append(actionCommand)

        if firstWordPos <> None:
            mT.setSelection('selection', firstWordPos, firstWordPos)
            mT.setCursor(firstWordPos)
        else:
            messages.queue('No spelling errors found.')

        self.commandList.reverse()
Example #6
0
    def execute(self):
        selStart, selEnd = archyState.mainText.getSelection('selection')

        self.theAction = behavior_editing.AddActionCommand(
            "FINAL DOCUMENT CHARACTER LOCK")
        self.theAction.execute()