(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);
It is a constructor.
virtual MQDoubleSpinBox::~MQDoubleSpinBox();
This method is a destructor. It is defined as a virtual function.
double MQDoubleSpinBox::GetPosition();
It returns a current value.
void MQDoubleSpinBox::SetPosition(double value);
It specifies a current value as integer.
The value must be larger than 0 when 'true' is specified in SetExponential().
double MQDoubleSpinBox::GetMin();
It returns a minimum value.
void MQDoubleSpinBox::SetMin(double 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();
It returns a maximum value.
void MQDoubleSpinBox::SetMax(double 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();
It returns a value to add or subtract when up/down button is clicked.
void MQDoubleSpinBox::SetIncrement(double 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();
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);
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();
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);
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();
It returns a number of displayed decimal digits.
void MQDoubleSpinBox::SetDecimalDigit(int value);
It specifies a number of displayed decimal digits.
bool MQDoubleSpinBox::GetVariableDigit();
It returns whether a number of decimal digits can be changed or not by user input.
void MQDoubleSpinBox::SetVariableDigit(bool value);
It specifies whether a number of decimal digits can be changed or not by user input.
int MQDoubleSpinBox::GetAutoDigit();
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);
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();
It returns a maximum number of decimal digits displayed automatically.
void MQDoubleSpinBox::SetMaxDecimalDigit(int value);
It specifies a maximum number of decimal digits displayed automatically.
MQDoubleSpinBox::MQDoubleSpinBoxTextAlignment MQDoubleSpinBox::GetAlignment();
It returns an alignment for displaying a text.
void MQDoubleSpinBox::SetAlignment(MQDoubleSpinBoxTextAlignment value);
It specifies an alignment for displaying a text.
int MQDoubleSpinBox::GetVisibleColumn();
It returns a number of characters to calculate a proper width.
void MQDoubleSpinBox::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.
void MQDoubleSpinBox::SetDisplayUnit(MQDISPLAYUNIT unit);
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);
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)
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)
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.