String 'edit' control. More...
#include <mgui/edit.h>

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 MISTRING & | GetValue () |
| 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 |
String 'edit' control.
| MGUI::CTRL_EDIT_STRING::CTRL_EDIT_STRING | ( | ) |
Constructor.
| virtual MGUI::CTRL_EDIT_STRING::~CTRL_EDIT_STRING | ( | ) | [virtual] |
Destructor.
| void MGUI::CTRL_EDIT_STRING::ClearValue | ( | bool | notify = true |
) |
Clear to empty string.
| 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.
| 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.
| 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.
| 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.
| 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.
| string | String to be validated |
1.6.1