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 {
  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 PtPoint () const
Key GetKey () const
Flags< ModKey > ModKeys () const
const PtDragMove () const
int WheelMove () const
const std::map< Wnd *, Pt > & DragDropWnds () const
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 69 of file WndEvent.h.


Member Enumeration Documentation

enum GG::WndEvent::EventType

the types of Wnd events.

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

Enumerator:
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 

Definition at line 73 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,
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,
int  ticks,
Timer timer 
)

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


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

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

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 Wed Mar 26 14:35:43 2008 for GG by  doxygen 1.5.2