MGUI::CTRL_EDIT_BASE Class Reference

Base class for 'edit' controls. More...

#include <mgui/ctrl.h>

Inheritance diagram for MGUI::CTRL_EDIT_BASE:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void ClearSelection ()
void CopySelection ()
 CTRL_EDIT_BASE ()
void CutSelection ()
CEdit & GetCtrl ()
const bool GetModify () const
void GetSelection (int &nStartChar, int &nEndChar) const
void SetMaxLength (int length)
void SetModify (bool modified=true)
void SetReadOnly (bool ReadOnly=true)
void SetSelection (int StartChar=0, int EndChar=-1, bool NoScroll=true)
void SetValidChars (const MIUNICODE *string, bool invert=false)
 ~CTRL_EDIT_BASE ()

Protected Member Functions

bool CheckValidChars (MISTRING &string) const
void CreateCtrl (LAYOUT_PANE_BASE &ParentPane, int width, int height, bool RightJustify, bool ReadOnly, bool Opaque, bool WidthInPixels, LAYOUT_SIZEALIGN sizealign)
bool GetEditStr (MISTRING &str) const
void NotifyChanged ()
void UpdateCtrl (const MISTRING &string)
virtual void UpdateValue (bool notify=true)

Protected Attributes

MyEdit m_ctrl
bool m_HasValue
bool m_UserEdited

Private Member Functions

virtual void OnActivate ()
virtual void OnChangeValue ()
virtual void OnUserEdit ()

Detailed Description

Base class for 'edit' controls.

Definition at line 1066 of file ctrl.h.


Constructor & Destructor Documentation

MGUI::CTRL_EDIT_BASE::CTRL_EDIT_BASE  ) 
 

Constructor.

MGUI::CTRL_EDIT_BASE::~CTRL_EDIT_BASE  ) 
 

Destructor.


Member Function Documentation

bool MGUI::CTRL_EDIT_BASE::CheckValidChars MISTRING string  )  const [protected]
 

Check that all characters in string are in valid set.

Returns:
'true' if valid, 'false' if not
Parameters:
string  String to be checked

void MGUI::CTRL_EDIT_BASE::ClearSelection  )  [inline]
 

Clear the current selection.

Definition at line 1078 of file ctrl.h.

void MGUI::CTRL_EDIT_BASE::CopySelection  )  [inline]
 

Copy the current selection to the clipboard.

Definition at line 1086 of file ctrl.h.

void MGUI::CTRL_EDIT_BASE::CreateCtrl LAYOUT_PANE_BASE ParentPane,
int  width,
int  height,
bool  RightJustify,
bool  ReadOnly,
bool  Opaque,
bool  WidthInPixels,
LAYOUT_SIZEALIGN  sizealign
[protected]
 

Parameters:
width  Width in 'typical' characters
height  Height in text lines, 0 for single-line edit

void MGUI::CTRL_EDIT_BASE::CutSelection  )  [inline]
 

Cut the current selection to the clipboard.

Definition at line 1094 of file ctrl.h.

CEdit& MGUI::CTRL_EDIT_BASE::GetCtrl  )  [inline]
 

Get reference to MFC control (MFC only).

Definition at line 1103 of file ctrl.h.

bool MGUI::CTRL_EDIT_BASE::GetEditStr MISTRING str  )  const [protected]
 

const bool MGUI::CTRL_EDIT_BASE::GetModify  )  const [inline]
 

Returns true if contents of the edit-control have been modified by user, false if not.

Use SetModify() to reset.

Definition at line 1109 of file ctrl.h.

void MGUI::CTRL_EDIT_BASE::GetSelection int &  nStartChar,
int &  nEndChar
const [inline]
 

Get the current selection of the edit control.

If nStartChar == nEndChar, nothing is selected.

Parameters:
nStartChar  Receives the first character in the current selection
nEndChar  Receives the first non-selected character past the end of the current selection

Definition at line 1120 of file ctrl.h.

void MGUI::CTRL_EDIT_BASE::NotifyChanged  )  [inline, protected]
 

Definition at line 1226 of file ctrl.h.

virtual void MGUI::CTRL_EDIT_BASE::OnActivate  )  [private, virtual]
 

Called when user presses <Enter> in edit control.

virtual void MGUI::CTRL_EDIT_BASE::OnChangeValue  )  [private, virtual]
 

Called when value is changed after validation.

If the user modifies the text in the edit control this will not be called until the control loses "focus".

Reimplemented in MGUI::CTRL_EDIT_OBJECTNAME_T< _CT >, and MGUI::CTRL_EDIT_OBJECTNAME_T< FORM_EDIT_OBJECTNAME >.

virtual void MGUI::CTRL_EDIT_BASE::OnUserEdit  )  [private, virtual]
 

Called when user modifies the text in the edit control.

The actual value does not get updated until the control loses focus or GetValue() is called.

Reimplemented in MGUI::CTRL_EDIT_OBJECTNAME.

void MGUI::CTRL_EDIT_BASE::SetMaxLength int  length  ) 
 

Set the maximim text length in characters.

void MGUI::CTRL_EDIT_BASE::SetModify bool  modified = true  )  [inline]
 

Set or clear the "modified" state of the edit control.

Definition at line 1135 of file ctrl.h.

void MGUI::CTRL_EDIT_BASE::SetReadOnly bool  ReadOnly = true  )  [inline]
 

Set whether value is read-only or not.

Parameters:
ReadOnly  True if read only, false if not

Definition at line 1146 of file ctrl.h.

void MGUI::CTRL_EDIT_BASE::SetSelection int  StartChar = 0,
int  EndChar = -1,
bool  NoScroll = true
[inline]
 

Select range of characters in string.

Parameters:
StartChar  Starting character position in string, 0 for beginning
EndChar  Ending character position, -1 for end of string
NoScroll  Indicates whether to scroll caret into view

Reimplemented in MGUI::CTRL_EDIT_OBJECTNAME.

Definition at line 1157 of file ctrl.h.

void MGUI::CTRL_EDIT_BASE::SetValidChars const MIUNICODE string,
bool  invert = false
 

Set set of 'valid' or 'invalid' characters.

This does not alter the current contents, if any.

Parameters:
string  Characters valid or invalid to enter
invert  Allow all but specified characters

void MGUI::CTRL_EDIT_BASE::UpdateCtrl const MISTRING string  )  [protected]
 

Called internally to update text control from specified string.

virtual void MGUI::CTRL_EDIT_BASE::UpdateValue bool  notify = true  )  [protected, virtual]
 

Called internally to update control-specific data from edit control.

Derived class must call corresponding base class method AFTER performing its own processing.

Reimplemented in MGUI::CTRL_EDIT_OBJECTNAME.


Member Data Documentation

MyEdit MGUI::CTRL_EDIT_BASE::m_ctrl [protected]
 

Definition at line 1196 of file ctrl.h.

bool MGUI::CTRL_EDIT_BASE::m_HasValue [protected]
 

Definition at line 1202 of file ctrl.h.

bool MGUI::CTRL_EDIT_BASE::m_UserEdited [protected]
 

Definition at line 1200 of file ctrl.h.


The documentation for this class was generated from the following file:
Generated on Wed May 31 15:29:47 2006 for TNTsdk by  doxygen 1.3.8-20040913