wxTextCtrl
generated from ../src/mod_gui/control/textctrl.cppA text control allows text to be displayed and edited. It may be single line or multi-line. section wxTextCtrl_proto Prototype
Constants
Style
| Name | Description |
|---|---|
| PROCESS_ENTER | |
| PROCESS_TAB | |
| MULTILINE | |
| PASSWORD | |
| READONLY | |
| RICH |
Constructor
wxTextCtrl
wxTextCtrl()
wxTextCtrl(Parent,
Id,
Text,
Position = wxDefaultPosition,
Size = wxDefaultSize,
Validator = null)
| Name | Type | Default | Description |
|---|---|---|---|
| Parent | wxWindow | The parent of the text control. | |
| Id | Integer | The unique id | |
| Text | String | The default text | |
| Position | wxPoint | wxDefaultPosition | The position of the control. |
| Size | wxSize | wxDefaultSize | The size of the control. |
| Validator | wxValidator | null |
Constructs a new wxTextCtrl object
Properties
Methods
appendText
appendText(Text)
| Name | Type | Default | Description |
|---|---|---|---|
| Text | String | Text to append |
Appends the text to the text of the control.
clear
clear()
Removes the text.
cut
cut()
Removes the selected text and copies it to the clipboard.
discardEdits
discardEdits()
Resets the modified flag
getLineLength
getLineLength(Line) : Integer
| Name | Type | Default | Description |
|---|---|---|---|
| Line | Integer | The line number |
Returns the length of the given line
getLineText
getLineText(Line) : String
| Name | Type | Default | Description |
|---|---|---|---|
| Line | Integer | The line number |
Returns the text of the given line
loadFile
loadFile(File)
| Name | Type | Default | Description |
|---|---|---|---|
| File | String | The name of a file |
Loads a file into the text control
paste
paste()
Pastes the content of the clipboard in the selection of the text control.
redo
redo()
Tries to redo the last operation
remove
remove(From,
To)
| Name | Type | Default | Description |
|---|---|---|---|
| From | Integer | ||
| To | Integer |
Removes the text between From and To.
replace
replace(From,
To,
Text)
| Name | Type | Default | Description |
|---|---|---|---|
| From | Integer | ||
| To | Integer | ||
| Text | String |
Replaces the text between From and To with the new text
saveFile
saveFile(File) : Boolean
| Name | Type | Default | Description |
|---|---|---|---|
| File | String |
Saves the content of the text control to the given file
setSelection
setSelection(From = 0,
To)
| Name | Type | Default | Description |
|---|---|---|---|
| From | Integer | 0 | When not specified, 0 is used. |
| To | Integer | When not specified, the end position is used. |
Selects the text between From and To.
Events
| onText | Triggered when the text is changed. The argument of the function is wxCommandEvent |
| onTextEnter | Triggered when the enter key is pressed in a single-line text control. The argument of the function is wxCommandEvent |
| onTextURL | A mouse event occurred over an URL in the text control (wxMSW and wxGTK2 only) |
| onTextMaxLen | User tried to enter more text into the control than the limit set by setMaxLength |

© 2002 - 2007 Franky Braem.