Events

Any Object derived class has the ability to expose Events within OpenGUI. Events are used heavily throughout OpenGUI to notify Widgets about conditions that may be of interest to them. Many of these events have a default action that is performed to maintain a logically working GUI environment, and in some cases the default event action for one Widget is not necessarily the best course of action for another.

To provide a consistent event system that offers the most flexibility for applications to customize, OpenGUI uses a standardized method of event processing. Every standard event that a Widget receives in OpenGUI, either due to input injection or as the result of another event, is initiated by calling the appropriate event injector. Event injectors only have a single purpose: to build the necessary EventArgs and trigger the event via OpenGUI::Object::triggerEvent(). They have a standard naming convention:

 event<Event Name>(params) 
An example would be eventActivate, which would (as implied) triggers the "Activate" event. Event injectors are just helper functions, and it is perfectly legal to skip this step and use OpenGUI::Object::triggerEvent() directly if you're capable of building the appropriate OpenGUI::EventArgs yourself.

The actual default event actions are handled in the event handlers. These have a standard naming convention as well:

 on<Event Name>(Object* sender,Attach_EventArgs& evtArgs) 
All default actions for events occur within these default event handlers. They are virtual functions so that they can be overridden when the current default action is not the necessary action for a new derived Widget type. It is also legal to override an event handler in a subclass of a Widget just to receive notification of the event without registering another handler, but you should take care to call the existing handler during your override to ensure the previous functionality remains. It is not good practice to call default event handlers directly from outside of a default event handler override, as this would not trigger the calling of any additionally bound handlers.

Events List

The following is a list of all events that OpenGUI supports internally. This does not mean that these are the only events that are possible, as any Widget can define new events that it is willing to accept. This is merely the complete list of events that OpenGUI expects Widgets, Controls, ContainerControls, and Windows to have. Since more specialized Widgets tend to have more events, these events are broken up into smaller lists to illustrate the class hierarchy level where each becomes available.

As the Widget classes become more specific, they also include the events of their base classes.


Widget Events

General

Drawing

Timing

Cursor Input

Text Input

Control Events

ContainerControl Events

Window Events

Cursor Events


Copyright © 2006 OpenGUI | OpenGUI.SF.net
Generated: Sun Sep 9 02:00:20 2007