Exemplo n.º 1
0
 def __deleteLineBreak(self,lineIndex):
     text1 = self.getLineText(lineIndex)
     text2 = self.getLineText(lineIndex+1,'')
     self.setLineText(lineIndex, text1+text2)
     self.delLine(lineIndex+1)
 
     return OperateRecord.insertText( (len(text1),lineIndex),self.getSplitedChar() )
Exemplo n.º 2
0
    def __insertTextWithoutLineBreak(self,xyIndexPosTuple,text):        
        xPos,yPos = xyIndexPosTuple
        curLineText = self.getLineText(yPos)
        self.setLineText(yPos, curLineText[0:xPos] + text + curLineText[xPos:len(curLineText)])

        newXYIndexPos = ( len(curLineText[0:xPos] + text) ,yPos)
        operateRecord = OperateRecord.deleteText( (xPos,yPos),len(text) )
        return RetuInfo.info( newXYIndexPos=newXYIndexPos,operateRecord=operateRecord )
Exemplo n.º 3
0
 def __insertLineBreak(self,xyIndexPosTuple):
     xPos,yPos = xyIndexPosTuple
     curLineText = self.getLineText(yPos)
     self.setLineText(yPos,curLineText[0:xPos] )
     self.addLine( yPos + 1,curLineText[xPos:len(curLineText)] )
     
     newXYIndexPos = (0,yPos+1)
     operateRecord = OperateRecord.deleteText( (len(curLineText),yPos),1 )
     return RetuInfo.info( newXYIndexPos=newXYIndexPos,operateRecord=operateRecord )
Exemplo n.º 4
0
    def __deleteText(self,xyIndexPosTuple,length):
        xPos,yPos = xyIndexPosTuple
        operateRecords = []
        
        while len(self.getLineText(yPos))-xPos < length:
            retuRecord = self.__deleteLineBreak(yPos)
            operateRecords.append( retuRecord )
            length -= 1            
        
        curLineText = self.getLineText(yPos)
        self.setLineText( yPos,curLineText[0:xPos]+curLineText[xPos+length:len(curLineText)] )
        operateRecords.append( OperateRecord.insertText( (xPos,yPos),curLineText[xPos:xPos+length] ) )

        return RetuInfo.info( indexPos = xyIndexPosTuple,operateRecords = operateRecords )