MGUI::CTRL_EDIT_TEXT_WYSIWYG Class Reference
Multi-line text 'edit' control.
More...
#include <mgui/wysiwyg.h>
List of all members.
Public Types |
| enum | FLAGS { FLAG_Default = 0x0000,
FLAG_ReadOnly = 0x0001
} |
Public Member Functions |
| | CTRL_EDIT_TEXT_WYSIWYG () |
| virtual | ~CTRL_EDIT_TEXT_WYSIWYG () |
| bool | CanUndo () const |
| void | ClearSelection () |
| void | ClearValue (bool notify=true) |
| void | CopySelection () |
| 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) |
| void | CutSelection () |
| INT32 | GetCursorPos () const |
| int | GetFirstVisibleLine () const |
| int | GetLineCount () const |
| int | GetLineFromChar (int nIndex=-1) const |
| int | GetLineIndex (int nLine=-1) |
| int | GetLineLength (int nLine=-1) |
| bool | GetModify () const |
| void | GetSelection (int &nStartChar, int &nEndChar) const |
| void | GetStyle (TEXTSTYLE &style, int offset=-1) const |
| const MISTRING & | GetValue () const |
| bool | GetWYSIWYG () const |
| void | HideCursor () |
| void | LineScroll (int nLines, int nChars=0) |
| void | Paste () |
| void | SetCursorPos (int line, int col, bool bScroll=true) |
| void | SetCursorPos (int nCharIndex, bool bScroll=true) |
| void | SetDelegateOnChangeValue (DELEGATE_VOID_NOPARMS Delegate) |
| void | SetDelegateOnCursorMotion (DELEGATE_BOOL_INT32 Delegate) |
| void | SetDelegateOnFocus (DELEGATE_VOID_NOPARMS Delegate) |
| void | SetDelegateOnLosingFocus (DELEGATE_VOID_NOPARMS Delegate) |
| void | SetDelegateOnToggleWYSIWYG (DELEGATE_VOID_BOOL Delegate) |
| void | SetDelegateOnUserEdit (DELEGATE_VOID_NOPARMS Delegate) |
| void | SetModify (bool modified=true) |
| void | SetReadOnly (bool ReadOnly=true) |
| void | SetSelection (int start, int end) |
| void | SetStyle (const TEXTSTYLE &style, int start, int end) |
| void | SetStyle (const TEXTSTYLE &style) |
| void | SetValue (const MIUNICODE *string, bool notify=true) |
| void | SetWordWrap (bool bWordWrap=true) |
| void | SetWYSIWYG (bool bvalue) |
| void | ShowCursor () |
| void | Undo () |
Protected Member Functions |
| virtual void | v_OnActivate () |
| virtual void | v_OnChangeValue () |
| virtual void | v_OnUserEdit () |
Detailed Description
Multi-line text 'edit' control.
Member Enumeration Documentation
- Enumerator:
| FLAG_Default |
|
| FLAG_ReadOnly |
User cannot change value.
|
Constructor & Destructor Documentation
| MGUI::CTRL_EDIT_TEXT_WYSIWYG::CTRL_EDIT_TEXT_WYSIWYG |
( |
|
) |
|
| virtual MGUI::CTRL_EDIT_TEXT_WYSIWYG::~CTRL_EDIT_TEXT_WYSIWYG |
( |
|
) |
[virtual] |
Member Function Documentation
| bool MGUI::CTRL_EDIT_TEXT_WYSIWYG::CanUndo |
( |
|
) |
const |
Determine if the last edit operation can be undone by a call to the Undo member function.
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::ClearSelection |
( |
|
) |
|
Clear (delete) the current selection.
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::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_WYSIWYG::CopySelection |
( |
|
) |
|
Copy the current selection to the clipboard.
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 |
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::CutSelection |
( |
|
) |
|
Cut the current selection to the clipboard.
| INT32 MGUI::CTRL_EDIT_TEXT_WYSIWYG::GetCursorPos |
( |
|
) |
const |
Get the cursor position in characters from the start of the text.
| int MGUI::CTRL_EDIT_TEXT_WYSIWYG::GetFirstVisibleLine |
( |
|
) |
const |
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.
| int MGUI::CTRL_EDIT_TEXT_WYSIWYG::GetLineCount |
( |
|
) |
const |
Get the number of lines in the edit control.
| int MGUI::CTRL_EDIT_TEXT_WYSIWYG::GetLineFromChar |
( |
int |
nIndex = -1 |
) |
const |
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.
| int MGUI::CTRL_EDIT_TEXT_WYSIWYG::GetLineIndex |
( |
int |
nLine = -1 |
) |
|
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.
| int MGUI::CTRL_EDIT_TEXT_WYSIWYG::GetLineLength |
( |
int |
nLine = -1 |
) |
|
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.
| bool MGUI::CTRL_EDIT_TEXT_WYSIWYG::GetModify |
( |
|
) |
const |
Returns true if contents of the edit-control have been modified, false if not.
Use SetModify() to reset.
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::GetSelection |
( |
int & |
nStartChar, |
|
|
int & |
nEndChar | |
|
) |
| | const |
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 |
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::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_WYSIWYG::GetValue |
( |
|
) |
const [inline] |
Get current string value.
| bool MGUI::CTRL_EDIT_TEXT_WYSIWYG::GetWYSIWYG |
( |
|
) |
const |
Determine if WYSIWYG editing is on or off.
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::HideCursor |
( |
|
) |
|
Hide the cursor (a.k.a. caret).
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::LineScroll |
( |
int |
nLines, |
|
|
int |
nChars = 0 | |
|
) |
| | |
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 |
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::Paste |
( |
|
) |
|
Paste the clipboard contents at the current location.
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::SetCursorPos |
( |
int |
line, |
|
|
int |
col, |
|
|
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_WYSIWYG::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_WYSIWYG::SetDelegateOnCursorMotion |
( |
DELEGATE_BOOL_INT32 |
Delegate |
) |
[inline] |
Set the delegate to call when the cursor moves.
The delegate will get the new cursor position and should return true to allow the motion, false to disallow it.
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::SetDelegateOnToggleWYSIWYG |
( |
DELEGATE_VOID_BOOL |
Delegate |
) |
[inline] |
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::SetModify |
( |
bool |
modified = true |
) |
|
Set or clear the "modified" state of the edit control.
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::SetReadOnly |
( |
bool |
ReadOnly = true |
) |
|
Set whether value is read-only or not.
- Parameters:
-
| ReadOnly | True if read only, false if not |
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::SetSelection |
( |
int |
start, |
|
|
int |
end | |
|
) |
| | |
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::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_WYSIWYG::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_WYSIWYG::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 |
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::SetWordWrap |
( |
bool |
bWordWrap = true |
) |
|
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::SetWYSIWYG |
( |
bool |
bvalue |
) |
|
Turn WYSIWYG editing on or off.
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::ShowCursor |
( |
|
) |
|
Show the cursor (a.k.a. caret).
| void MGUI::CTRL_EDIT_TEXT_WYSIWYG::Undo |
( |
|
) |
|
| virtual void MGUI::CTRL_EDIT_TEXT_WYSIWYG::v_OnActivate |
( |
|
) |
[protected, virtual] |
| virtual void MGUI::CTRL_EDIT_TEXT_WYSIWYG::v_OnChangeValue |
( |
|
) |
[protected, virtual] |
Called when value is changed after validation.
Derived class must call corresponding base class method BEFORE performing its own processing. If the user modifies the text in the edit control this will not be called until the control loses "focus".
| virtual void MGUI::CTRL_EDIT_TEXT_WYSIWYG::v_OnUserEdit |
( |
|
) |
[protected, virtual] |
Called when user modifies the text in the edit control.
Derived class must call corresponding base class method BEFORE performing its own processing. The actual value does not get updated until the control loses focus or GetValue() is called.
The documentation for this class was generated from the following file: