Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CascadeSpinnerWidget Class Reference

a widget that implements a spinner More...

#include <cascade/widgets/CascadeSpinnerWidget.h>

Inheritance diagram for CascadeSpinnerWidget:

CascadeWidget CascadeWindow CascadeObject List of all members.

Public Types

typedef void() ChoiceChangeCallback (const CascadeSpinnerWidget *pSpinner, const u32 &newChoice, void *pClientData)

Public Member Functions

 CascadeSpinnerWidget ()
virtual ~CascadeSpinnerWidget ()
void SetBitmapHighlight (CascadeBitmap *pBitmap)
void SetBitmapNormal (CascadeBitmap *pBitmap)
void SetTextOptions (const CascadeString *inStringList, u32 nCount)
void RegisterChoiceChangeCallback (ChoiceChangeCallback *pCallback, void *pClientData)
void SetSpinOnSelect (bool bSpinOnSelect)
bool GetSpinOnSelect ()
u32 GetCurrentChoiceIndex () const
bool SetCurrentChoiceIndex (u32 inNewChoiceIndex)
bool SetCurrentChoiceString (const CascadeString &inNewChoiceString)

Protected Member Functions

virtual bool OnKeyDown (u32 nKey)
virtual void OnPaint (CascadeBitmap &bitmap)
 OnNavKey().
virtual bool OnNavKey (u32 nKey, CascadeWindow *&pProposedNewFocusWnd)

Protected Attributes

const CascadeStringm_textChoices
 pProposedNewFocusWnd the proposed window to receive focus
u32 m_nNumChoices
u32 m_nCurrentChoice
CascadeBitmapm_pBitmapHighlight
CascadeBitmapm_pBitmapNormal
ChoiceChangeCallbackm_pCallback
void * m_pClientData
bool m_bSpinOnSelect

Detailed Description

a widget that implements a spinner

Skip the description

CascadeSpinnerWidget is a widget that implements a spinner. It allows the user to choose between multiple text options.


class CascadeSpinnerWidget


Member Typedef Documentation

typedef void() CascadeSpinnerWidget::ChoiceChangeCallback(const CascadeSpinnerWidget *pSpinner, const u32 &newChoice, void *pClientData)
 

Callback function for notification of changes to the selected text choice.

Clients may provide an optional ChoiceChangeCallback io the RegisterChoiceChangeCallbacl() function. Your custom ChoiceChangeCallback will get called whenver the text choice changes.

Parameters:
pSpinner the spinner widget in question
newChoice the index of the string that is now displayed by the spinner
pClientData the void * pClientData passed thru from RegisterChoiceChangeCallback()
See also:
SetTextOptions(), GetCurrentChoiceIndex()


Constructor & Destructor Documentation

CascadeSpinnerWidget::CascadeSpinnerWidget  ) 
 

The CascadeSpinnerWidget constructor - lightweight.

virtual CascadeSpinnerWidget::~CascadeSpinnerWidget  )  [virtual]
 

Destructor.


Member Function Documentation

u32 CascadeSpinnerWidget::GetCurrentChoiceIndex  )  const [inline]
 

Gets the index into the string array of the currently-displayed text choice

call GetCurrentChoiceIndex() to get the index into the string array of the currently-displayed string.

Returns:
The index of the currently-displayed string
See also:
SetTextOptions()

bool CascadeSpinnerWidget::GetSpinOnSelect  )  [inline]
 

determines whether or not the spinner should spin when the select key is pressed

call GetSpinOnSelect() to determine whether or not the spinner is set to spin when the select button is pressed. return whether or not the spinner will spin on select

See also:
SetSpinOnSelect()

virtual bool CascadeSpinnerWidget::OnKeyDown u32  nKey  )  [protected, virtual]
 

key down handler for CascadeSpinnerWidget

The default OnKeyDown handler advances to the next choice in the

Reimplemented from CascadeWindow.

virtual bool CascadeSpinnerWidget::OnNavKey u32  nKey,
CascadeWindow *&  pProposedNewFocusWnd
[protected, virtual]
 

Navigation key handler for CascadeSpinnerWidget

The default implementation proceeds forwards through the list of strings

Reimplemented from CascadeWindow.

virtual void CascadeSpinnerWidget::OnPaint CascadeBitmap bitmap  )  [protected, virtual]
 

OnNavKey().

paint handler for CascadeSpinnerWidget

The default implementation renders the spinner using the appropriate bitmap if it is set, and renders the string in the list that correcponds to the current choice.

Parameters:
bitmap the bitmap to draw on
See also:
SetBitmapNormal(), SetBitmapHighlight()

Reimplemented from CascadeWindow.

void CascadeSpinnerWidget::RegisterChoiceChangeCallback ChoiceChangeCallback pCallback,
void *  pClientData
 

registers an optional choice change callback

call RegisterChoiceChangeCallback() to register an optional callback function which will be called whenever the text choice changes.

Parameters:
pCallback the callback
pClientData a void * that will be passed straight through to pCallback
See also:
ChoiceChangeCallback

void CascadeSpinnerWidget::SetBitmapHighlight CascadeBitmap pBitmap  ) 
 

Set the bitmap to be used when the spinner is selected

call SetBitmapHighlight() to set the bitmap to be used when the spinner has focus.

Parameters:
pBitmap a pointer to the bitmap to be used. It does not cache a local copy of this bitmap
See also:
SetBitmapNormal(), CascadeBitmap

void CascadeSpinnerWidget::SetBitmapNormal CascadeBitmap pBitmap  ) 
 

Set the bitmap to be used when the spinner is not selected

bool CascadeSpinnerWidget::SetCurrentChoiceIndex u32  inNewChoiceIndex  ) 
 

Sets the displayed string to the one at the index inNewChoiceIndex in the array

call SetCurrentChoiceIndex() to set the index into the string array of the currently-displayed string.

Parameters:
inNewChoiceIndex index in the array that indicates the string to be displayed
Returns:
true if it was able to set the string, false otherwise
See also:
SetCurrentChoiceString(), GetCurrentChoiceIndex()

bool CascadeSpinnerWidget::SetCurrentChoiceString const CascadeString inNewChoiceString  ) 
 

Sets the displayed string to the one in the list that matches inNewChoiceString

call SetCurrentChoiceString to set the visible string to inNewChoice string if that string is in the list of strings

Parameters:
inNewChoiceString a string to be found in the list of string and displayed
Returns:
true if it found inNewChoiceString in the list of string options and was able to set the current string to this value, false otherwise
See also:
SetCurrentChoiceIndex(), GetCurrentChoiceIndex()

void CascadeSpinnerWidget::SetSpinOnSelect bool  bSpinOnSelect  )  [inline]
 

sets whether or not the spinner should spin when the select key is pressed

call SetSpinOnSelect() to set whether or not the spinner should spin when the select button is pressed. The default behavior for SpinnerWidgets is that they do spin on select.

Parameters:
bSpinOnSelect whether or not the spinner should spin on select
See also:
GetSpinOnSelect()

void CascadeSpinnerWidget::SetTextOptions const CascadeString inStringList,
u32  nCount
 

Set the value through which the user can scroll


Member Data Documentation

bool CascadeSpinnerWidget::m_bSpinOnSelect [protected]
 

whether or not the spinner will spin when CK_SELECT is pressed

m_bSpinOnSelect is set to true if the spinner should spin on select

u32 CascadeSpinnerWidget::m_nCurrentChoice [protected]
 

the index of the string that is current.

u32 CascadeSpinnerWidget::m_nNumChoices [protected]
 

the number of items in m_textChoices[]

m_nNumChoices is a count of the number of strings in m_textChoices

CascadeBitmap* CascadeSpinnerWidget::m_pBitmapHighlight [protected]
 

the CascadeBitmap that will be rendered when the CascadeSpinnerWidget has focus

m_pBitmapHighlight is a client-owned bitmap that is rendered whenever the CascadeSpinnerWidget has focus.

CascadeBitmap* CascadeSpinnerWidget::m_pBitmapNormal [protected]
 

the CascadeBitmap that will be rendered when the CascadeSpinnerWidget does not have focus

m_pBitmapNormal is a client-owned bitmap that is rendered whenever the CascadeSpinnerWidget does not have focus.

ChoiceChangeCallback* CascadeSpinnerWidget::m_pCallback [protected]
 

the callback that is called whenever m_nCurrentChoice changes

m_pCallback is a client-supplied callback that gets called whenever m_nCurrentChoice changes

void* CascadeSpinnerWidget::m_pClientData [protected]
 

the client-supplied data for m_pCallback

m_pClientData is passed to m_pCallback whenever it is called.

const CascadeString* CascadeSpinnerWidget::m_textChoices [protected]
 

pProposedNewFocusWnd the proposed window to receive focus

the list of strings that the CascadeSpinnerWidget can display

m_textChoices is a client-maintained list of text choices.


The documentation for this class was generated from the following file:
Generated on Sun Jul 24 14:27:20 2005 for Cascade Library by  doxygen 1.4.1