TCustomEdit class
The base class for controls presenting editable text.
Declaration
TCustomEdit = class(TWinControl)Inheritance
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
AutoSelect | protected | Enables auto-selection of text when focused. |
AutoSelected | protected | Set to True when the text selection was made automatically. |
ParentColor | protected | Uses the Color from the Parent control, when enabled. |
Alignment | public | The horizontal alignment for the text in the control (left, right, or centered). |
Layout | public | |
AutoSize | public | Allows automatic adjustment of the size for the control, according to its content. |
BorderStyle | public | Indicates the line style drawn as a border around the control. |
CanUndo | public | Indicates whether the last change can be reverted in the control. |
CaretPos | public | The position of the editing cursor in the control. |
CharCase | public | Controls the character case applied to values entered in the control. |
EchoMode | public | Allows to modify the text display, useful for entering passwords. |
EmulatedTextHintStatus | public | Status for the emulated TextHint in the control. |
HideSelection | public | Determines if selected text to be hidden when the control does not have focus. |
MaxLength | public | The maximum length of the value entered in Text, or 0 (zero) for unlimited length. |
Modified | public | True when the value in Text has been changed using the keyboard. |
NumbersOnly | public | Indicates if the edit control accepts numeric values only. |
Options | public | |
PasswordChar | public | Allows obfuscation of the displayed text, showing all characters as PasswordChar. |
PopupMenu | public | A context-sensitive menu that pops up when the right mouse button is clicked over this control. |
ReadOnly | public | Indicates if the user is prevented from changing the value for the Text in the control. |
SelLength | public | The number of currently selected UTF-8-encoded characters in the control. |
SelStart | public | The zero-based index for the first UTF-8 character in the current text selection. |
SelText | public | The currently selected text in the edit box for the control. |
TabOrder | public | Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key. |
TabStop | public | Enables keyboard navigation using the Tab or Shift+Tab keys. |
Text | public | The text displayed and edited for the control. |
TextHint | public | Default hint text shown when the Text property is empty for the control. |
Methods
WSRegisterClass | protected | Registers this component class with the current WidgetSet. |
CanShowEmulatedTextHint | protected | Indicates if the value in TextHint can be displayed in the edit control. |
CalculatePreferredSize | protected | Gets the preferred size for a new instance of the class. |
CreateParams | protected | Ensures the required creation parameters are set for handle creation. |
InitializeWnd | protected | Initializes the window handle for the control. |
TextChanged | protected | Applies case conversion (if needed), and updates the editing cursor selection text. |
FontChanged | protected | Handles changes to the font used in the control. |
Change | protected | Performs actions needed when the text in the control is changed. |
DoEnter | protected | Signals the OnEnter event handler, and selects the entire text when AutoSelect is True. |
DoExit | protected | Clears the value in AutoSelected when the control loses focus. |
EditingDone | protected | Enforces the setting in the ReadOnly property when editing is finished in the control. |
GetCaretPos | protected | Gets the value for the CaretPos property. |
GetNumbersOnly | protected | Gets the value for the NumbersOnly property. |
GetReadOnly | protected | Gets the value for the ReadOnly property. |
GetSelLength | protected | Gets the value for the SelLength property. |
GetSelStart | protected | Gets the value for the SelStart property. |
GetSelText | protected | Gets the value for the SelText property. |
GetTextHint | protected | Gets the value for the TextHint property. |
SetCaretPos | protected | Sets the value for the CaretPos property. |
SetCharCase | protected | Sets the value for the CharCase property. |
SetEchoMode | protected | Sets the value for the EchoMode property. |
SetNumbersOnly | protected | Sets the value for the NumbersOnly property. |
SetReadOnly | protected | Sets the value for the ReadOnly property. |
SetSelLength | protected | Sets the value for the SelLength property. |
SetSelStart | protected | Sets the value for the SelStart property. |
SetSelText | protected | Sets the value for the SelText property. |
SetTextHint | protected | Sets the value for the TextHint property. |
ChildClassAllowed | protected | Indicates whether child controls using the specified class are allowed. |
GetControlClassDefaultSize | protected | Returns the default dimensions for new instances of the class. |
MouseUp | protected | Handles mouse up events for the control. |
RealGetText | protected | Uses the TextHint display status when getting the value for Text. |
RealSetText | protected | Updates Modified and the TextHint display when storing the new Text value. |
KeyUpAfterInterface | protected | Handles Key Up events forwarded from the LCL interface. |
WMChar | protected | Handles a WM_CHAR window message for the control. |
CMWantSpecialKey | protected | Handles the CM_WANTSPECIALKEY message for the control. |
WndProc | protected | Suppresses the CM_CHANGED control message when an emulated TextHint is visible. |
ShouldAutoAdjust | protected | Determines if the control should auto-adjust its Height and/or Width. |
WMSetFocus | protected | Handles the LM_SETFOCUS message for the control. |
WMKillFocus | protected | Handles the LM_KILLFOCUS message for the control. |
Create | public | Constructor for the class instance. |
Destroy | public | Destructor for the class instance. |
Clear | public | Deletes all text in the edit box for the control. |
SelectAll | public | Selects the entire text in the edit control. |
ClearSelection | public | Clears the current text selection in the edit control. |
CopyToClipboard | public | Copies the selected text in the control to the clipboard. |
CutToClipboard | public | Moves the selected text into the clipboard (removes it from the control). |
PasteFromClipboard | public | Inserts text from the clipboard at the current position in the control. |
Undo | public | Reverts the last editing action in the control. |
RemoveAllHandlersOfObject | public | Removes all event handlers assigned for the specified object. |
AddHandlerOnChange | public | Adds the specified OnChange event handler to the control. |
RemoveHandlerOnChange | public | Removes the specified OnChange event handler for the list of handlers in the control. |
Events
OnChange | public | Event 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.
