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

TCustomEdit

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

The base class for controls presenting editable text.

Declaration

Source position: stdctrls.pp line 691

type TCustomEdit = class(TWinControl)

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

protected

  procedure CalculatePreferredSize(); override;

  

Override this method to return the preferred height and width.

  procedure CreateWnd; override;

  procedure CreateParams(); override;

  procedure TextChanged; override;

  

Handles changes of the Text property.

  procedure Change; virtual;

  procedure DoEnter; override;

  

Invokes the OnEnter handler, then selects the entire text when AutoSelect is True.

  procedure DoExit; override;

  function GetCaretPos; virtual;

  function GetReadOnly; virtual;

  function GetSelLength; virtual;

  function GetSelStart; virtual;

  function GetSelText; virtual;

  procedure SetCaretPos(); virtual;

  procedure SetEchoMode(); virtual;

  procedure SetReadOnly(); virtual;

  procedure SetSelLength(); virtual;

  procedure SetSelStart(); virtual;

  procedure SetSelText(); virtual;

  function ChildClassAllowed(); override;

  

Returns True if the given class is allowed for child controls.

protected

  class function GetControlClassDefaultSize; override;

protected

  procedure KeyUpAfterInterface(); override;

  procedure WMChar(); message;

  

Handler for message sent by the widget, after it has handled the keypress itself.

  procedure MouseUp(); override;

  

Invokes the OnMouseUp handler.

  procedure RealSetText(); override;

  

Sets the Caption property.

  property AutoSelect: Boolean; [rw]

  

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]

  

True when the text selection was established automatically.

  property ParentColor;

  

If true, the Color of the control will be the same as the one from the Parent. Default is true.

public

  constructor Create(); override;

  procedure Clear;

  

Deletes all text.

  procedure SelectAll;

  

Selects the entire text in the control.

  procedure ClearSelection; virtual;

  

Deletes (removes) the selected text.

  procedure CopyToClipboard; virtual;

  

Copies the selected text into the clipboard.

  procedure CutToClipboard; virtual;

  

Moves the selected text into the clipboard (removes it from the control).

  procedure PasteFromClipboard; virtual;

  

Inserts text from the clipboard at the current position, possibly replacing the selected text.

  procedure Undo; virtual;

  

Reverts the last edit action.

  property Alignment: TAlignment; [rw]

  

The horizontal adjustment of the text - left, right, or centered.

  property AutoSize;

  

Allows to adjust the control to the extent of the contained text.

  property BorderStyle;

  

Allows to show a border (line) around the control,

  property CanUndo: Boolean; [r]

  

Indicates whether recent changes can be reverted.

  property CaretPos: TPoint; [rw]

  

The position of the text cursor.

  property CharCase: TEditCharCase; [rw]

  

Allows to force the text into all upper or lower case.

  property EchoMode: TEchoMode; [rw]

  

Allows to modify the text display, useful for entering passwords.

  property HideSelection: Boolean; [rw]

  

Allows to hide the selection, when the control doesn't have the focus.

  property MaxLength: Integer; [rw]

  

The maximum length of the text; zero for unlimited.

  property Modified: Boolean; [rw]

  

True when the text has changed.

  property OnChange: TNotifyEvent; [rw]

  

Event handler for any change in text.

  property PasswordChar: Char; [rw]

  

Allows to obfuscate the displayed text, showing all characters as PasswordChar.

  property PopupMenu;

  

A context-sensitive menu that pops up when the right mouse button is clicked over this control

  property ReadOnly: Boolean; [rw]

  

Prevents the user from changing the text.

  property SelLength: Integer; [rw]

  

The number of currently selected characters.

  property SelStart: Integer; [rw]

  

The zero-based index of the first character in the selection.

  property SelText: String; [rw]

  

The selected text in the edit box.

  property TabOrder;

  

Determines the sequence of controls, reachable when the user presses the Tab key.

  property TabStop;

  

Allows the user to navigate to this control, by pressing the Tab key.

  property Text;

  

The text in the edit box.

end;

Inheritance

TCustomEdit

  

The base class for controls presenting editable text.

|

TWinControl

  

The base class for controls which can contain other (child) controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components associated with widgets.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent

|

TObject

Description

This class implements various visual attributes of the control and its contained text, as well as simple editing and clipboard operations.

Text attributes (bold, italic...) are not supported.

This page is hosted on Get Lazarus Code and Component Repository at SourceForge.net. Fast, secure and Free Open Source software downloads