Crazy Eddie's GUI System  0.8.4
CEGUI::Spinner Class Reference

Base class for the Spinner widget. More...

+ Inheritance diagram for CEGUI::Spinner:
+ Collaboration diagram for CEGUI::Spinner:

List of all members.

Public Types

enum  TextInputMode { FloatingPoint, Integer, Hexadecimal, Octal }
 Enumerated type specifying possible input and/or display modes for the spinner. More...

Public Member Functions

 Spinner (const String &type, const String &name)
 Constructor for Spinner objects.
virtual ~Spinner (void)
 Destructor for Spinner objects.
void initialiseComponents (void)
 Initialises the Window based object ready for use.
double getCurrentValue (void) const
 Return the current spinner value.
double getStepSize (void) const
 Return the current step value.
double getMaximumValue (void) const
 Return the current maximum limit value for the Spinner.
double getMinimumValue (void) const
 Return the current minimum limit value for the Spinner.
TextInputMode getTextInputMode (void) const
 Return the current text input / display mode setting.
void setCurrentValue (double value)
 Set the current spinner value.
void setStepSize (double step)
 Set the current step value.
void setMaximumValue (double maxValue)
 Set the spinner maximum value.
void setMinimumValue (double minVaue)
 Set the spinner minimum value.
void setTextInputMode (TextInputMode mode)
 Set the spinner input / display mode.

Static Public Attributes

static const String WidgetTypeName
 Window factory name.
static const String EventNamespace
 Namespace for global events.
static const String EventValueChanged
static const String EventStepChanged
static const String EventMaximumValueChanged
static const String EventMinimumValueChanged
static const String EventTextInputModeChanged
static const String EditboxName
 Widget name for the editbox thumb component.
static const String IncreaseButtonName
 Widget name for the increase button component.
static const String DecreaseButtonName
 Widget name for the decrease button component.

Protected Member Functions

virtual double getValueFromText (void) const
 Returns the numerical representation of the current editbox text.
virtual String getTextFromValue (void) const
 Returns the textual representation of the current spinner value.
PushButtongetIncreaseButton () const
 Return a pointer to the 'increase' PushButtoncomponent widget for this Spinner.
PushButtongetDecreaseButton () const
 Return a pointer to the 'decrease' PushButton component widget for this Spinner.
EditboxgetEditbox () const
 Return a pointer to the Editbox component widget for this Spinner.
virtual void onFontChanged (WindowEventArgs &e)
 Handler called when the window's font is changed.
virtual void onTextChanged (WindowEventArgs &e)
 Handler called when the window's text is changed.
virtual void onActivated (ActivationEventArgs &e)
 Handler called when this window has become the active window.
virtual void onValueChanged (WindowEventArgs &e)
 Method called when the spinner value changes.
virtual void onStepChanged (WindowEventArgs &e)
 Method called when the step value changes.
virtual void onMaximumValueChanged (WindowEventArgs &e)
 Method called when the maximum value setting changes.
virtual void onMinimumValueChanged (WindowEventArgs &e)
 Method called when the minimum value setting changes.
virtual void onTextInputModeChanged (WindowEventArgs &e)
 Method called when the text input/display mode is changed.
bool handleIncreaseButton (const EventArgs &e)
bool handleDecreaseButton (const EventArgs &e)
bool handleEditTextChange (const EventArgs &e)

Protected Attributes

double d_stepSize
 Step size value used y the increase & decrease buttons.
double d_currentValue
 Numerical copy of the text in d_editbox.
double d_maxValue
 Maximum value for spinner.
double d_minValue
 Minimum value for spinner.
TextInputMode d_inputMode
 Current text display/input mode.

Static Protected Attributes

static const String FloatValidator
 Validator regex used for floating point mode.
static const String IntegerValidator
 Validator regex used for decimal integer mode.
static const String HexValidator
 Validator regex used for hexadecimal mode.
static const String OctalValidator
 Validator regex used for octal mode.

Detailed Description

Base class for the Spinner widget.

The spinner widget has a text area where numbers may be entered and two buttons which may be used to increase or decrease the value in the text area by a user specified amount.


Member Enumeration Documentation

Enumerated type specifying possible input and/or display modes for the spinner.

Enumerator:
FloatingPoint 

Floating point decimal.

Integer 

Integer decimal.

Hexadecimal 

Hexadecimal.

Octal 

Octal.


Member Function Documentation

double CEGUI::Spinner::getCurrentValue ( void  ) const

Return the current spinner value.

Returns:
current value of the Spinner.

Return a pointer to the 'decrease' PushButton component widget for this Spinner.

Returns:
Pointer to a PushButton object.
Exceptions:
UnknownObjectExceptionThrown if the 'decrease' PushButton component does not exist.
Editbox* CEGUI::Spinner::getEditbox ( ) const [protected]

Return a pointer to the Editbox component widget for this Spinner.

Returns:
Pointer to a Editbox object.
Exceptions:
UnknownObjectExceptionThrown if the Editbox component does not exist.

Return a pointer to the 'increase' PushButtoncomponent widget for this Spinner.

Returns:
Pointer to a PushButton object.
Exceptions:
UnknownObjectExceptionThrown if the increase PushButton component does not exist.
double CEGUI::Spinner::getMaximumValue ( void  ) const

Return the current maximum limit value for the Spinner.

Returns:
Maximum value that is allowed for the spinner.
double CEGUI::Spinner::getMinimumValue ( void  ) const

Return the current minimum limit value for the Spinner.

Returns:
Minimum value that is allowed for the spinner.
double CEGUI::Spinner::getStepSize ( void  ) const

Return the current step value.

Returns:
Step value. This is the value added to the spinner vaue when the up / down buttons are clicked.
virtual String CEGUI::Spinner::getTextFromValue ( void  ) const [protected, virtual]

Returns the textual representation of the current spinner value.

Returns:
String object that is equivalent to the the numerical value of the spinner.

Return the current text input / display mode setting.

Returns:
One of the TextInputMode enumerated values indicating the current text input and display mode.
virtual double CEGUI::Spinner::getValueFromText ( void  ) const [protected, virtual]

Returns the numerical representation of the current editbox text.

Returns:
double value that is the numerical equivalent of the editbox text.
Exceptions:
InvalidRequestExceptionthrown if the text can not be converted.
void CEGUI::Spinner::initialiseComponents ( void  ) [virtual]

Initialises the Window based object ready for use.

Note:
This must be called for every window created. Normally this is handled automatically by the WindowFactory for each Window type.
Returns:
Nothing

Reimplemented from CEGUI::Window.

virtual void CEGUI::Spinner::onActivated ( ActivationEventArgs e) [protected, virtual]

Handler called when this window has become the active window.

Parameters:
eActivationEventArgs class whose 'otherWindow' field is set to the window that previously was active, or NULL for none.

Reimplemented from CEGUI::Window.

virtual void CEGUI::Spinner::onFontChanged ( WindowEventArgs e) [protected, virtual]

Handler called when the window's font is changed.

Parameters:
eWindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'.

Reimplemented from CEGUI::Window.

virtual void CEGUI::Spinner::onMaximumValueChanged ( WindowEventArgs e) [protected, virtual]

Method called when the maximum value setting changes.

Parameters:
eWindowEventArgs object containing any relevant data.
Returns:
Nothing.
virtual void CEGUI::Spinner::onMinimumValueChanged ( WindowEventArgs e) [protected, virtual]

Method called when the minimum value setting changes.

Parameters:
eWindowEventArgs object containing any relevant data.
Returns:
Nothing.
virtual void CEGUI::Spinner::onStepChanged ( WindowEventArgs e) [protected, virtual]

Method called when the step value changes.

Parameters:
eWindowEventArgs object containing any relevant data.
Returns:
Nothing.
virtual void CEGUI::Spinner::onTextChanged ( WindowEventArgs e) [protected, virtual]

Handler called when the window's text is changed.

Parameters:
eWindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'.

Reimplemented from CEGUI::Window.

virtual void CEGUI::Spinner::onTextInputModeChanged ( WindowEventArgs e) [protected, virtual]

Method called when the text input/display mode is changed.

Parameters:
eWindowEventArgs object containing any relevant data.
Returns:
Nothing.
virtual void CEGUI::Spinner::onValueChanged ( WindowEventArgs e) [protected, virtual]

Method called when the spinner value changes.

Parameters:
eWindowEventArgs object containing any relevant data.
Returns:
Nothing.
void CEGUI::Spinner::setCurrentValue ( double  value)

Set the current spinner value.

Parameters:
valuevalue to be assigned to the Spinner.
Returns:
Nothing.
void CEGUI::Spinner::setMaximumValue ( double  maxValue)

Set the spinner maximum value.

Parameters:
maxValueThe maximum value to be allowed by the spinner.
Returns:
Nothing.
void CEGUI::Spinner::setMinimumValue ( double  minVaue)

Set the spinner minimum value.

Parameters:
minVaueThe minimum value to be allowed by the spinner.
Returns:
Nothing.
void CEGUI::Spinner::setStepSize ( double  step)

Set the current step value.

Parameters:
stepThe value added to be the spinner value when the up / down buttons are clicked.
Returns:
Nothing.

Set the spinner input / display mode.

Parameters:
modeOne of the TextInputMode enumerated values indicating the text input / display mode to be used by the spinner.
Returns:
Nothing.

Member Data Documentation

Event fired when the maximum spinner value is changed. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the Spinner whose maximum value has been changed.

Event fired when the minimum spinner value is changed. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::windows set to the Spinner whose minimum value has been changed.

Event fired when the spinner step value is changed. Handlers area passed a const WindowEventArgs reference with WindowEventArgs::window set to the Spinner whose step value has changed.

Event fired when the spinner text input & display mode is changed. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the Spinner whose text mode has been changed.

Event fired when the spinner current value changes. Handlers are passed a const WindowEventArgs reference with WindowEventArgs::window set to the Spinner whose current value has changed.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends