company logo

GUIBaseContext :: doBeforeValueChanged - Pre-event handler for key input events

This event is generated, when the value (text) for a control is going to be changed. This happens, e.g. when entering text in an edit field, when calling setText() or when selecting a list entry in a drop combo box. The Event informs, that something is going to be changed, but says nothing about the type of change.

When the event is fired, the data changed is not yet stored to the property (value) handle, but is available via ControlContext::text() function.

When entering text in an edit field, the event handler is called when leaving the field. In order to get more precise information about typing, keyEvent() might be overloaded, witch is called for each key input action and provides key modifiers, in addition.

The handler should return one of the following values:

  • -1 (not handled) - the event handler will be removed from the handler list and is not called anymore.
  • 1 (refuse) - Requested action will not be executed.
  • 0 (ok) - Action is permitted to be executed.

Implementation details

int32 GUIBaseContext  :: doBeforeValueChanged (  )