Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

pawsKeySelectBox Class Reference

A widget that can be used to select key and display combinations. More...

#include <pawskeyselectbox.h>

List of all members.

Public Member Functions

void Draw ()
 Draws the widget and all of it's children.
virtual int GetBorderStyle ()
 This returns the BORDER_BUMP style.
virtual bool GetFocusOverridesControls () const
 Test if the widget should intercept all key presses.
int GetKey () const
int GetModifiers () const
const char * GetText () const
 Gets a text representation of the key combination.
bool OnKeyDown (utf32_char keyCode, utf32_char keyChar, int modifiers)
 Process keydown messages.
 pawsKeySelectBox ()
 pawsKeySelectBox (const pawsKeySelectBox &origin)
void SetKey (int _key, int _modifiers=0)
 Sets the key for this key select box.
void SetText (const char *keyText)
 Sets the key combination of this text box by parsing a representing key string.
bool Setup (iDocumentNode *node)
 Setup this widget.
virtual ~pawsKeySelectBox ()

Protected Member Functions

void CalcTextPos ()
 Calculates the position of the text after centering.

Protected Attributes

int key
int modifiers
csString text
 String representing the key combination.
int textX
int textY

Detailed Description

A widget that can be used to select key and display combinations.

Definition at line 32 of file pawskeyselectbox.h.


Constructor & Destructor Documentation

pawsKeySelectBox::pawsKeySelectBox ( ) [inline]

Definition at line 35 of file pawskeyselectbox.h.

virtual pawsKeySelectBox::~pawsKeySelectBox ( ) [virtual]
pawsKeySelectBox::pawsKeySelectBox ( const pawsKeySelectBox origin)

Member Function Documentation

void pawsKeySelectBox::CalcTextPos ( ) [protected]

Calculates the position of the text after centering.

void pawsKeySelectBox::Draw ( ) [virtual]

Draws the widget and all of it's children.

Remarks:
Uses clipping rect of it's parent to define drawing area. If the drawing area defined is empty it returns.

Reimplemented from pawsWidget.

virtual int pawsKeySelectBox::GetBorderStyle ( ) [virtual]

This returns the BORDER_BUMP style.

Remarks:
Other styles available include: BORDER_RAISED, BORDER_SUNKEN and BORDER_ETCHED.

Reimplemented from pawsWidget.

virtual bool pawsKeySelectBox::GetFocusOverridesControls ( ) const [inline, virtual]

Test if the widget should intercept all key presses.

Remarks:
False by default, should be true for text entry widgets

Reimplemented from pawsWidget.

Definition at line 74 of file pawskeyselectbox.h.

int pawsKeySelectBox::GetKey ( ) const [inline]

Definition at line 53 of file pawskeyselectbox.h.

int pawsKeySelectBox::GetModifiers ( ) const [inline]

Definition at line 57 of file pawskeyselectbox.h.

const char* pawsKeySelectBox::GetText ( ) const

Gets a text representation of the key combination.

Returns:
A text representation of the key combination of this key select box.
bool pawsKeySelectBox::OnKeyDown ( utf32_char  keyCode,
utf32_char  keyChar,
int  modifiers 
) [virtual]

Process keydown messages.

Parameters:
keyCodeThe code for the pressed key.
keyCharThe key pressed.
modifiersUsed to modify tab behavior.
Returns:
bool TRUE for success FALSE if no action.
Remarks:
If you override this, be sure to also override GetFocusOverridesControls() as returning true

Reimplemented from pawsWidget.

void pawsKeySelectBox::SetKey ( int  _key,
int  _modifiers = 0 
)

Sets the key for this key select box.

Parameters:
_keyThe new key.
_modifiersThe new modifiers.
void pawsKeySelectBox::SetText ( const char *  keyText)

Sets the key combination of this text box by parsing a representing key string.

Parameters:
keyTextThe string representation of the key combination.
bool pawsKeySelectBox::Setup ( iDocumentNode *  ) [virtual]

Setup this widget.

Reimplemented from pawsWidget.


Member Data Documentation

Definition at line 88 of file pawskeyselectbox.h.

Definition at line 89 of file pawskeyselectbox.h.

csString pawsKeySelectBox::text [protected]

String representing the key combination.

Definition at line 86 of file pawskeyselectbox.h.

Definition at line 91 of file pawskeyselectbox.h.

Definition at line 91 of file pawskeyselectbox.h.


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