#include <WndEvent.h>
Public Types | |
enum | EventType { LButtonDown, LDrag, LButtonUp, LClick, LDoubleClick, MButtonDown, MDrag, MButtonUp, MClick, MDoubleClick, RButtonDown, RDrag, RButtonUp, RClick, RDoubleClick, MouseEnter, MouseHere, MouseLeave, MouseWheel, DragDropEnter, DragDropHere, DragDropLeave, KeyPress, KeyRelease, GainingFocus, LosingFocus, TimerFiring } |
Public Member Functions | |
WndEvent (EventType type, const Pt &pt, Flags< ModKey > mod_keys) | |
WndEvent (EventType type, const Pt &pt, const Pt &move, Flags< ModKey > mod_keys) | |
WndEvent (EventType type, const Pt &pt, int move, Flags< ModKey > mod_keys) | |
WndEvent (EventType type, const Pt &pt, const std::map< Wnd *, Pt > &drag_drop_wnds, Flags< ModKey > mod_keys) | |
WndEvent (EventType type, Key key, Flags< ModKey > mod_keys) | |
WndEvent (EventType type, int ticks, Timer *timer) | |
WndEvent (EventType type) | |
EventType | Type () const |
const Pt & | Point () const |
Key | GetKey () const |
Flags< ModKey > | ModKeys () const |
const Pt & | DragMove () const |
int | WheelMove () const |
const std::map< Wnd *, Pt > & | DragDropWnds () const |
int | Ticks () const |
Timer * | GetTimer () const |
The various types of WndEvents correspond to the various message member functions of Wnd, some of which have different parameterizations. Rather than have a less-efficient but more-easily-extensible hierarchy of WndEvent types, a single WndEvent type exists that has all possible parameters to a Wnd message function call. Therefore, not all of WndEvent's accessors will return sensical results, depending on the WndEventType of the WndEvent. Note that Wnd events may be filtered before they actually reach the target Wnd
Definition at line 69 of file WndEvent.h.
the types of Wnd events.
Each of these corresponds to a Wnd member function of the same name.
Definition at line 73 of file WndEvent.h.
constructs an WndEvent that is used to invoke a function taking parameters (const GG::Pt& pt, Flags<ModKey> mod_keys), eg LButtonDown().
constructs an WndEvent that is used to invoke a function taking parameters (const Pt& pt, const Pt& move, Flags<ModKey> mod_keys), eg LDrag().
constructs an WndEvent that is used to invoke a function taking parameters (const Pt& pt, int move, Flags<ModKey> mod_keys), eg MouseWheel().
GG::WndEvent::WndEvent | ( | EventType | type, | |
const Pt & | pt, | |||
const std::map< Wnd *, Pt > & | drag_drop_wnds, | |||
Flags< ModKey > | mod_keys | |||
) |
constructs an WndEvent that is used to invoke a function taking parameters (const Pt& pt, const std::map<Wnd*, Pt>& drag_drop_wnds, Flags<ModKey> mod_keys), eg DragDropEnter().
constructs an WndEvent that is used to invoke a function taking parameters (Key key, Flags<ModKey> mod_keys), eg KeyPress().
constructs an WndEvent that is used to invoke a function taking parameters (int, Timer*), eg TimerFiring().
GG::WndEvent::WndEvent | ( | EventType | type | ) | [explicit] |
constructs an WndEvent that is used to invoke a function taking no parameters, eg GainingFocus().
EventType GG::WndEvent::Type | ( | ) | const |
const Pt& GG::WndEvent::Point | ( | ) | const |
returns the point at which the event took place, if any
Flags<ModKey> GG::WndEvent::ModKeys | ( | ) | const |
returns the modifiers to the WndEvent's keypress, if any
const Pt& GG::WndEvent::DragMove | ( | ) | const |
returns the amount of drag movement represented by the WndEvent, if any
int GG::WndEvent::WheelMove | ( | ) | const |
returns the ammount of mouse wheel movement represented by the WndEvent, if any
returns the drag-and-drop wnds represented by the WndEvent, if any
int GG::WndEvent::Ticks | ( | ) | const |
returns the number of ticks represented by the WndEvent. if any