Sign in Join
FPDoc Onlineexperiment

TCustomEdit class

In unit StdCtrls

The base class for controls presenting editable text.

Declaration

pascal
TCustomEdit = class(TWinControl)

Inheritance

  1. TCustomEdit
  2. TWinControl
  3. TControl
  4. TLCLComponent
  5. TComponent
  6. TPersistent
  7. TObject

Descends from it: TCustomFloatSpinEdit TCustomLabeledEdit TCustomListViewEditor TCustomMaskEdit TCustomMemo TEdit

Description

TCustomEdit is a TWinControl descendant which implements the base class for an edit control presenting a single line of text. TCustomEdit provides properties, methods, and events needed for common editing features in the control, including:

  • Text
  • TextHint
  • Modified
  • ReadOnly
  • MaxLength
  • Clear
  • NumbersOnly
  • CharCase
  • EchoMode
  • PasswordChar
  • AutoSelect
  • SelectAll
  • SelStart
  • SelLength
  • SelText
  • HideSelection
  • ClearSelection
  • CaretPos
  • CopyToClipboard
  • CutToClipboard
  • PasteFromClipboard
  • Undo

Do not create instances of TCustomEdit in an application; use one of the descendent classes like TEdit, TLabeledEdit, TMaskEdit, or TMemo.

See also

Properties

AutoSelectprotectedEnables auto-selection of text when focused.
AutoSelectedprotectedSet to True when the text selection was made automatically.
ParentColorprotectedUses the Color from the Parent control, when enabled.
AlignmentpublicThe horizontal alignment for the text in the control (left, right, or centered).
Layoutpublic
AutoSizepublicAllows automatic adjustment of the size for the control, according to its content.
BorderStylepublicIndicates the line style drawn as a border around the control.
CanUndopublicIndicates whether the last change can be reverted in the control.
CaretPospublicThe position of the editing cursor in the control.
CharCasepublicControls the character case applied to values entered in the control.
EchoModepublicAllows to modify the text display, useful for entering passwords.
EmulatedTextHintStatuspublicStatus for the emulated TextHint in the control.
HideSelectionpublicDetermines if selected text to be hidden when the control does not have focus.
MaxLengthpublicThe maximum length of the value entered in Text, or 0 (zero) for unlimited length.
ModifiedpublicTrue when the value in Text has been changed using the keyboard.
NumbersOnlypublicIndicates if the edit control accepts numeric values only.
Optionspublic
PasswordCharpublicAllows obfuscation of the displayed text, showing all characters as PasswordChar.
PopupMenupublicA context-sensitive menu that pops up when the right mouse button is clicked over this control.
ReadOnlypublicIndicates if the user is prevented from changing the value for the Text in the control.
SelLengthpublicThe number of currently selected UTF-8-encoded characters in the control.
SelStartpublicThe zero-based index for the first UTF-8 character in the current text selection.
SelTextpublicThe currently selected text in the edit box for the control.
TabOrderpublicIndicates the navigation order for the control when the user presses the Tab or Shift+Tab key.
TabStoppublicEnables keyboard navigation using the Tab or Shift+Tab keys.
TextpublicThe text displayed and edited for the control.
TextHintpublicDefault hint text shown when the Text property is empty for the control.

Methods

WSRegisterClassprotectedRegisters this component class with the current WidgetSet.
CanShowEmulatedTextHintprotectedIndicates if the value in TextHint can be displayed in the edit control.
CalculatePreferredSizeprotectedGets the preferred size for a new instance of the class.
CreateParamsprotectedEnsures the required creation parameters are set for handle creation.
InitializeWndprotectedInitializes the window handle for the control.
TextChangedprotectedApplies case conversion (if needed), and updates the editing cursor selection text.
FontChangedprotectedHandles changes to the font used in the control.
ChangeprotectedPerforms actions needed when the text in the control is changed.
DoEnterprotectedSignals the OnEnter event handler, and selects the entire text when AutoSelect is True.
DoExitprotectedClears the value in AutoSelected when the control loses focus.
EditingDoneprotectedEnforces the setting in the ReadOnly property when editing is finished in the control.
GetCaretPosprotectedGets the value for the CaretPos property.
GetNumbersOnlyprotectedGets the value for the NumbersOnly property.
GetReadOnlyprotectedGets the value for the ReadOnly property.
GetSelLengthprotectedGets the value for the SelLength property.
GetSelStartprotectedGets the value for the SelStart property.
GetSelTextprotectedGets the value for the SelText property.
GetTextHintprotectedGets the value for the TextHint property.
SetCaretPosprotectedSets the value for the CaretPos property.
SetCharCaseprotectedSets the value for the CharCase property.
SetEchoModeprotectedSets the value for the EchoMode property.
SetNumbersOnlyprotectedSets the value for the NumbersOnly property.
SetReadOnlyprotectedSets the value for the ReadOnly property.
SetSelLengthprotectedSets the value for the SelLength property.
SetSelStartprotectedSets the value for the SelStart property.
SetSelTextprotectedSets the value for the SelText property.
SetTextHintprotectedSets the value for the TextHint property.
ChildClassAllowedprotectedIndicates whether child controls using the specified class are allowed.
GetControlClassDefaultSizeprotectedReturns the default dimensions for new instances of the class.
MouseUpprotectedHandles mouse up events for the control.
RealGetTextprotectedUses the TextHint display status when getting the value for Text.
RealSetTextprotectedUpdates Modified and the TextHint display when storing the new Text value.
KeyUpAfterInterfaceprotectedHandles Key Up events forwarded from the LCL interface.
WMCharprotectedHandles a WM_CHAR window message for the control.
CMWantSpecialKeyprotectedHandles the CM_WANTSPECIALKEY message for the control.
WndProcprotectedSuppresses the CM_CHANGED control message when an emulated TextHint is visible.
ShouldAutoAdjustprotectedDetermines if the control should auto-adjust its Height and/or Width.
WMSetFocusprotectedHandles the LM_SETFOCUS message for the control.
WMKillFocusprotectedHandles the LM_KILLFOCUS message for the control.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
ClearpublicDeletes all text in the edit box for the control.
SelectAllpublicSelects the entire text in the edit control.
ClearSelectionpublicClears the current text selection in the edit control.
CopyToClipboardpublicCopies the selected text in the control to the clipboard.
CutToClipboardpublicMoves the selected text into the clipboard (removes it from the control).
PasteFromClipboardpublicInserts text from the clipboard at the current position in the control.
UndopublicReverts the last editing action in the control.
RemoveAllHandlersOfObjectpublicRemoves all event handlers assigned for the specified object.
AddHandlerOnChangepublicAdds the specified OnChange event handler to the control.
RemoveHandlerOnChangepublicRemoves the specified OnChange event handler for the list of handlers in the control.

Events

OnChangepublicEvent handler signalled when the text for the control is changed.

Inherited

From TWinControl (226)

AddControl AdjustClientRect AlignControls AllAutoSized AutoAdjustLayout AutoSizeDelayed AutoSizeDelayedHandle AutoSizeDelayedReport AutoSizePhases BeginUpdateBounds BorderWidth BoundsLockCount BroadCast Brush BrushCreated CachedClientHeight CachedClientWidth CanFocus CanSetFocus CanTab ChangeScale ChildHandlesCreated ChildKey ChildSizing ClientRectNeedsInterfaceUpdate CMBiDiModeChanged CMBorderChanged CMDoubleBufferedChanged CMEnabledChanged CMEnter CMExit CMParentDoubleBufferedChanged CMShowHintChanged CMShowingChanged CMVisibleChanged CNChar CNKeyDown CNKeyUp CNSysKeyDown CNSysKeyUp ContainsControl ControlAtPos ControlCount ControlKeyDown ControlKeyUp Controls ControlsAligned CreateBrush CreateDockManager CreateHandle CreateParented CreateParentedControl CreateSubClass CreateWnd CustomAlignInsertBefore CustomAlignPosition DefaultHandler DefWndProc DesignerDeleting DestroyHandle DestroyWnd DialogChar DisableAlign DoAddDockClient DoAdjustClientRectChange DoAlignChildControls DoAllAutoSize DoAutoSize DoChildSizingChange DockClientCount DockClients DockDrop DockManager DockOver DockSite DoConstraintsChange DoDockClientMsg DoDockOver DoDragMsg DoFlipChildren DoFloatMsg DoGetDockCaption DoKeyDownBeforeInterface DoKeyPress DoKeyUpBeforeInterface DoRemainingKeyDown DoRemainingKeyUp DoRemoveDockClient DoSendBoundsToInterface DoSendShowHideToInterface DoSetBounds DoubleBuffered DoUnDock DoUndockClientMsg DoUTF8KeyPress EnableAlign EndUpdateBounds EraseBackground FinalizeWnd FindChildControl FindNextControl FixDesignFontsPPIWithChildren FixupTabList FlipChildren Focused FormEndUpdated GetAdjustedLogicalClientRect GetBorderStyle GetChildren GetChildrenRect GetClientOrigin GetClientRect GetControlIndex GetControlOrigin GetDeviceContext GetDockCaption GetEnumeratorControls GetEnumeratorControlsReverse GetMouseCapture GetParentHandle GetPreferredSizeClientFrame GetSiteInfo GetTabOrderList GetTextLen GetTopParentHandle Handle HandleAllocated HandleNeeded InsertControl IntfGetDropFilesTarget IntfUTF8KeyPress Invalidate InvalidateBoundsRealized InvalidateClientRectCache InvalidatePreferredChildSizes IsClientHeightStored IsClientWidthStored IsControlMouseMsg IsFlipped IsResizing IsSpecialSubControl KeyDown KeyDownAfterInterface KeyDownBeforeInterface KeyPress KeyUp KeyUpBeforeInterface Loaded LockRealizeBounds MainWndProc NotifyControls OnAlignInsertBefore OnAlignPosition OnDockDrop OnDockOver OnEnter OnExit OnGetDockCaption OnGetSiteInfo OnKeyDown OnKeyPress OnKeyUp OnUnDock OnUTF8KeyPress PaintControls PaintHandler PaintTo PaintWindow ParentDoubleBuffered ParentFormHandleInitialized ParentHandlesAllocated ParentWindow PerformTab ReAlign RealizeBounds RealizeBoundsRecursive ReloadDockedControl RemoveControl RemoveFocus Repaint ScaleBy ScaleControls ScrollBy ScrollBy_WS SelectFirst SelectNext SendDialogChar SendMoveSizeMessages SetBorderStyle SetBounds SetChildZPosition SetColor SetControlIndex SetDockManager SetFocus SetShape SetTempCursor ShowControl Showing UnlockRealizeBounds Update UpdateControlState UpdateDockCaption UpdateShowing UseDockManager UTF8KeyPress VisibleDockClientCount WindowHandle WMContextMenu WMDestroy WMEnter WMEraseBkgnd WMExit WMKeyDown WMKeyUp WMMove WMNotify WMPaint WMShowWindow WMSize WMSysChar WMSysKeyDown WMSysKeyUp WMWindowPosChanged WriteLayoutDebugReport WSSetText

From TControl (357)

AccessibleDescription AccessibleName AccessibleRole AccessibleValue Action ActionChange ActionLink ActiveDefaultControlChanged AddHandler AddHandlerOnBeforeDestruction AddHandlerOnChangeBounds AddHandlerOnEnabledChanged AddHandlerOnEnabledChanging AddHandlerOnKeyDown AddHandlerOnMouseWheel AddHandlerOnResize AddHandlerOnVisibleChanged AddHandlerOnVisibleChanging AdjustSize Align AnchorAsAlign AnchorClient AnchoredControlCount AnchoredControls AnchorHorizontalCenterTo AnchorParallel Anchors AnchorSame AnchorSide AnchorSideBottom AnchorSideChanged AnchorSideLeft AnchorSideRight AnchorSideTop AnchorToCompanion AnchorToNeighbour AnchorVerticalCenterTo AssignTo AutoSizing AutoSizingAll AutoSizingLockCount BaseBounds BaseParentClientSize BeforeDestruction BeforeDragStart BeginAutoDrag BeginAutoSizing BeginDrag BiDiMode BorderSpacing BoundsChanged BoundsRect BoundsRectForNewParent BringToFront CalculateDockSizes CanAutoSize Caption CaptureChanged CaptureMouseButtons ChangeBounds Changed CheckChildClassAllowed CheckNewParent CheckOnChangeBounds Click ClientHeight ClientOrigin ClientRect ClientToParent ClientToScreen ClientWidth CMChanged CMCursorChanged CMHintShow CMHitTest CMMouseEnter CMMouseLeave CMParentBiDiModeChanged CMParentColorChanged CMParentFontChanged CMParentShowHintChanged CMSysFontChanged CMTextChanged CNPreferredSizeChanged Color ColorIsStored ConstrainedResize Constraints ControlFontClass ControlOrigin ControlState ControlStyle ControlToScreen CreateAccessibleObject CreateControlBorderSpacing CreateFloatingDockSite Cursor DblClick DefineProperties DesktopFont DisableAutoSizing DoAutoAdjustLayout DoBorderSpacingChange DoCallKeyEventHandler DoCallMouseWheelEventHandler DoCallNotifyHandler Dock Docked DockOrientation DockTrackNoTarget DoContextPopup DoDock DoEndDock DoEndDrag DoFixDesignFontPPI DoMouseDown DoMouseUp DoMouseWheel DoMouseWheelDown DoMouseWheelHorz DoMouseWheelLeft DoMouseWheelRight DoMouseWheelUp DoOnChangeBounds DoOnParentHandleDestruction DoOnResize DoOnShowHint DoScaleFontPPI DoStartDock DoStartDrag DragCanceled DragCursor DragDrop Dragging DragKind DragMode DragOver EnableAutoSizing Enabled EnabledChanged EnabledChanging EndAutoSizing EndDrag ExecuteCancelAction ExecuteDefaultAction FindSubComponent FixDesignFontsPPI Floating FloatingDockSiteClass Font ForeignAnchorSideChanged FormIsUpdating GetAccessibleObject GetAction GetActionLinkClass GetAnchorsDependingOnParent GetCachedText GetCanvasScaleFactor GetChildAccessibleObjectAtPos GetClientScrollOffset GetColorResolvingParent GetCursor GetDefaultColor GetDefaultDockCaption GetDefaultHeight GetDefaultWidth GetDockEdge GetDragImages GetEnabled GetFloating GetFloatingDockSiteClass GetLogicalClientRect GetMousePosFromMessage GetPalette GetParentBackground GetParentComponent GetPopupMenu GetPreferredSize GetRGBColorResolvingParent GetScrolledClientRect GetSelectedChildAccessibleObject GetSidePosition GetTextBuf GetTopParent HandleObjectShouldBeVisible HasHelp HasParent Height HeightIsAnchored HelpContext HelpKeyword HelpType Hide Hint HostDockSite InitiateAction InvalidateControl InvalidatePreferredSize IsAParentAligning IsBorderSpacingInnerBorderStored IsCaptionStored IsControl IsControlVisible IsEnabled IsParentColor IsParentFont IsParentOf IsProcessingPaintMsg IsRightToLeft IsVisible Left LMCaptureChanged LoadedAll LRDockWidth ManualDock ManualFloat MouseCapture MouseDown MouseEnter MouseInClient MouseLeave MouseMove Notification OnChangeBounds OnClick OnConstrainedResize OnContextPopup OnDblClick OnDragDrop OnDragOver OnEditingDone OnEndDock OnEndDrag OnMouseDown OnMouseEnter OnMouseLeave OnMouseMove OnMouseUp OnMouseWheel OnMouseWheelDown OnMouseWheelHorz OnMouseWheelLeft OnMouseWheelRight OnMouseWheelUp OnQuadClick OnResize OnShowHint OnStartDock OnStartDrag OnTripleClick Parent ParentBackground ParentBiDiMode ParentDestroyingHandle ParentFont ParentFontChanged ParentShowHint ParentToClient Perform PositionDockRect QuadClick ReadBounds ReadState Refresh RemoveHandler RemoveHandlerOnBeforeDestruction RemoveHandlerOnChangeBounds RemoveHandlerOnEnabledChanged RemoveHandlerOnEnabledChanging RemoveHandlerOnKeyDown RemoveHandlerOnMouseWheel RemoveHandlerOnResize RemoveHandlerOnVisibleChanged RemoveHandlerOnVisibleChanging ReplaceDockedControl RequestAlign Resize Scale96ToFont Scale96ToForm Scale96ToScreen ScaleConstraints ScaleDesignToForm ScaleFontsPPI ScaleFontTo96 ScaleFontToScreen ScaleFormTo96 ScaleFormToDesign ScaleScreenTo96 ScaleScreenToFont ScreenToClient ScreenToControl SendToBack SessionProperties SetAction SetAlign SetAnchors SetAutoSize SetBiDiMode SetBoundsKeepBase SetCursor SetDragMode SetEnabled SetHint SetInitialBounds SetName SetParent SetParentBackground SetParentBiDiMode SetParentComponent SetTextBuf SetVisible SetZOrder Show ShowHelp ShowHint TBDockHeight Top TripleClick UndockHeight UndockWidth UpdateAnchorRules UpdateBaseBounds UpdateMouseCursor UpdateRolesForForm UseRightToLeftAlignment UseRightToLeftReading UseRightToLeftScrollBar Visible VisibleChanged VisibleChanging Width WidthIsAnchored WindowProc WMCancelMode WMLButtonDBLCLK WMLButtonDown WMLButtonQuadCLK WMLButtonTripleCLK WMLButtonUp WMMButtonDBLCLK WMMButtonDown WMMButtonQuadCLK WMMButtonTripleCLK WMMButtonUp WMMouseHWheel WMMouseMove WMMouseWheel WMRButtonDBLCLK WMRButtonDown WMRButtonQuadCLK WMRButtonTripleCLK WMRButtonUp WMXButtonDBLCLK WMXButtonDown WMXButtonQuadCLK WMXButtonTripleCLK WMXButtonUp

From TLCLComponent (6)

DecLCLRefCount GetWSComponentClass IncLCLRefCount LCLRefCount NewInstance WidgetSetClass

From TComponent (64)

_AddRef _Release CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetTypeInfo GetTypeInfoCount iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (4)

Assign FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (35)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.