(new in Rev4.00)
MQSpinBox class manages an input area for integer. It inherits a MQWidgetBase class.
Please refer the inherited class about member functions declared in the inherited class.
Class | |
MQSpinBox | Constructor |
~MQSpinBox | Destructor |
Member functions | |
GetPosition | Get a position value |
SetPosition | Set a position value |
GetMin | Get a minimum value |
SetMin | Set a minimum value |
GetMax | Get a maximum value |
SetMax | Set a maximum value |
GetIncrement | Get an increment value |
SetIncrement | Set an increment value |
GetAlignment | Get an alignment for a text |
SetAlignment | Set an alignment for a text |
GetVisibleColumn | Get a number of columns to display |
SetVisibleColumn | Set a number of columns to display |
GetEnterSelect | Get an automatic text selection on entering mouse |
SetEnterSelect | Set an automatic text selection on entering mouse |
GetEnterKeyDefault | Get a default button procedure by Enter key |
SetEnterKeyDefault | Set a default button procedure by Enter key |
SetFocus | Set a focus |
Events | |
AddChangedEvent | Add an event after finishing to change a value |
AddChangingEvent | Add an event while changing a value |
MQSpinBox::MQSpinBox();
MQSpinBox::MQSpinBox(int id);
It is a constructor.
virtual MQSpinBox::~MQSpinBox();
This method is a destructor. It is defined as a virtual function.
int MQSpinBox::GetPosition();
It returns a current value as integer.
void MQSpinBox::SetPosition(int value);
It specifies a current value as integer.
int MQSpinBox::GetMin();
It returns a minimum value.
void MQSpinBox::SetMin(int value);
It specifies a minimum value.
If the minimum value is larger than the maximum value, the values are swapped and it ensures that the minimum value is always equal or lesser than the maximum value.
int MQSpinBox::GetMax();
It returns a maximum value.
void MQSpinBox::SetMax(int value);
It specifies a maximum value.
If the maximum value is lesser than the minimum value, the values are swapped and it ensures that the minimum value is always equal or lesser than the maximum value.
int MQSpinBox::GetIncrement();
It returns a value to add or subtract when up/down button is clicked.
void MQSpinBox::SetIncrement(int value);
It specifies a value to add or subtract when up/down button is clicked.
MQSpinBox::MQSpinBoxTextAlignment MQSpinBox::GetAlignment();
It returns an alignment for displaying a text.
void MQSpinBox::SetAlignment(MQSpinBoxTextAlignment value);
It specifies an alignment for displaying a text.
int MQSpinBox::GetVisibleColumn();
It returns a number of characters to calculate a proper width.
void MQSpinBox::SetVisibleColumn(int value);
It specifies a number of characters to calculate a proper width.
When LAYOUT_AUTO in MQWidgetBase::SetHorzLayout() is specified, a width is calculated to contain a specified number of characters. However, a width of a character is different with a proportional font, it is not ensured the specified number of characters are always contained in the width.
bool MQSpinBox::GetEnterSelect();
(new in Rev4.64)
It returns whether an automatic text selection is enabled or disabled when a mouse enters this widget.
void MQSpinBox::SetEnterSelect(bool value);
(new in Rev4.64)
It specified whether to enable or disable an automatic text selection when a mouse enters this widget.
bool MQSpinBox::GetEnterKeyDefault();
(new in Rev4.64)
It returns whether to enable a default button by MQButton::SetDefault() or not when Enter key is pressed.
void MQSpinBox::SetEnterKeyDefault(bool value);
(new in Rev4.64)
It specified whether to enable a default button by MQButton::SetDefault() or not when Enter key is pressed.
void MQSpinBox::SetFocus(bool value);
It focuses this widget.
When this widget is focused, keyboard messages are notified to this widget.
When other widget has a focus and 'true' is specified, the focus will move from the widget to this.
template<typename T> void MQSpinBox::AddChangedEvent(T *p, BOOL (T::*f)(MQWidgetBase*, MQDocument), bool prior = false)
It adds events notified when a value has been changed by user's operation.
An event by AddChangingEvent() is invoked when characters are modified by key input, and an event by AddChangedEvent() is invoked when Enter key is pressed or a focus removed by Tab key or a mouse operation.
template<typename T> void MQSpinBox::AddChangingEvent(T *p, BOOL (T::*f)(MQWidgetBase*, MQDocument), bool prior = false)
It adds events notified when a value is changing by user's operation.
An event by AddChangingEvent() is invoked when characters are modified by key input, and an event by AddChangedEvent() is invoked when Enter key is pressed or a focus removed by Tab key or a mouse operation.