Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

MouseWatcherParameter Class Reference

This is sent along as a parameter to most events generated for a region to indicate the mouse and button state for the event. More...

#include <mouseWatcherParameter.h>

Inheritance diagram for MouseWatcherParameter:

PGMouseWatcherParameter List of all members.

Public Types

enum  Flags { F_has_button = 0x001, F_has_mouse = 0x002, F_is_outside = 0x004, F_has_keycode = 0x008 }

Public Member Functions

 MouseWatcherParameter ()
 MouseWatcherParameter (const MouseWatcherParameter &other)
void operator= (const MouseWatcherParameter &other)
 ~MouseWatcherParameter ()
void set_button (const ButtonHandle &button)
 Sets the mouse or keyboard button that generated this event, if any.

void set_keycode (int keycode)
 Sets the keycode associated with this event, if any.

void set_modifier_buttons (const ModifierButtons &mods)
 Sets the modifier buttons that were being held while this event was generated.

void set_mouse (const LPoint2f &mouse)
 Sets the mouse position that was current at the time the event was generated.

void set_outside (bool flag)
 Sets the state of the "outside" flag.

bool has_button () const
 Returns true if this parameter has an associated mouse or keyboard button, false otherwise.

ButtonHandle get_button () const
 Returns the mouse or keyboard button associated with this event.

bool has_keycode () const
 Returns true if this parameter has an associated keycode, false otherwise.

int get_keycode () const
 Returns the keycode associated with this event.

const ModifierButtonsget_modifier_buttons () const
 Returns the set of modifier buttons that were being held down while the event was generated.

bool has_mouse () const
 Returns true if this parameter has an associated mouse position, false otherwise.

const LPoint2f & get_mouse () const
 Returns the mouse position at the time the event was generated, in the normalized range (-1 ..

bool is_outside () const
 Returns true if the mouse was outside the region at the time the event was generated, false otherwise.

void output (ostream &out) const

Public Attributes

ButtonHandle _button
short _keycode
ModifierButtons _mods
LPoint2f _mouse
int _flags

Detailed Description

This is sent along as a parameter to most events generated for a region to indicate the mouse and button state for the event.

Definition at line 42 of file mouseWatcherParameter.h.


Member Enumeration Documentation

enum MouseWatcherParameter::Flags
 

Enumeration values:
F_has_button 
F_has_mouse 
F_is_outside 
F_has_keycode 

Definition at line 77 of file mouseWatcherParameter.h.


Constructor & Destructor Documentation

MouseWatcherParameter::MouseWatcherParameter  )  [inline]
 

Definition at line 32 of file mouseWatcherParameter.I.

References INLINE.

MouseWatcherParameter::MouseWatcherParameter const MouseWatcherParameter &  other  )  [inline]
 

Definition at line 45 of file mouseWatcherParameter.I.

References _button, _flags, _keycode, _mods, _mouse, and INLINE.

MouseWatcherParameter::~MouseWatcherParameter  )  [inline]
 

Definition at line 80 of file mouseWatcherParameter.I.

References _flags, _keycode, F_has_keycode, and INLINE.


Member Function Documentation

ButtonHandle MouseWatcherParameter::get_button  )  const [inline]
 

Returns the mouse or keyboard button associated with this event.

If has_button(), above, returns false, this returns ButtonHandle::none().

Definition at line 195 of file mouseWatcherParameter.I.

References _flags, and F_has_mouse.

Referenced by PGButton::enter(), PGItem::exit(), and PGButton::exit().

int MouseWatcherParameter::get_keycode  )  const [inline]
 

Returns the keycode associated with this event.

If has_keycode(), above, returns false, this returns 0.

Definition at line 225 of file mouseWatcherParameter.I.

const ModifierButtons & MouseWatcherParameter::get_modifier_buttons  )  const [inline]
 

Returns the set of modifier buttons that were being held down while the event was generated.

Definition at line 240 of file mouseWatcherParameter.I.

const LPoint2f & MouseWatcherParameter::get_mouse  )  const [inline]
 

Returns the mouse position at the time the event was generated, in the normalized range (-1 ..

1). It is valid to call this only if has_mouse() returned true.

Definition at line 272 of file mouseWatcherParameter.I.

bool MouseWatcherParameter::has_button  )  const [inline]
 

Returns true if this parameter has an associated mouse or keyboard button, false otherwise.

Definition at line 178 of file mouseWatcherParameter.I.

References _mods, and INLINE.

bool MouseWatcherParameter::has_keycode  )  const [inline]
 

Returns true if this parameter has an associated keycode, false otherwise.

Definition at line 210 of file mouseWatcherParameter.I.

References _flags, F_is_outside, and INLINE.

bool MouseWatcherParameter::has_mouse  )  const [inline]
 

Returns true if this parameter has an associated mouse position, false otherwise.

Definition at line 255 of file mouseWatcherParameter.I.

bool MouseWatcherParameter::is_outside  )  const [inline]
 

Returns true if the mouse was outside the region at the time the event was generated, false otherwise.

This is only valid for "release" type events.

Definition at line 290 of file mouseWatcherParameter.I.

Referenced by PGButton::exit().

void MouseWatcherParameter::operator= const MouseWatcherParameter &  other  )  [inline]
 

Reimplemented in PGMouseWatcherParameter.

Definition at line 63 of file mouseWatcherParameter.I.

References INLINE.

Referenced by PGMouseWatcherParameter::PGMouseWatcherParameter().

void MouseWatcherParameter::output ostream &  out  )  const
 

Reimplemented in PGMouseWatcherParameter.

Definition at line 33 of file mouseWatcherParameter.cxx.

Referenced by PGMouseWatcherParameter::~PGMouseWatcherParameter().

void MouseWatcherParameter::set_button const ButtonHandle button  )  [inline]
 

Sets the mouse or keyboard button that generated this event, if any.

Definition at line 94 of file mouseWatcherParameter.I.

References _mods, and INLINE.

void MouseWatcherParameter::set_keycode int  keycode  )  [inline]
 

Sets the keycode associated with this event, if any.

Definition at line 108 of file mouseWatcherParameter.I.

References _flags, _mouse, F_has_mouse, and INLINE.

Referenced by MouseWatcher::press().

void MouseWatcherParameter::set_modifier_buttons const ModifierButtons mods  )  [inline]
 

Sets the modifier buttons that were being held while this event was generated.

Definition at line 124 of file mouseWatcherParameter.I.

References _flags, and F_is_outside.

Referenced by MouseWatcher::press().

void MouseWatcherParameter::set_mouse const LPoint2f &  mouse  )  [inline]
 

Sets the mouse position that was current at the time the event was generated.

Definition at line 139 of file mouseWatcherParameter.I.

References _flags, and F_has_button.

Referenced by MouseWatcher::press().

void MouseWatcherParameter::set_outside bool  flag  )  [inline]
 

Sets the state of the "outside" flag.

This is true if the mouse was outside the region at the time the event was generated, false otherwise. This only has meaning for "release" events.

Definition at line 159 of file mouseWatcherParameter.I.

References _flags, F_has_keycode, and INLINE.

Referenced by MouseWatcher::press().


Member Data Documentation

ButtonHandle MouseWatcherParameter::_button
 

Definition at line 72 of file mouseWatcherParameter.h.

Referenced by MouseWatcherParameter().

int MouseWatcherParameter::_flags
 

Definition at line 83 of file mouseWatcherParameter.h.

Referenced by get_button(), has_keycode(), MouseWatcherParameter(), set_keycode(), set_modifier_buttons(), set_mouse(), set_outside(), and ~MouseWatcherParameter().

short MouseWatcherParameter::_keycode
 

Definition at line 73 of file mouseWatcherParameter.h.

Referenced by MouseWatcherParameter(), and ~MouseWatcherParameter().

ModifierButtons MouseWatcherParameter::_mods
 

Definition at line 74 of file mouseWatcherParameter.h.

Referenced by has_button(), MouseWatcherParameter(), and set_button().

LPoint2f MouseWatcherParameter::_mouse
 

Definition at line 75 of file mouseWatcherParameter.h.

Referenced by MouseWatcherParameter(), and set_keycode().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:52:23 2003 for Panda by doxygen1.3