gui::event_receiver Class Reference

Abstract interface for event handling. More...

#include <gui_eventreceiver.hpp>

Inheritance diagram for gui::event_receiver:
gui::frame gui::manager gui::button gui::focus_frame gui::scroll_frame gui::slider gui::status_bar gui::check_button gui::edit_box

List of all members.

Public Member Functions

 event_receiver (event_manager *mManager=nullptr)
 Constructor.
virtual ~event_receiver ()
 Destructor.
virtual void on_event (const event &mEvent)=0
 Called whenever an Event occurs.
virtual void register_event (const std::string &sEventName)
 Enables reaction to an Event.
virtual void unregister_event (const std::string &sEventName)
 Disables reaction to an Event.

Protected Attributes

event_managerpEventManager_

Detailed Description

Abstract interface for event handling.

All classes which should react to some events should inherit from this class.
They will automatically react to Events thanks to the event_manager.

Definition at line 18 of file gui_eventreceiver.hpp.


Constructor & Destructor Documentation

gui::event_receiver::event_receiver ( event_manager mManager = nullptr  )  [explicit]

Constructor.

Definition at line 6 of file gui_eventreceiver.cpp.

gui::event_receiver::~event_receiver (  )  [virtual]

Destructor.

Definition at line 11 of file gui_eventreceiver.cpp.


Member Function Documentation

virtual void gui::event_receiver::on_event ( const event mEvent  )  [pure virtual]

Called whenever an Event occurs.

Parameters:
mEvent The Event which has occured
Note:
Only registered events will cause this function to be called.

Implemented in gui::button, gui::edit_box, gui::frame, gui::manager, and gui::slider.

void gui::event_receiver::register_event ( const std::string &  sEventName  )  [virtual]

Enables reaction to an Event.

Parameters:
sEventName The name of the Event this class should react to

Reimplemented in gui::frame.

Definition at line 17 of file gui_eventreceiver.cpp.

void gui::event_receiver::unregister_event ( const std::string &  sEventName  )  [virtual]

Disables reaction to an Event.

Parameters:
sEventName The name of the Event this class shouldn't react to anymore

Reimplemented in gui::frame.

Definition at line 23 of file gui_eventreceiver.cpp.


Member Data Documentation

Definition at line 49 of file gui_eventreceiver.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Tue Jan 1 21:58:12 2013 for gui by  doxygen 1.6.1