Logo Search packages:      
Sourcecode: pythoncard version File versions  Download package

def textRouter::TextRouter::saveState (   self  ) 

Saves the current text and selection state to the undo history stack.

Definition at line 172 of file textRouter.py.

00172                        :
        """Saves the current text and selection state to the undo history stack."""
        wx.Yield()
        currentText = self.components.area1.text
        currentSel  = self.components.area1.getSelection()
        
        self.undoStack.insert(self.undoStackPos, [ currentText, currentSel ] )

        if self.undoStackPos != 0:
            self.undoStack[0:self.undoStackPos] = []
            self.undoStackPos = 0

        if len(self.undoStack) > (self.generalPrefs["undoHistorySize"]+1):
            self.undoStack[(self.generalPrefs["undoHistorySize"]+1):] = []

        #print "===== SAVE"
        #print "    undoStackPosition %d" % self.undoStackPos
        #print "    stack size %d" % len(self.undoStack)
       
        #print "----- stack:"
        #for state in self.undoStack:
            #print "    Text:" + state[0][0:40]
            #print "    (%d, %d)" % (state[1][0], state[1][1])
            #print ""
            

    def restoreState(self):


Generated by  Doxygen 1.6.0   Back to index