Module editableText :: Class EditableText
[hide private]
[frames] | no frames]

Class EditableText

source code

                   object --+        
                            |        
baseObject.AutoPropertyObject --+    
                                |    
      baseObject.ScriptableObject --+
                                    |
                                   EditableText

Provides scripts to report appropriately when moving the caret in editable text fields.
This does not handle the selection change keys.
To have selection changes reported, the object must notify of selection changes.
If the object supports selection but does not notify of selection changes, L{EditableTextWithoutAutoSelectDetection} should be used instead.

If the object notifies of selection changes, the following should be done:
        * When the object gains focus, L{initAutoSelectDetection} must be called.
        * When the object notifies of a possible selection change, L{detectPossibleSelectionChange} must be called.
        * Optionally, if the object notifies of changes to its content, L{hasContentChangedSinceLastSelection} should be set to C{True}.
@ivar hasContentChangedSinceLastSelection: Whether the content has changed since the last selection occurred.
@type hasContentChangedSinceLastSelection: bool

Nested Classes [hide private]

Inherited from baseObject.AutoPropertyObject: __metaclass__

Instance Methods [hide private]
tuple
_hasCaretMoved(self, bookmark, retryInterval=0.01, timeout=0.03)
Waits for the caret to move, for a timeout to elapse, or for a new focus event or script to be queued.
source code
 
_caretScriptPostMovedHelper(self, speakUnit, info=None) source code
 
_caretMovementScriptHelper(self, gesture, unit) source code
 
script_caret_moveByLine(self, gesture) source code
 
script_caret_moveByCharacter(self, gesture) source code
 
script_caret_moveByWord(self, gesture) source code
 
script_caret_moveByParagraph(self, gesture) source code
 
_backspaceScriptHelper(self, unit, gesture) source code
 
script_caret_backspaceCharacter(self, gesture) source code
 
script_caret_backspaceWord(self, gesture) source code
 
script_caret_delete(self, gesture) source code
 
initAutoSelectDetection(self)
Initialise automatic detection of selection changes.
source code
 
detectPossibleSelectionChange(self)
Detects if the selection has been changed, and if so it speaks the change.
source code

Inherited from baseObject.ScriptableObject: __init__, bindGesture, bindGestures, clearGestureBindings, getScript

Inherited from baseObject.AutoPropertyObject: invalidateCache

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from baseObject.AutoPropertyObject: invalidateCaches

Class Variables [hide private]
  shouldFireCaretMovementFailedEvents = False
  __gestures = {"kb:upArrow": "caret_moveByLine", "kb:downArrow"...

Inherited from baseObject.AutoPropertyObject: cachePropertiesByDefault

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_hasCaretMoved(self, bookmark, retryInterval=0.01, timeout=0.03)

source code 

Waits for the caret to move, for a timeout to elapse, or for a new focus event or script to be queued.

Parameters:
  • bookmark (bookmark) - a bookmark representing the position of the caret before it was instructed to move
  • retryInterval (float) - the interval of time in seconds this method should wait before checking the caret each time.
  • timeout (float) - the over all amount of time in seconds the method should wait before giving up completely.
Returns: tuple
a tuple containing a boolean denoting whether this method timed out, and a TextInfo representing the old or updated caret position or None if interupted by a script or focus event.

initAutoSelectDetection(self)

source code 

Initialise automatic detection of selection changes. This should be called when the object gains focus.


Class Variable Details [hide private]

__gestures

Value:
{"kb:upArrow": "caret_moveByLine", "kb:downArrow": "caret_moveByLine",\
 "kb:leftArrow": "caret_moveByCharacter", "kb:rightArrow": "caret_move\
ByCharacter", "kb:pageUp": "caret_moveByLine", "kb:pageDown": "caret_m\
oveByLine", "kb:control+leftArrow": "caret_moveByWord", "kb:control+ri\
ghtArrow": "caret_moveByWord", "kb:control+upArrow": "caret_moveByPara\
graph", "kb:control+downArrow": "caret_moveByParagraph", "kb:home": "c\
aret_moveByCharacter", "kb:end": "caret_moveByCharacter", "kb:control+\
home": "caret_moveByLine", "kb:control+end": "caret_moveByLine", "kb:d\
...