MGUI::CTRL_EDIT_STRING Class Reference

String 'edit' control. More...

#include <mgui/edit.h>

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

List of all members.

Public Types

enum  FLAGS {
  FLAG_Default = CTRL_EDIT_BASE::CREATEFLAG_None, FLAG_RightJustify = CTRL_EDIT_BASE::CREATEFLAG_RightAlign, 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
}

Public Member Functions

 CTRL_EDIT_STRING ()
virtual ~CTRL_EDIT_STRING ()
void ClearValue (bool notify=true)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, int maxlen, int width=0, FLAGS flags=FLAG_Default, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedHeight)
const MISTRINGGetValue ()
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 SetCursorPos (int nCharIndex)
void SetDelegateOnValidate (FastDelegate< bool(MISTRING &)> delegate)
void SetValue (const MIUNICODE *string, bool notify=true)

Private Member Functions

virtual bool v_OnValidate (MISTRING &string) const

Detailed Description

String 'edit' control.


Member Enumeration Documentation

Enumerator:
FLAG_Default 
FLAG_RightJustify 

Right-justify value, default is to left-justify.

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.


Constructor & Destructor Documentation

MGUI::CTRL_EDIT_STRING::CTRL_EDIT_STRING (  ) 

Constructor.

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

Destructor.


Member Function Documentation

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

Clear to empty string.

Parameters:
notify Call OnChangeValue() if control has already been created
void MGUI::CTRL_EDIT_STRING::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
int  maxlen,
int  width = 0,
FLAGS  flags = FLAG_Default,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_FixedHeight 
)

Create control.

Parameters:
ParentPane Parent pane
maxlen Maximum number of characters allowed in string, not including termination
width Width in 'typical' characters, minimum if can expand based on sizealign
const MISTRING& MGUI::CTRL_EDIT_STRING::GetValue (  ) 

Get current string value.

void MGUI::CTRL_EDIT_STRING::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_STRING::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_STRING::SetCursorPos ( int  nCharIndex  ) 

Set the current cursor (a.k.a. caret) location.

void MGUI::CTRL_EDIT_STRING::SetDelegateOnValidate ( FastDelegate< bool(MISTRING &)>  delegate  )  [inline]

Set delegate to call to perform validation.

void MGUI::CTRL_EDIT_STRING::SetValue ( const MIUNICODE string,
bool  notify = true 
)

Set current string value with validation.

OnValidate() will be called and if valid, the string will be updated. No comparison is made with the current string value.

Parameters:
string New string to set
notify Call OnChangeValue() if string actually updated
virtual bool MGUI::CTRL_EDIT_STRING::v_OnValidate ( MISTRING string  )  const [private, virtual]

Validate the string and alter if possible/necessary.

Returns:
'true' if string could be validated, 'false' if not
Parameters:
string String to be validated

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

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