📄 ceguispinner.h
字号:
\return
Nothing.
*/
void setMinimumValue(float minVaue);
/*!
\brief
Set the spinner input / display mode.
\param mode
One of the TextInputMode enumerated values indicating the text
input / display mode to be used by the spinner.
\return
Nothing.
*/
void setTextInputMode(TextInputMode mode);
protected:
/*************************************************************************
Constants
*************************************************************************/
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.
/*************************************************************************
Protected Implementation Methods
*************************************************************************/
/*!
\brief
Returns the numerical representation of the current editbox text.
\return
float value that is the numerical equivalent of the editbox text.
\exception InvalidRequestException thrown if the text can not be converted.
*/
virtual float getValueFromText(void) const;
/*!
\brief
Returns the textual representation of the current spinner value.
\return
String object that is equivalent to the the numerical value of the spinner.
*/
virtual String getTextFromValue(void) const;
/*!
\brief
Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.
\param class_name
The class name that is to be checked.
\return
true if this window was inherited from \a class_name. false if not.
*/
virtual bool testClassName_impl(const String& class_name) const
{
if (class_name=="Spinner") return true;
return Window::testClassName_impl(class_name);
}
/*!
\brief
Return a pointer to the 'increase' PushButtoncomponent widget for
this Spinner.
\return
Pointer to a PushButton object.
\exception UnknownObjectException
Thrown if the increase PushButton component does not exist.
*/
PushButton* getIncreaseButton() const;
/*!
\brief
Return a pointer to the 'decrease' PushButton component widget for
this Spinner.
\return
Pointer to a PushButton object.
\exception UnknownObjectException
Thrown if the 'decrease' PushButton component does not exist.
*/
PushButton* getDecreaseButton() const;
/*!
\brief
Return a pointer to the Editbox component widget for this Spinner.
\return
Pointer to a Editbox object.
\exception UnknownObjectException
Thrown if the Editbox component does not exist.
*/
Editbox* getEditbox() const;
/*************************************************************************
Overrides for Event handler methods
*************************************************************************/
virtual void onFontChanged(WindowEventArgs& e);
virtual void onTextChanged(WindowEventArgs& e);
virtual void onActivated(ActivationEventArgs& e);
/*************************************************************************
New Event handler methods
*************************************************************************/
/*!
\brief
Method called when the spinner value changes.
\param e
WindowEventArgs object containing any relevant data.
\return
Nothing.
*/
virtual void onValueChanged(WindowEventArgs& e);
/*!
\brief
Method called when the step value changes.
\param e
WindowEventArgs object containing any relevant data.
\return
Nothing.
*/
virtual void onStepChanged(WindowEventArgs& e);
/*!
\brief
Method called when the maximum value setting changes.
\param e
WindowEventArgs object containing any relevant data.
\return
Nothing.
*/
virtual void onMaximumValueChanged(WindowEventArgs& e);
/*!
\brief
Method called when the minimum value setting changes.
\param e
WindowEventArgs object containing any relevant data.
\return
Nothing.
*/
virtual void onMinimumValueChanged(WindowEventArgs& e);
/*!
\brief
Method called when the text input/display mode is changed.
\param e
WindowEventArgs object containing any relevant data.
\return
Nothing.
*/
virtual void onTextInputModeChanged(WindowEventArgs& e);
/*************************************************************************
Internal event listener methods
*************************************************************************/
bool handleIncreaseButton(const EventArgs& e);
bool handleDecreaseButton(const EventArgs& e);
bool handleEditTextChange(const EventArgs& e);
/*************************************************************************
Data Fields
*************************************************************************/
float d_stepSize; //!< Step size value used y the increase & decrease buttons.
float d_currentValue; //!< Numerical copy of the text in d_editbox.
float d_maxValue; //!< Maximum value for spinner.
float d_minValue; //!< Minimum value for spinner.
TextInputMode d_inputMode; //!< Current text display/input mode.
private:
/*************************************************************************
Static properties for the Spinner widget
*************************************************************************/
static SpinnerProperties::CurrentValue d_currentValueProperty;
static SpinnerProperties::StepSize d_stepSizeProperty;
static SpinnerProperties::MaximumValue d_maxValueProperty;
static SpinnerProperties::MinimumValue d_minValueProperty;
static SpinnerProperties::TextInputMode d_textInputModeProperty;
/*************************************************************************
Private Implementation Methods
*************************************************************************/
/*!
\brief
Adds properties supported by the Spinner class.
\return
Nothing.
*/
void addSpinnerProperties(void);
};
} // End of CEGUI namespace section
#endif // end of guard _CEGUISpinner_h_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -