Package pyraf :: Module wutil :: Class FocusController
[hide private]
[frames] | no frames]

Class FocusController

source code

A mediator that allows different components to give responsibility to this class for deciding how to manipulate focus. It is this class that knows what elements are available and where focus should be returned to when asked to restore the previous focus and cursor position. The details of doing it for different windows are encapsulated in descendants of the FocusEntity objects that it contains. Since this is properly a singleton, it is created by the wutil module itself and accessed as an object of wutil

Instance Methods [hide private]
 
__init__(self, termwindow) source code
 
addFocusEntity(self, name, focusEntity) source code
 
removeFocusEntity(self, focusEntityName) source code
 
restoreLast(self) source code
 
setCurrent(self, force=0)
This is to be used in cases where focus has been lost to a window not part of this scheme (dialog boxes for example) and it is desired to return focus to the entity currently considered active.
source code
 
resetFocusHistory(self) source code
 
getCurrentFocusEntity(self)
Return the focus entity that currently has focus.
source code
 
saveCursorPos(self) source code
 
setFocusTo(self, focusTarget, always=0)
focusTarget can be a string or a FocusEntity.
source code
 
getFocusEntity(self, FEName)
See if named Focus Entity is currently registered.
source code
 
focusInFamily(self)
Determine if current focus is within the pyraf family (as defined by self.focusEntities)
source code
 
getCurrentMark(self)
Returns mark that can be used to restore focus to current setting
source code
 
restoreToMark(self, mark)
Restore focus to value at mark
source code
Method Details [hide private]

getCurrentFocusEntity(self)

source code 

Return the focus entity that currently has focus. Return None if focus is not in the focus family

setFocusTo(self, focusTarget, always=0)

source code 

focusTarget can be a string or a FocusEntity. It is possible to give a FocusEntity that is not in focusEntities (so it isn't considered part of the focus family, but is part of the restore chain.)

If always is true, target is added to stack even if it is already the focus (useful for pairs of setFocusTo/restoreLast calls.)

getFocusEntity(self, FEName)

source code 

See if named Focus Entity is currently registered. Return it if it exists, None otherwise