Number edit control. More...
#include <mgui/edit.h>

Public Types | |
| enum | FLAGS { FLAG_Default = CTRL_EDIT_BASE::CREATEFLAG_None, FLAG_ReadOnly = CTRL_EDIT_BASE::CREATEFLAG_ReadOnly, FLAG_Opaque = CTRL_EDIT_BASE::CREATEFLAG_Opaque, FLAG_WidthInPixels = CTRL_EDIT_BASE::CREATEFLAG_WidthInPixels, FLAG_UseFixedWidthFont = CTRL_EDIT_BASE::CREATEFLAG_UseFixedWidthFont, FLAG_NoMin = 0x0001, FLAG_NoMax = 0x0002, FLAG_NoRange = 0x0003, FLAG_NoDefault = 0x0004, FLAG_AddOne = 0x0008, FLAG_BlankZero = 0x0020, FLAG_LeftJustify = 0x0080 } |
| enum | FORMAT { FORMAT_Decimal, FORMAT_Exponential, FORMAT_Latitude, FORMAT_Longitude, FORMAT_DegMinSec } |
Public Member Functions | |
| CTRL_EDIT_NUMBER () | |
| virtual | ~CTRL_EDIT_NUMBER () |
| void | ClearValue (bool notify=true) |
| void | Create (MGUI::LAYOUT_PANE_BASE &ParentPane, double dft, double min, double max, int places=0, int width=0, FLAGS flags=FLAG_Default, FORMAT format=FORMAT_Decimal, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedSize) |
| const DOUBLE_RANGE & | GetRange () const |
| double | GetValue () |
| bool | HasValue () |
| void | IniRead (INIHANDLE IniHandle, const char *IniGroup, const char *IniField, bool notify=true) |
| void | IniWrite (INIHANDLE IniHandle, const char *IniGroup, const char *IniField) const |
| void | SetFormat (FORMAT format, int places=-2, bool notify=true) |
| bool | SetRange (double minimum, double maximum, bool notify=true, FLAGS flags=FLAG_Default) |
| bool | SetRange (const DOUBLE_RANGE &range, bool notify=true, FLAGS flags=FLAG_Default) |
| void | SetUnitConversion (const UNITCONV &unitconv) |
| void | SetValue (double value, bool notify=true) |
Number edit control.
| MGUI::CTRL_EDIT_NUMBER::CTRL_EDIT_NUMBER | ( | ) |
Constructor.
| virtual MGUI::CTRL_EDIT_NUMBER::~CTRL_EDIT_NUMBER | ( | ) | [virtual] |
Destructor.
| void MGUI::CTRL_EDIT_NUMBER::ClearValue | ( | bool | notify = true |
) |
Clear the value.
| notify | Call OnChangeValue() if control has already been created |
| void MGUI::CTRL_EDIT_NUMBER::Create | ( | MGUI::LAYOUT_PANE_BASE & | ParentPane, | |
| double | dft, | |||
| double | min, | |||
| double | max, | |||
| int | places = 0, |
|||
| int | width = 0, |
|||
| FLAGS | flags = FLAG_Default, |
|||
| FORMAT | format = FORMAT_Decimal, |
|||
| MGUI::LAYOUT_SIZEALIGN | sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize | |||
| ) |
Create control.
| ParentPane | Parent pane | |
| dft | Default value | |
| min | Minimum value | |
| max | Maximum value | |
| places | Number of decimal places to show, -1 for automatic | |
| width | Width in "characters", 0 to automatically determine based on min/max/places | |
| flags | Flags | |
| format | Format |
| const DOUBLE_RANGE& MGUI::CTRL_EDIT_NUMBER::GetRange | ( | ) | const [inline] |
Get allowed numeric range.
| double MGUI::CTRL_EDIT_NUMBER::GetValue | ( | ) |
Get current value.
| bool MGUI::CTRL_EDIT_NUMBER::HasValue | ( | ) |
Determine if has valid value.
| void MGUI::CTRL_EDIT_NUMBER::IniRead | ( | INIHANDLE | IniHandle, | |
| const char * | IniGroup, | |||
| const char * | IniField, | |||
| bool | notify = true | |||
| ) |
Read value from INI file.
If Create() has already been performed the control's state will be updated.
| IniHandle | Handle to INI file to read from, 0 for default | |
| IniGroup | INI group to read from | |
| IniField | INI field to read from | |
| notify | Call OnChangeValue() if control has already been created |
| void MGUI::CTRL_EDIT_NUMBER::IniWrite | ( | INIHANDLE | IniHandle, | |
| const char * | IniGroup, | |||
| const char * | IniField | |||
| ) | const [inline] |
Write current value to INI file.
| IniHandle | Handle to INI file to read from, 0 for default | |
| IniGroup | INI group to read from | |
| IniField | INI field to read from |
| void MGUI::CTRL_EDIT_NUMBER::SetFormat | ( | FORMAT | format, | |
| int | places = -2, |
|||
| bool | notify = true | |||
| ) |
Set format for showing/entering values.
Setting to Latitude, Longitude or DegMinSec will also adjust range.
| places | Decimal places, -1 for automatic, -2 to leave unchanged |
| bool MGUI::CTRL_EDIT_NUMBER::SetRange | ( | double | minimum, | |
| double | maximum, | |||
| bool | notify = true, |
|||
| FLAGS | flags = FLAG_Default | |||
| ) |
Set allowed range.
| minimum | New minimum value | |
| maximum | New maximum value | |
| notify | Call OnChangeValue() if value adjusted to new range | |
| flags | FLAG_NoMin, FLAG_NoMax, FLAG_NoRange |
| bool MGUI::CTRL_EDIT_NUMBER::SetRange | ( | const DOUBLE_RANGE & | range, | |
| bool | notify = true, |
|||
| FLAGS | flags = FLAG_Default | |||
| ) |
Set allowed range.
| range | New range to set | |
| notify | Call OnChangeValue() if value adjusted to new range | |
| flags | FLAG_NoMin, FLAG_NoMax, FLAG_NoRange |
| void MGUI::CTRL_EDIT_NUMBER::SetUnitConversion | ( | const UNITCONV & | unitconv | ) |
Set unit conversion for displayed value.
| void MGUI::CTRL_EDIT_NUMBER::SetValue | ( | double | value, | |
| bool | notify = true | |||
| ) |
Set current value.
1.6.1