#include <gui_event.hpp>
Goals: 1. To isolate programs from the complexities of platform-dependent bindings of mouse and keyboard events to Actions. 2. To simplify event handling in programs by mapping multiple FLTK events to a single Semantic Event (for instance 'Ctrl'+C and 'Ctrl'+'Ins' - > eCopy) 3. To provide uniform and consistent mapping of Events to Actions controlled in one place. 4. To provide workarounds for some deficiencies of FLTK event handling system.
CGUIEvent support two type of Semantic Events - mouse events and shortcuts. Both types of events may emit Signals depending on the current state of modifiers , however, there is a significant difference in a way mapping is declared.
States for mouse events are explicintly declared and registered in CGUIEvent using RegisterState() function. Then it is possible to bind a Signal to a particular mouse Event depending on the current State. States for mouse events represent different GUI modes, user enter a mode by pressing a combination of modifier keys and remains in this mode by holding the keys pressed.
Shortcuts also depend on pressed modifiers, but defining Shortcuts does not require registering special states. RegisterShortcut() function takes a combination of modifiers and an action key. If action key is pressed while specified combination of modifiers is being hold - CGUIEvent generates a Signal corresponding to shortcut. Handling shortcuts does not change current state and so do not interfere with handling of mouse events.
Definition at line 81 of file gui_event.hpp.
Public Types | |
| enum | EGUIState { eDefaultState, eSelectState, eSelectIncState, eSelectExtState, eLast } |
Static Public Member Functions | |
New wxWidgets API | |
| static EGUIState | wxGetSelectState (const wxMouseEvent &event) |
| static EGUIState | wxGetSelectState (const wxKeyEvent &event) |
|
|
Definition at line 106 of file gui_event.hpp. |
|
|
Definition at line 53 of file gui_event.cpp. References eSelectExtState. |
|
1.4.6
Modified on Mon Dec 07 16:23:14 2009 by modify_doxy.py rev. 173732