Crazy Eddie's GUI System  0.8.4
CEGUI::LinkedEvent Class Reference

LinkedEvent is an Event subclass that provides a mechanism to link or chain Events together, such that when a specified target event is fired, then this event will additionally fire in response. More...

+ Inheritance diagram for CEGUI::LinkedEvent:
+ Collaboration diagram for CEGUI::LinkedEvent:

List of all members.

Public Member Functions

 LinkedEvent (const String &event_name, EventSet *target_event_set)
 Constructor.
void addLinkedTarget (Event &link_target)
 Add a link target for this event. A link target is an event that will trigger this event.

Protected Types

typedef std::vector
< Event::Connection
CEGUI_VECTOR_ALLOC(Event::Connection)> 
LinkedConnections

Protected Member Functions

bool handler (const EventArgs &args)
 LinkedEvent (const LinkedEvent &e)

Protected Attributes

LinkedConnections d_connections
 collection of connection to the linked Events.
const EventSetd_owner
 reference to the event set that we added ourself to

Detailed Description

LinkedEvent is an Event subclass that provides a mechanism to link or chain Events together, such that when a specified target event is fired, then this event will additionally fire in response.

The expected use of this mechanism is for container or compound widgets to be able to expose events of component widgets without needing to provide repetetive boilerplate event forwarding code, and also for scenarios where code is not typically provided (i.e. data based skinning scenarios).

Constructor & Destructor Documentation

CEGUI::LinkedEvent::LinkedEvent ( const String event_name,
EventSet target_event_set 
)

Constructor.

Parameters:
nameString object describing the name that this Event will use.
target_event_setEventSet that the LinkedEvent should add itself to.

Member Function Documentation

void CEGUI::LinkedEvent::addLinkedTarget ( Event link_target)

Add a link target for this event. A link target is an event that will trigger this event.

Parameters:
link_targetReference to an Event that, when fired, will additionally cause this Event to fire.
Note:
Once an event link is established it can not currently be broken without destroying this Event completely.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends