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

ButtonHandle Class Reference

A ButtonHandle represents a single button from any device, including keyboard buttons and mouse buttons (but see KeyboardButton and MouseButton). More...

#include <buttonHandle.h>

List of all members.

Public Member Functions

 ButtonHandle ()
 The default constructor must do nothing, because we can't guarantee ordering of static initializers.

 ButtonHandle (const ButtonHandle &copy)
bool operator== (const ButtonHandle &other) const
bool operator!= (const ButtonHandle &other) const
bool operator< (const ButtonHandle &other) const
string get_name () const
 Returns the name of the button.

bool has_ascii_equivalent () const
 Returns true if the button was created with an ASCII equivalent code (e.g.

char get_ascii_equivalent () const
 Returns the character code associated with the button, or '' if no ASCII code was associated.

int get_index () const
 Returns the integer index associated with this ButtonHandle.

void output (ostream &out) const

Static Public Member Functions

ButtonHandle none ()
 Returns a special zero-valued ButtonHandle that is used to indicate no button.


Private Attributes

int _index

Static Private Attributes

ButtonHandle _none

Friends

class ButtonRegistry


Detailed Description

A ButtonHandle represents a single button from any device, including keyboard buttons and mouse buttons (but see KeyboardButton and MouseButton).

Definition at line 38 of file buttonHandle.h.


Constructor & Destructor Documentation

ButtonHandle::ButtonHandle  )  [inline]
 

The default constructor must do nothing, because we can't guarantee ordering of static initializers.

If the constructor tried to initialize its value, it might happen after the value had already been set previously by another static initializer!

Definition at line 40 of file buttonHandle.I.

ButtonHandle::ButtonHandle const ButtonHandle &  copy  )  [inline]
 

Definition at line 51 of file buttonHandle.I.

References _index, and INLINE.


Member Function Documentation

char ButtonHandle::get_ascii_equivalent  )  const [inline]
 

Returns the character code associated with the button, or '' if no ASCII code was associated.

Definition at line 118 of file buttonHandle.I.

int ButtonHandle::get_index  )  const [inline]
 

Returns the integer index associated with this ButtonHandle.

Each different ButtonHandle will have a different index. However, you probably shouldn't be using this method; you should just treat the ButtonHandles as opaque classes. This is provided for the convenience of non-C++ scripting languages to build a hashtable of ButtonHandles.

Definition at line 143 of file buttonHandle.I.

string ButtonHandle::get_name  )  const
 

Returns the name of the button.

Definition at line 38 of file buttonHandle.cxx.

Referenced by PGItem::get_focus_out_prefix(), and ButtonThrower::has_throw_button().

bool ButtonHandle::has_ascii_equivalent  )  const [inline]
 

Returns true if the button was created with an ASCII equivalent code (e.g.

for a standard keyboard button).

Definition at line 103 of file buttonHandle.I.

References _index, and INLINE.

Referenced by operator<().

ButtonHandle ButtonHandle::none  )  [inline, static]
 

Returns a special zero-valued ButtonHandle that is used to indicate no button.

Definition at line 171 of file buttonHandle.I.

Referenced by KeyboardButton::ascii_key(), ClientButtonDevice::ClientButtonDevice(), ButtonRegistry::get_button(), WinGraphicsWindow::handle_keyresume(), wcrGraphicsWindow::handle_mouse_motion(), and ClientButtonDevice::output_buttons().

bool ButtonHandle::operator!= const ButtonHandle &  other  )  const [inline]
 

Definition at line 74 of file buttonHandle.I.

References _index, and INLINE.

bool ButtonHandle::operator< const ButtonHandle &  other  )  const [inline]
 

Definition at line 86 of file buttonHandle.I.

References _index, has_ascii_equivalent(), and INLINE.

bool ButtonHandle::operator== const ButtonHandle &  other  )  const [inline]
 

Definition at line 62 of file buttonHandle.I.

References _index, and INLINE.

void ButtonHandle::output ostream &  out  )  const [inline]
 

Definition at line 156 of file buttonHandle.I.


Friends And Related Function Documentation

friend class ButtonRegistry [friend]
 

Definition at line 62 of file buttonHandle.h.


Member Data Documentation

int ButtonHandle::_index [private]
 

Definition at line 59 of file buttonHandle.h.

Referenced by ButtonHandle(), ButtonRegistry::ButtonRegistry(), has_ascii_equivalent(), operator!=(), operator<(), and operator==().

ButtonHandle ButtonHandle::_none [static, private]
 

Definition at line 26 of file buttonHandle.cxx.


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