MGUI::CTRL_EDIT_NUMBER Class Reference

Number edit control. More...

#include <mgui/edit.h>

Inheritance diagram for MGUI::CTRL_EDIT_NUMBER:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

Number edit control.


Member Enumeration Documentation

Enumerator:
FLAG_Default 
FLAG_ReadOnly 

User cannot change value.

FLAG_Opaque 

Show '*'s for password input.

FLAG_WidthInPixels 

Width specified in pixels.

FLAG_UseFixedWidthFont 

Use a fixed-width font if possible.

FLAG_NoMin 

No minimum value enforced.

FLAG_NoMax 

No maximum value enforced.

FLAG_NoRange 

No range enforcement.

FLAG_NoDefault 

No default specified in creation.

FLAG_AddOne 

Add 1.0 to value shown to user.

FLAG_BlankZero 

Blank the field if value is 0.0.

FLAG_LeftJustify 

Left-justify value, default is to right-justify.

Enumerator:
FORMAT_Decimal 
FORMAT_Exponential 
FORMAT_Latitude 
FORMAT_Longitude 
FORMAT_DegMinSec 

Constructor & Destructor Documentation

MGUI::CTRL_EDIT_NUMBER::CTRL_EDIT_NUMBER (  ) 

Constructor.

virtual MGUI::CTRL_EDIT_NUMBER::~CTRL_EDIT_NUMBER (  )  [virtual]

Destructor.


Member Function Documentation

void MGUI::CTRL_EDIT_NUMBER::ClearValue ( bool  notify = true  ) 

Clear the value.

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

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

Returns:
Allowed 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.

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

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

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

Returns:
'true' if resulted in value being modified, 'false' if not.
Parameters:
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.

Returns:
'true' if resulted in value being modified, 'false' if not.
Parameters:
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.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:35:30 2012 for TNTsdk 2012 by  doxygen 1.6.1