company logo

GUIBaseContext :: doBeforeLeave - Pre-event handler before control looses focus

The handler is called when a control is about to loose focus (GEV_Leave event). You may overload the handler in order to refresh control content. The handler should not be used for passing focus to other elements.

The GEV_Leave event is generated for the control loosing the focus and for all parents in the control hierarchy beginning with the topmost control in the hierarchy. In order to prevent the control from loosing focus, the handler may return an error (true or 1). For handling the case that the control has lost the focus without reacting, the doAfterLeave() handler should be overloaded.

The handler should return one of the following return codes:

  • -1 (not handled) - the event handler will be removed from the handler list and is not called anymore.
  • 1 (stop) - denies the event returning focus to the last active control
  • 0 (ok) - Event handler terminated successfully.
Notes:

Do not explicitly pass the focus to another element, since the system is still going to change focus and changing the focus in this handler may cause problems.

Implementation details

int32 GUIBaseContext  :: doBeforeLeave (  )