Function SetAppFocus() Foundation
Sets or returns the Xbase Part or window which has input focus.
SetAppFocus( [<oXbp>] ) --> oOldXbp
The return value of SetAppFocus() is the Xbase Part or window which has input focus. If <oXbp> is specified, the function returns the Xbase Part or the window which had input focus before this call to SetAppFocus().
SetAppFocus() determines the Xbase Part or window which has input focus. Only one window or one Xbase Part within a window can have input focus at any time. When a window has input focus, it receives the messages for events produced by the keyboard or the mouse (it processes the keyboard and mouse input). Input focus can be directly changed by specifying an Xbase Part in a call to SetAppFocus().
Xbase++ differentiates between input and output focus. The window in which screen output is shown always has output focus (see the function SetAppWindow()).
Events sent during a focus change
Event | Description |
---|---|
xbeP_KillInputFocus | Previous object lost focus |
xbeP_KillDisplayFocus | Previous object deactivated |
xbeP_SetDisplayFocus | New object activated |
xbeP_SetInputFocus | New object got focus |
Events sent during a focus change
Event | Description |
---|---|
xbeP_KillDisplayFocus | Previous object deactivated |
xbeP_SetDisplayFocus | New object activated |
xbeP_KillInputFocus | Previous object lost focus |
xbeP_SetInputFocus | New object got focus |
If a dialog window is to react to one of these events, callback code blocks must be assigned to the corresponding instance variables :killDisplayFocus:killInputFocus, :setInputFocus or :setDisplayFocus. It is important that a focus change is complete before SetAppFocus() is called again. Interrupting a focus change by calling SetAppFocus() from a callback code block can lead to unpredictable situations. In case the focus must be reset within this sequence of events for any reasons, it is recommended that SetAppFocus() only be called after the xbeP_SetDisplayFocus event is retrieved with AppEvent().
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.