예제 #1
0
 def onAddText(self, newText, startPos):
     # update cursor
     import archy_globals
     insertPos = startPos
     cursor = self.getCursorPos()
     newCursor = archy_globals.updateTextPositionOnAdd(cursor, insertPos, len(newText))
     self.setCursor(newCursor)
예제 #2
0
 def onAddText(self, newText, startPos):
     # update cursor
     import archy_globals
     insertPos = startPos
     cursor = self.getCursorPos()
     newCursor = archy_globals.updateTextPositionOnAdd(
         cursor, insertPos, len(newText))
     self.setCursor(newCursor)
예제 #3
0
    def onAddText(self, newText, startPos):
# Modify the selections, and anchor on an insertion of text.

        import archy_globals
        CursorText.onAddText(self, newText, startPos)
        
        insertPos = startPos
        length = len(newText)
        
        # update selections
        changed = False
        for i in range(len(self.selections)):
            start, end = self.selections[i]
            newStart = archy_globals.updateTextPositionOnAdd(start, insertPos, length)
            newEnd = archy_globals.updateTextPositionOnAdd(end, insertPos, length)
            if newStart <> start or newEnd <> end:
                self.selections[i] = [newStart, newEnd]
                changed = True

        if changed:
            self._on_selections_changed()
예제 #4
0
    def onAddText(self, newText, startPos):
        # Modify the selections, and anchor on an insertion of text.

        import archy_globals
        CursorText.onAddText(self, newText, startPos)

        insertPos = startPos
        length = len(newText)

        # update selections
        changed = False
        for i in range(len(self.selections)):
            start, end = self.selections[i]
            newStart = archy_globals.updateTextPositionOnAdd(
                start, insertPos, length)
            newEnd = archy_globals.updateTextPositionOnAdd(
                end, insertPos, length)
            if newStart <> start or newEnd <> end:
                self.selections[i] = [newStart, newEnd]
                changed = True

        if changed:
            self._on_selections_changed()