MQDoubleSpinBox class

(new in Rev4.00)

MQDoubleSpinBox class manages an edit for inputting a real number. It inherits a MQWidgetBase class.

Please refer the inherited class about member functions declared in the inherited class.

Class
MQDoubleSpinBox Constructor
~MQDoubleSpinBox 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
GetExponential Get an exponential mode
SetExponential Set an exponential mode
GetMantissa Get a mantissa
SetMantissa Set a mantissa
GetDecimalDigit Get a displaying decimal digit
SetDecimalDigit Set a displaying decimal digit
GetVariableDigit Get a variable decimal digit
SetVariableDigit Set a variable decimal digit
GetAutoDigit Get an automatic decimal digit
SetAutoDigit Set an automatic decimal digit
GetMaxDecimalDigit Get a maximum decimal digit
SetMaxDecimalDigit Set a maximum decimal digit
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
SetDisplayUnit Set a display unit
SetFocus Set a focus
Events
AddChangedEvent Add an event after finishing to change a value
AddChangingEvent Add an event while changing a value

MQDoubleSpinBox::MQDoubleSpinBox();

MQDoubleSpinBox::MQDoubleSpinBox(int id);

id
A widget ID created outside the plug-in

It is a constructor.


virtual MQDoubleSpinBox::~MQDoubleSpinBox();

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


double MQDoubleSpinBox::GetPosition();

Return value
A position value

It returns a current value.


void MQDoubleSpinBox::SetPosition(double value);

value
A position value

It specifies a current value as integer.

The value must be larger than 0 when 'true' is specified in SetExponential().


double MQDoubleSpinBox::GetMin();

Return value
A minimum value

It returns a minimum value.


void MQDoubleSpinBox::SetMin(double 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.

The value must be larger than 0 when 'true' is specified in SetExponential().


double MQDoubleSpinBox::GetMax();

Return value
A maximum value

It returns a maximum value.


void MQDoubleSpinBox::SetMax(double 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.

The value must be larger than 0 when 'true' is specified in SetExponential().


double MQDoubleSpinBox::GetIncrement();

Return value
An increment value

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


void MQDoubleSpinBox::SetIncrement(double value);

value
An increment value

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

The position value will be added or subtract an increment value when 'false' is specified in SetExponential(), and the position value will be multiplied or divided by an increment value when 'true' is specified.


bool MQDoubleSpinBox::GetExponential();

Return value
An exponential mode

It returns how to increment by clicking up/down button.

The position value will be added or subtract an increment value when 'false' is specified, and the position value will be multiplied or divided by an increment value when 'true' is specified.


void MQDoubleSpinBox::SetExponential(bool value);

value
An exponential mode

It specifies how to increment by clicking up/down button.

The position value will be added or subtract an increment value when 'false' is specified, and the position value will be multiplied or divided by an increment value when 'true' is specified.


double MQDoubleSpinBox::GetMantissa();

Return value
A mantissa

It returns a mantissa.

When a mantissa is larger than 0, the position value will be multiply or divided based on it. When a mantissa is 0, the position value will be just multiply or divided to the current position value.

A default mantissa is 0.


void MQDoubleSpinBox::SetMantissa(double value);

value
A mantissa

It returns a mantissa.

When a mantissa is larger than 0, the position value will be multiply or divided based on it. When a mantissa is 0, the position value will be just multiply or divided to the current position value.

A default mantissa is 0.


int MQDoubleSpinBox::GetDecimalDigit();

Return value
A number of displayed decimal digits

It returns a number of displayed decimal digits.


void MQDoubleSpinBox::SetDecimalDigit(int value);

value
A number of displayed decimal digits

It specifies a number of displayed decimal digits.


bool MQDoubleSpinBox::GetVariableDigit();

Return value
A number of decimal digits can be changed

It returns whether a number of decimal digits can be changed or not by user input.


void MQDoubleSpinBox::SetVariableDigit(bool value);

value
A number of decimal digits can be changed

It specifies whether a number of decimal digits can be changed or not by user input.


int MQDoubleSpinBox::GetAutoDigit();

Return value
A number of automatic displayed digits

It returns a number of digits both an integer and decimal part displayed automally.

When an interger part is larger than this number, a decimal part is not shown.


void MQDoubleSpinBox::SetAutoDigit(int value);

value
A number of automatic displayed digits

It specifies a number of digits both an integer and decimal part displayed automally.

When an interger part is larger than this number, a decimal part is not shown.


int MQDoubleSpinBox::GetMaxDecimalDigit();

Return value
A maximum number of decimal digits

It returns a maximum number of decimal digits displayed automatically.


void MQDoubleSpinBox::SetMaxDecimalDigit(int value);

value
A maximum number of decimal digits

It specifies a maximum number of decimal digits displayed automatically.


MQDoubleSpinBox::MQDoubleSpinBoxTextAlignment MQDoubleSpinBox::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 MQDoubleSpinBox::SetAlignment(MQDoubleSpinBoxTextAlignment 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 MQDoubleSpinBox::GetVisibleColumn();

Return value
A number of characters within the width

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


void MQDoubleSpinBox::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 MQDoubleSpinBox::SetDisplayUnit(MQDISPLAYUNIT unit);

unit
Display unit
[MQDISPLAYUNIT_DISABLED] Disabled
[MQDISPLAYUNIT_NONE] None
[MQDISPLAYUNIT_MM] Millimeter
[MQDISPLAYUNIT_CM] Centimeter
[MQDISPLAYUNIT_M] Meter
[MQDISPLAYUNIT_INCH] Inch
[MQDISPLAYUNIT_FEET] Feet

It specifies a display unit for length. If the unit is specified except MQDISPLAYUNIT_DISABLED, the change of the display unit by user will be automatically applied.

The display unit is applied to the displayed number only. It does not affect to the value of GetPosition() or SetPosition().


void MQDoubleSpinBox::SetFocus(bool value);

value
Focus

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 MQDoubleSpinBox::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 MQDoubleSpinBox::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.