dtCore::Button Class Reference

Buttons are features with binary state. More...

#include <inputdevice.h>

Inheritance diagram for dtCore::Button:

dtCore::InputDeviceFeature dtCore::LogicalButton

List of all members.

Public Types

typedef std::list
< ButtonListener * > 
ButtonListenerList
 A container of ButtonListeners.

Public Member Functions

 Button (InputDevice *owner, const std::string &description)
 Constructor.
 Button (InputDevice *owner, int symbole, const std::string &description)
 Constructor.
bool SetState (bool state)
 Sets the state of this button.
bool GetState () const
 Returns the current state of this button.
int GetSymbol () const
 Returns the symbole of this button.
void AddButtonListener (ButtonListener *buttonListener)
 Adds a button listener.
void RemoveButtonListener (ButtonListener *buttonListener)
 Removes a button listener.
void InsertButtonListener (const ButtonListenerList::value_type &pos, ButtonListener *bl)
 Inserts the listener into the list at a position BEFORE pos.
const ButtonListenerListGetListeners () const

Protected Member Functions

virtual ~Button ()


Detailed Description

Buttons are features with binary state.

Member Typedef Documentation

typedef std::list<ButtonListener*> dtCore::Button::ButtonListenerList

A container of ButtonListeners.


Constructor & Destructor Documentation

dtCore::Button::Button ( InputDevice owner,
const std::string &  description 
)

Constructor.

Parameters:
owner the owner of this button
description a description of this button

dtCore::Button::Button ( InputDevice owner,
int  symbole,
const std::string &  description 
)

Constructor.

Parameters:
owner the owner of this button
symbole the symbole of this button
description a description of this button

virtual dtCore::Button::~Button (  )  [inline, protected, virtual]


Member Function Documentation

bool dtCore::Button::SetState ( bool  state  ) 

Sets the state of this button.

Parameters:
state the new state
Returns:
The result of the listeners

bool dtCore::Button::GetState (  )  const

Returns the current state of this button.

Returns:
true if this button is pressed, false otherwise

int dtCore::Button::GetSymbol (  )  const

Returns the symbole of this button.

void dtCore::Button::AddButtonListener ( ButtonListener buttonListener  ) 

Adds a button listener.

Parameters:
buttonListener a pointer to the listener to add

void dtCore::Button::RemoveButtonListener ( ButtonListener buttonListener  ) 

Removes a button listener.

Parameters:
buttonListener a pointer to the listener to remove

void dtCore::Button::InsertButtonListener ( const ButtonListenerList::value_type &  pos,
ButtonListener bl 
)

Inserts the listener into the list at a position BEFORE pos.

const ButtonListenerList& dtCore::Button::GetListeners (  )  const [inline]


http://www.delta3d.org
2.0.0 generated 14 Feb 2008