Esempio n. 1
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 )
Esempio n. 2
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 )