MQSpinBox class

(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
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);

id
A widget ID created outside the plug-in

It is a constructor.


virtual MQSpinBox::~MQSpinBox();

This method is a destructor. It is defined as a virtual function.


int MQSpinBox::GetPosition();

Return value
A position value

It returns a current value as integer.


void MQSpinBox::SetPosition(int value);

value
A position value

It specifies a current value as integer.


int MQSpinBox::GetMin();

Return value
A minimum value

It returns a minimum value.


void MQSpinBox::SetMin(int value);

value
A minimum 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();

Return value
A maximum value

It returns a maximum value.


void MQSpinBox::SetMax(int value);

value
A maximum 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();

Return value
An increment value

It returns a value to add or subtract when up/down button is clicked.


void MQSpinBox::SetIncrement(int value);

value
An increment value

It specifies a value to add or subtract when up/down button is clicked.


MQSpinBox::MQSpinBoxTextAlignment MQSpinBox::GetAlignment();

Return value
An alignment for a text
[ALIGN_LEFT] Left
[ALIGN_CENTER] Center
[ALIGN_RIGHT] Right

It returns an alignment for displaying a text.


void MQSpinBox::SetAlignment(MQSpinBoxTextAlignment value);

value
An alignment for a text
[ALIGN_LEFT] Left
[ALIGN_CENTER] Center
[ALIGN_RIGHT] Right

It specifies an alignment for displaying a text.


int MQSpinBox::GetVisibleColumn();

Return value
A number of characters within the width

It returns a number of characters to calculate a proper width.


void MQSpinBox::SetVisibleColumn(int value);

value
A number of characters within the width

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.


void MQSpinBox::SetFocus(bool value);

value
A focus status

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)

p
A widget to notify events
f
A member function to notify events
prior
An order to notify events
[true] Notify first
[false] Notify last

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)

p
A widget to notify events
f
A member function to notify events
prior
An order to notify events
[true] Notify first
[false] Notify last

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.