MGUI::CTRL_EDIT_TEXT Class Reference

Multi-line text 'edit' control. More...

#include <mgui/ctrl.h>

Inheritance diagram for MGUI::CTRL_EDIT_TEXT:

Inheritance graph
[legend]
List of all members.

Public Types

enum  FLAGS { FLAG_Default = 0x0000, FLAG_RightJustify = 0x0001, FLAG_ReadOnly = 0x0002, FLAG_WYSIWYG = 0x0004 }

Public Member Functions

bool CanUndo () const
void ClearValue (bool notify=true)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, int width=0, int height=0, FLAGS flags=FLAG_Default, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_FixedHeight)
 CTRL_EDIT_TEXT ()
int GetFirstVisibleLine () const
int GetLineCount () const
int GetLineFromChar (int nIndex=-1) const
int GetLineIndex (int nLine=-1)
int GetLineLength (int nLine=-1)
void GetStyle (TEXTSTYLE &style, int offset=-1) const
const MISTRINGGetValue ()
void HideCursor ()
void LineScroll (int nLines, int nChars=0)
void Paste ()
virtual bool PreTranslateMessageHook (MSG *pMsg)
void SetCursorPos (int line, int col, bool bScroll=true)
void SetCursorPos (int nCharIndex, bool bScroll=true)
void SetFont (const char *faceName, int pointSize)
void SetStyle (const TEXTSTYLE &style, int start, int end)
void SetStyle (const TEXTSTYLE &style)
void SetTabStops (SIMPLE_ARRAY< int > stops)
void SetTabStops (int cxEachStop)
void SetValue (const UNICODE *string, bool notify=true)
void ShowCursor ()
void Undo ()
virtual ~CTRL_EDIT_TEXT ()

Detailed Description

Multi-line text 'edit' control.

Definition at line 2213 of file ctrl.h.


Member Enumeration Documentation

enum MGUI::CTRL_EDIT_TEXT::FLAGS
 

Enumeration values:
FLAG_Default 
FLAG_RightJustify  Right-justify value, default is to left-justify.
FLAG_ReadOnly  User cannot change value.
FLAG_WYSIWYG  Do WYSIWYG editing. Parses {~,,.} codes for text style.

Definition at line 2216 of file ctrl.h.


Constructor & Destructor Documentation

MGUI::CTRL_EDIT_TEXT::CTRL_EDIT_TEXT  ) 
 

Constructor.

virtual MGUI::CTRL_EDIT_TEXT::~CTRL_EDIT_TEXT  )  [virtual]
 

Destructor.


Member Function Documentation

bool MGUI::CTRL_EDIT_TEXT::CanUndo  )  const [inline]
 

Determine if the last edit operation can be undone by a call to the Undo member function.

Definition at line 2232 of file ctrl.h.

void MGUI::CTRL_EDIT_TEXT::ClearValue bool  notify = true  ) 
 

Clear entire control to empty string.

Parameters:
notify  Call OnChangeValue() if control has already been created

void MGUI::CTRL_EDIT_TEXT::Create MGUI::LAYOUT_PANE_BASE ParentPane,
int  width = 0,
int  height = 0,
FLAGS  flags = FLAG_Default,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_FixedHeight
 

Create control.

Parameters:
ParentPane  Parent pane
width  Width in 'typical' characters, minimum if can expand based on sizealign
height  Height lines, minimum if can expand based on sizealign

int MGUI::CTRL_EDIT_TEXT::GetFirstVisibleLine  )  const [inline]
 

Determines the topmost visible line in an edit control.

Returns the zero-based index of the topmost visible line. For single-line edit controls, the return value is 0.

Definition at line 2256 of file ctrl.h.

int MGUI::CTRL_EDIT_TEXT::GetLineCount  )  const [inline]
 

Get the number of lines in the edit control.

Definition at line 2264 of file ctrl.h.

int MGUI::CTRL_EDIT_TEXT::GetLineFromChar int  nIndex = -1  )  const [inline]
 

Retrieves the line number of the line that contains the specified character index.

Returns the zero-based line number of the line containing the character index specified by nIndex. If nIndex is -1, the number of the line that contains the first character of the selection is returned. If there is no selection, the current line number is returned.

Definition at line 2275 of file ctrl.h.

int MGUI::CTRL_EDIT_TEXT::GetLineIndex int  nLine = -1  )  [inline]
 

Retrieves the character index of a line within a multiple-line edit control.

Returns the character index of the line specified in nLine or -1 if the specified line number is greater then the number of lines in the edit control.

Definition at line 2286 of file ctrl.h.

int MGUI::CTRL_EDIT_TEXT::GetLineLength int  nLine = -1  )  [inline]
 

Retrieves the character index of a line within a multiple-line edit control.

Return value is the length (in bytes) of the line specified by nLine. nLine specifies the character index of a character in the line whose length is to be retrieved. If this parameter is -1, the length of the current line (the line that contains the caret) is returned, not including the length of any selected text within the line.

Definition at line 2300 of file ctrl.h.

void MGUI::CTRL_EDIT_TEXT::GetStyle TEXTSTYLE style,
int  offset = -1
const
 

Get the text style at the specified offset No effect unless created with the FLAG_WYSIWYG flag.

Parameters:
offset  Offset to get style at. -1 for style at cursor

const MISTRING& MGUI::CTRL_EDIT_TEXT::GetValue  ) 
 

Get current string value.

void MGUI::CTRL_EDIT_TEXT::HideCursor  )  [inline]
 

Hide the cursor (a.k.a. caret).

Definition at line 2320 of file ctrl.h.

void MGUI::CTRL_EDIT_TEXT::LineScroll int  nLines,
int  nChars = 0
[inline]
 

Scrolls the text of a multiple-line edit control.

Parameters:
nLines  Specifies the number of lines to scroll vertically
nChars  Specifies the number of character positions to scroll horizontally

Definition at line 2328 of file ctrl.h.

void MGUI::CTRL_EDIT_TEXT::Paste  )  [inline]
 

Paste the clipboard contents at the current location.

Definition at line 2338 of file ctrl.h.

virtual bool MGUI::CTRL_EDIT_TEXT::PreTranslateMessageHook MSG *  pMsg  )  [virtual]
 

Called to process messages before translation.

Reimplemented from MGUI::CTRL.

void MGUI::CTRL_EDIT_TEXT::SetCursorPos int  line,
int  col,
bool  bScroll = true
[inline]
 

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

Parameters:
bScroll  True to scroll so cursor is visible in the window.

Definition at line 2359 of file ctrl.h.

void MGUI::CTRL_EDIT_TEXT::SetCursorPos int  nCharIndex,
bool  bScroll = true
 

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

Parameters:
bScroll  True to scroll so cursor is visible in the window.

void MGUI::CTRL_EDIT_TEXT::SetFont const char *  faceName,
int  pointSize
[inline]
 

Set the font for the control (MFC only).

Parameters:
pointSize  in 10ths of a point

Definition at line 2371 of file ctrl.h.

void MGUI::CTRL_EDIT_TEXT::SetStyle const TEXTSTYLE style,
int  start,
int  end
 

Get the text style of a range of text.

No effect unless created with the FLAG_WYSIWYG flag

Parameters:
start  Starting offset to modify
end  Ending offset to modify

void MGUI::CTRL_EDIT_TEXT::SetStyle const TEXTSTYLE style  ) 
 

Get the text style of the current selection, or at the current cursor position (if nothing is selected) No effect unless created with the FLAG_WYSIWYG flag.

void MGUI::CTRL_EDIT_TEXT::SetTabStops SIMPLE_ARRAY< int >  stops  )  [inline]
 

Set variable tab stops.

Call this function to set the tab stops in a multiple-line edit control. When text is copied to a multiple-line edit control, any tab character in the text will cause space to be generated up to the next tab stop. The default is one tab stop every 32 dialog units.

Parameters:
stops  Array of stops

Definition at line 2413 of file ctrl.h.

void MGUI::CTRL_EDIT_TEXT::SetTabStops int  cxEachStop  )  [inline]
 

Set equal tab stops (MFC only); Call this function to set the tab stops in a multiple-line edit control.

When text is copied to a multiple-line edit control, any tab character in the text will cause space to be generated up to the next tab stop. The default is one tab stop every 32 dialog units.

Parameters:
cxEachStop  tab stops are to be set at every cxEachStop dialog units

Definition at line 2402 of file ctrl.h.

void MGUI::CTRL_EDIT_TEXT::SetValue const UNICODE 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

void MGUI::CTRL_EDIT_TEXT::ShowCursor  )  [inline]
 

Show the cursor (a.k.a. caret).

Definition at line 2427 of file ctrl.h.

void MGUI::CTRL_EDIT_TEXT::Undo  )  [inline]
 

Undo the last edit.

Definition at line 2435 of file ctrl.h.


The documentation for this class was generated from the following file:
Generated on Tue Dec 14 13:20:45 2004 for TNTsdk by  doxygen 1.3.8-20040913