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

def textRouter::TextRouter::updateTextBox (   self,
  newText,
  mode = "" 
)

Takes a new piece of text, and adds it to the text box according to the current action mode.

Definition at line 2348 of file textRouter.py.

02348                                                :
        """Takes a new piece of text, and adds it to the text box according to the current action mode."""
        if mode == "":
            mode = self.getInputActionMode()

        ## open new, overwriting existing text in main textbox.
        if mode == "replace":
            self.components.area1.text = newText
            actionStr = "loaded"

        ## apend
        elif mode == "append":
            self.components.area1.text = self.components.area1.text + newText
            actionStr = "appended"

        ## insert
        elif mode == "insert":
            sel = self.components.area1.getSelection()
            pos = self.components.area1.getInsertionPoint()
            #if wx.Platform == "__WXMSW__":
                #str = self.components.area1.text[0:pos]
                #pos = pos - str.count('\n')
            if sel[0] != sel[1]:
                # this make's it act like "normal".  like when you paste in a selection.
                self.components.area1.replaceSelection("")
            self.components.area1.text = self.components.area1.text[0:pos] + \
                                         newText + \
                                         self.components.area1.text[pos:]
            
            actionStr = "inserted"
        return(actionStr)

    def updateTextBoxFromClipboard(self):


Generated by  Doxygen 1.6.0   Back to index