|
OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Often, you want to query an edit control to store the entry for later use.
TEdit has a number of querying member functions. Many of the edit control query and modification member functions return, or require you to specify, a line number or a character's position in a line. All of these indexes start at zero. In other words, the first line is line zero and the first character of a line is character zero.
The following table summarizes TEdit's query member functions.
| Member function | Description |
| TEdit::IsModified | Find out if text has changed. |
| TEdit::GetText | Retrieve all text. |
| TEdit::GetLine | Retrieve a line. |
| TEdit::GetNumLines | Get number of lines. |
| TEdit::GetLineLength | Get length of a given line. |
| TEdit::GetSelection | Get index of selected text. |
| TEdit::GetSubText | Get a range of characters. |
| TEdit::GetLineIndex | Count characters before a line. |
| TEdit::GetLineFromPos | Find the line containing an index. |
| TEdit::GetRect | Get formatting rectangle. |
| TEdit::GetHandle | Get memory handle. |
| TEdit::GetFirstVisibleLine | Get index of first visible line. |
| TEdit::GetPasswordChar | Get character used in passwords. |
| TEdit::GetWordBreakProc | Get word-breaking procedure. |
| TEdit::CanUndo | Find out if edit can be undone. |
Text that spans lines in a multiline edit control contains two extra characters for each line break: a carriage return ('\r') and a line feed ('\n'). TEdit's member functions retain the text's formatting when they return text from a multiline edit control. When you insert this text back into an edit control, paste it from the Clipboard, write it to a file, or print it to a printer, the line breaks appear as they did in the edit control. When you use query member functions to get a specified number of characters, be sure to account for the two extra characters in a line break.