[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'StdCtrls' (#lcl)

# TCustomEdit

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TCustomEdit : the base type from which the TEdit Box is derived.

## Declaration

Source position: stdctrls.pp line 685

`type TCustomEdit = class(TWinControl)`
``
`class procedure WSRegisterClass; override;` |  | WSRegisterClass - Register this Class for the current Widget Set
`protected`
`procedure CalculatePreferredSize(); override;` |  | CalculatePreferredSize - find default/preferred height and width
`procedure CreateWnd; override;` |  | CreateWnd - calls inherited CreateWnd, then initialises various properties relevant to the Widget Set in use
`procedure CreateParams(); override;`
`procedure TextChanged; override;` |  | Procedure to deal with changes in text
`procedure Change; virtual;` |  | Change - software emulation of the OnChange event
`procedure DoEnter; override;` |  | DoEnter - sets AutoSelect if required then calls inherited method
`procedure DoExit; override;` |  | DoExit - disables AutoSelect then calls inherited method
`function GetCaretPos; virtual;` |  | GetCaretPos - returns the position of the caret or edit cursor
`function GetReadOnly; virtual;` |  | GetReadOnly - returns the boolean ReadOnly status
`function GetSelLength; virtual;` |  | GetSelLength - returns the length of the selected text
`function GetSelStart; virtual;` |  | GetSelStart - returns the position of the start of the selection
`function GetSelText; virtual;` |  | GetSelText - returns the selected text string
`procedure SetCaretPos(); virtual;` |  | SetCaretPos - specifies the position of the caret or edit cursor
`procedure SetEchoMode(); virtual;` |  | SetEchoMode - specifies the echo mode
`procedure SetReadOnly(); virtual;` |  | SetReadOnly - specifies whether ReadOnly applies
`procedure SetSelLength(); virtual;` |  | SetSelLength - specifies the length for the selected text
`procedure SetSelStart(); virtual;` |  | SetSelStart - specifies the position for the start of selection
`procedure SetSelText(); virtual;` |  | SetSelText - specifies the selected text string
`function ChildClassAllowed(); override;` |  | ChildClassAllowed - returns True if the given child class is permitted
`protected`
`class function GetControlClassDefaultSize; override;` |  | GetControlClassDefaultSize returns its own defaults, overriding inherited values
`protected`
`procedure KeyUpAfterInterface(); override;`
`procedure WMChar(); message;` |  | WMChar - LCL Message signifying a character
`procedure MouseUp(); override;` |  | MouseUp - a procedure that allows the programmer to simulate a mouse button being Up over the control, and initiates the same Action as that associated with the OnMouseUp event
`procedure RealSetText(); override;` |  | Procedure to store text associated with the control in a string
`property AutoSelect: Boolean; [rw]` |  | AutoSelect : if True, the edit control will select all its text when it receives focus or when the Enter key is pressed.
`property AutoSelected: Boolean; [rw]` |  | AutoSelected : if True, indicates that the edit control has just performed an AutoSelect operation
`property ParentColor;` |  | ParentColor - should the control have the same colour as the parent? Default is true
`public`
`constructor Create(); override;` |  | Create - constructor for TCustomEdit: calls inherited Create then initialises style, colour, size and various other local variables
`procedure Clear;` |  | Clear - delete all text
`procedure SelectAll;` |  | SelectAll text, for example in order to copy or delete it
`procedure ClearSelection; virtual;` |  | ClearSelection - delete all characters in selected text
`procedure CopyToClipboard; virtual;` |  | CopyToClipboard - put a copy of the selection on the clipboard, while leaving the original text in place
`procedure CutToClipboard; virtual;` |  | CutToClipboard - remove the selected text from its original location and put it on the clipboard
`procedure PasteFromClipboard; virtual;` |  | PasteFromClipboard - put a copy of the clipboard contents at the current writing position
`procedure Undo; virtual;` |  | Undo the last edit action
`property Alignment: TAlignment; [rw]` |  | Alignment - whether text is left- or right-justified, or centered
`property AutoSize;`
`property BorderStyle;` |  | BorderStyle - none, or single
`property CanUndo: Boolean; [r]` |  | CanUndo - if True, the Undo action is permitted
`property CaretPos: TPoint; [rw]` |  | CaretPos - the position of the Caret indicator in the text
`property CharCase: TEditCharCase; [rw]` |  | CharCase - rules for what case to use (upper or lower) to display text
`property EchoMode: TEchoMode; [rw]` |  | EchoMode - how to echo keypresses on screen: normal (returning the actual character for that key), all upper or lower case, or a masking character as used in entering passwords
`property HideSelection: Boolean; [rw]` |  | HideSelection: hide the selection when control has no focus
`property MaxLength: Integer; [rw]` |  | MaxLength: maximum length allowed for text string
`property Modified: Boolean; [rw]` |  | Whether the text has been modified
`property OnChange: TNotifyEvent; [rw]` |  | OnChange - event handler for any change in text
`property PasswordChar: Char; [rw]` |  | PasswordChar : the character which appears in the Edit box replacing and masking the actual character typed
`property PopupMenu;` |  | PopupMenu - a context-sensitive menu that pops up when the right mouse button is clicked over this control
`property ReadOnly: Boolean; [rw]` |  | ReadOnly - the contents of the edit box may only be read, not written or erased
`property SelLength: Integer; [rw]` |  | SelLength : the length (in characters) of the text that has been selected for editing
`property SelStart: Integer; [rw]` |  | Sel Start: the index of the character from which selection (for editing) begins
`property SelText: String; [rw]` |  | Sel Text : the string within the edit control that has been selected for editing
`property TabOrder;` |  | The place this control occupies in the list of tabs
`property TabStop;` |  | Is the control in the sequence of controls accessed by successive presses of the Tab key?
`property Text;` |  | Text : the character string contained in the Edit Box
`end;`

## Inheritance

`TCustomEdit` |  | TCustomEdit : the base type from which the TEdit Box is derived.
`TWinControl`
`TControl`
`TLCLComponent` |  | TLCLComponent - base class for LCL components
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent`
`TObject`

## Description

TCustomEdit : the base type from which the TEdit Box is derived.

This control deals, for example, with issues such as selection of text sub-strings within the whole text string which are to be edited (cut, pasted, deleted, highlighted etc)

The latest version of this document can be found at lazarus-ccr.sourceforge.net .