Simple GUI Library
|
#include <vector>
#include "sml/events/event_dispatching.h"
#include "sml/events/listener_notifier.h"
#include "sml/events/system_events.h"
#include "gui_event.h"
Go to the source code of this file.
Classes | |
class | GuiEventDispatcher |
class | GuiEventDispatchChain |
Functions | |
Sml::Event * | fireEvent (Sml::Event *event) |
Fire the event from the specified. More... | |
The event proccessing is split into several stages.
Capturing phase. /---—\ /---------—\ /---------------—\ | Root | --> | Component1 | --> ... --> | Target component | ---—/ ---------—/ ---------------—/ Dispatcher Dispatcher Dispatcher Filter1 Filter1 Filter1 ... ... ...
FilterN FilterN FilterN
The next stage is moving the event from the root to the target. Each component has its own GuiEventDispatcher which calls filters on the event. A filter can consume the event and then the dispatching proccess terminates (though all of the current dispatcher's filters are called nonetheless).
Bubbling phase. /---—\ /---------—\ /---------------—\ | Root | --> | Component1 | --> ... --> | Target component | ---—/ ---------—/ ---------------—/ Dispatcher Dispatcher Dispatcher Handler1 Handler1 Handler1 ... ... ... HandlerN HandlerN HandlerN
The next stage is moving the event from the target to the root. Here each dispatcher calls handlers on the event. A handler can consume the event and then the dispatching proccess terminates (though all of the current dispatcher's handlers are called nonetheless). Most target components consume the event and the bubbling phase doesn't occur.
Definition in file gui_event_dispatching.h.
Sml::Event * fireEvent | ( | Sml::Event * | event | ) |
Fire the event from the specified.
.
Build a GuiEventDispatchChain from target to the root component and send the event through it.
event |
Definition at line 13 of file gui_event_dispatching.cpp.