GG::WndEvent Class Reference

Encapsulates a Wnd event that is passed from the singleton GUI to a Wnd. More...

#include <WndEvent.h>

List of all members.

Public Types

enum  EventType

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, boost::uint32_t code_point, Flags< ModKey > mod_keys)
 WndEvent (EventType type, unsigned int ticks, Timer *timer)
 WndEvent (EventType type)
EventType Type () const
const PtPoint () const
Key GetKey () const
boost::uint32_t KeyCodePoint () const
Flags< ModKey > ModKeys () const
const PtDragMove () const
int WheelMove () const
const std::map< Wnd *, Pt > & DragDropWnds () const
unsigned int Ticks () const
TimerGetTimer () const


Detailed Description

Encapsulates a Wnd event that is passed from the singleton GUI to a Wnd.

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

See also:
Wnd

Definition at line 74 of file WndEvent.h.


Member Enumeration Documentation

The types of Wnd events. Each of these corresponds to a Wnd member function of the same name.

Definition at line 79 of file WndEvent.h.


Constructor & Destructor Documentation

GG::WndEvent::WndEvent ( EventType  type,
const Pt pt,
Flags< ModKey >  mod_keys 
)

Constructs an WndEvent that is used to invoke a function taking parameters (const GG::Pt& pt, Flags<ModKey> mod_keys), eg LButtonDown().

GG::WndEvent::WndEvent ( EventType  type,
const Pt pt,
const Pt move,
Flags< ModKey >  mod_keys 
)

Constructs an WndEvent that is used to invoke a function taking parameters (const Pt& pt, const Pt& move, Flags<ModKey> mod_keys), eg LDrag().

GG::WndEvent::WndEvent ( EventType  type,
const Pt pt,
int  move,
Flags< ModKey >  mod_keys 
)

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().

GG::WndEvent::WndEvent ( EventType  type,
Key  key,
boost::uint32_t  code_point,
Flags< ModKey >  mod_keys 
)

Constructs an WndEvent that is used to invoke a function taking parameters (Key key, Flags<ModKey> mod_keys), eg KeyPress().

GG::WndEvent::WndEvent ( EventType  type,
unsigned int  ticks,
Timer timer 
)

Constructs an WndEvent that is used to invoke a function taking parameters (unsigned 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().


Member Function Documentation

EventType GG::WndEvent::Type (  )  const

returns the type of the WndEvent

Referenced by GG::Spin< T >::EventFilter().

const Pt& GG::WndEvent::Point (  )  const

returns the point at which the event took place, if any

Key GG::WndEvent::GetKey (  )  const

returns the key pressed or released in the WndEvent, if any

boost::uint32_t GG::WndEvent::KeyCodePoint (  )  const

returns the Unicode code point for the key pressed or released in the WndEvent, if any.

Note:
This may be zero, even in a KeyPress or KeyRelease event, if Unicode support is unavailable.

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

const std::map<Wnd*, Pt>& GG::WndEvent::DragDropWnds (  )  const

returns the drag-and-drop wnds represented by the WndEvent, if any

unsigned int GG::WndEvent::Ticks (  )  const

returns the number of ticks represented by the WndEvent. if any

Timer* GG::WndEvent::GetTimer (  )  const

returns the Timer represented by the WndEvent. if any


The documentation for this class was generated from the following file:

Generated on Sat Mar 26 07:08:38 2011 for GG by  doxygen 1.5.9