phoenix_title wx.TextEntry

Common base class for single line text entry fields.

This class is not a control itself, as it doesn’t derive from wx.Window. Instead it is used as a base class by other controls, notably wx.TextCtrl and wx.ComboBox and gathers the methods common to both of them.

Added in version 2.9.0.


class_hierarchy Class Hierarchy

Inheritance diagram for class TextEntry:

sub_classes Known Subclasses

wx.ComboBox, wx.ComboCtrl, wx.SearchCtrl, wx.stc.StyledTextCtrl, wx.TextCtrl


method_summary Methods Summary

AppendText

Appends the text to the end of the text control.

AutoComplete

Call this function to enable auto-completion of the text typed in a single-line text control using the given choices.

AutoCompleteDirectories

Call this function to enable auto-completion of the text using the file system directories.

AutoCompleteFileNames

Call this function to enable auto-completion of the text typed in a single-line text control using all valid file system paths.

CanCopy

Returns True if the selection can be copied to the clipboard.

CanCut

Returns True if the selection can be cut to the clipboard.

CanPaste

Returns True if the contents of the clipboard can be pasted into the text control.

CanRedo

Returns True if there is a redo facility available and the last operation can be redone.

CanUndo

Returns True if there is an undo facility available and the last operation can be undone.

ChangeValue

Sets the new text control value.

Clear

Clears the text in the control.

Copy

Copies the selected text to the clipboard.

Cut

Copies the selected text to the clipboard and removes it from the control.

ForceUpper

Convert all text entered into the control to upper case.

GetHint

Returns the current hint string.

GetInsertionPoint

Returns the insertion point, or cursor, position.

GetLastPosition

Returns the zero based index of the last position in the text control, which is equal to the number of characters in the control.

GetMargins

Returns the margins used by the control.

GetRange

Returns the string containing the text starting in the positions from and up to to in the control.

GetSelection

Gets the current selection span.

GetStringSelection

Gets the text currently selected in the control.

GetValue

Gets the contents of the control.

IsEditable

Returns True if the controls contents may be edited by user (note that it always can be changed by the program).

IsEmpty

Returns True if the control is currently empty.

Paste

Pastes text from the clipboard to the text item.

Redo

If there is a redo facility and the last operation can be redone, redoes the last operation.

Remove

Removes the text starting at the first given position up to (but not including) the character at the last position.

Replace

Replaces the text starting at the first position up to (but not including) the character at the last position with the given text.

SelectAll

Selects all text in the control.

SelectNone

Deselects selected text in the control.

SetEditable

Makes the text item editable or read-only, overriding the wx.TE_READONLY flag.

SetHint

Sets a hint shown in an empty unfocused text control.

SetInsertionPoint

Sets the insertion point at the given position.

SetInsertionPointEnd

Sets the insertion point at the end of the text control.

SetMargins

Attempts to set the control margins.

SetMaxLength

This function sets the maximum number of characters the user can enter into the control.

SetSelection

Selects the text starting at the first position up to (but not including) the character at the last position.

SetValue

Sets the new text control value.

Undo

If there is an undo facility and the last operation can be undone, undoes the last operation.

WriteText

Writes the text into the text control at the current insertion position.


property_summary Properties Summary

Hint

See GetHint and SetHint

InsertionPoint

See GetInsertionPoint and SetInsertionPoint

LastPosition

See GetLastPosition

Margins

See GetMargins and SetMargins

StringSelection

See GetStringSelection

Value

See GetValue and SetValue


api Class API

class wx.TextEntry(object)

Common base class for single line text entry fields.


Methods

AppendText(self, text)

Appends the text to the end of the text control.

Parameters:

text (string) – Text to write to the text control.

Return type:

None

Note

After the text is appended, the insertion point will be at the end of the text control. If this behaviour is not desired, the programmer should use GetInsertionPoint and SetInsertionPoint .

See also

WriteText



AutoComplete(