TDBEdit class
TDBEdit - a data-aware edit box for processing a single
text-string from a dataset.Declaration
TDBEdit = class(TCustomMaskEdit)Inheritance
Description
TDBEdit is a
TCustomMaskEdit descendant which
implements a data-aware control which allows editing of the value in a
database field. Like its ancestor class, TDBEdit displays and edits a single
line of text. For multi-line text values, use the
TDBMemo control.
TDBEdit extends the ancestor class with additional properties needed to configure the data-aware features in the control, including:
- DataSource
- Component which provides access to the dataset with the field value
- DataField
- Name of the field in the dataset edited in the control
- Field
- Field definition and metadata in the dataset
- ReadOnly
- Indicates if the value for the control (and its field) cannot be changed
An internal TFieldDataLink class instance is used to maintain an
association between the control and its data source. TDBEdit provides methods
which support use of TBasicAction with the data link for the control.
TDBEdit extends the masking capabilities from the ancestor to include use of
mask-related properties like EditMask and Alignment set
in the TField instance for the control. Use the
CustomEditMask property to enable an edit mask independent of the
value defined in the dataset Field.
See also
Properties
Field | public | Provides access to the field definition for the data-aware control. |
CustomEditMask | published | Indicates if a custom edit mask is used in the control. |
DataField | published | Contains the name of the field with the value for the control. |
DataSource | published | Provides access to the dataset with content for the control. |
ReadOnly | published | Indicates if the control cannot modify the field in the linked dataset. |
Align | published | Specifies the placement of the control on its Parent control. |
Alignment | published | The horizontal alignment for the text in the control (left, right, or centered). |
Anchors | published | The set of anchor definitions for this control. |
AutoSelect | published | Enables auto-selection of text when focused. |
AutoSize | published | Allows automatic adjustment of the size for the control, according to its content. |
BiDiMode | published | Indicates whether text controls use in bi-directional reading. |
BorderSpacing | published | Determines the inner and outer border spacing for this control. |
BorderStyle | published | Indicates the border style displayed around the control. |
CharCase | published | Controls the character case applied to values entered in the control. |
Color | published | The background color for the control. |
Constraints | published | Contains the minimum and maximum Width and Height for the control. |
DoubleBuffered | published | When enabled, it reduces flicker when the control is painted. |
DragCursor | published | The cursor shape shown during a drag operation. |
DragKind | published | Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock. |
DragMode | published | Determines how a drag operation is started for the control. |
Enabled | published | Determines whether the control responds to mouse or keyboard input. |
EditMask | published | Contains the mask characters classes and literals used to format/obscure the value for the control. |
Font | published | The font to be used for text display in this control. |
MaxLength | published | The maximum length of the value entered in Text, or 0 (zero) for unlimited length. |
ParentBiDiMode | published | Indicates whether the BiDiMode settings in the Parent control are used. |
ParentColor | published | Use the Color from the Parent control, when enabled. |
ParentDoubleBuffered | published | Value for the DoubleBuffered property in a Parent control. |
ParentFont | published | Indicates if the Font from the Parent control is used in the control. |
ParentShowHint | published | If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True. |
PasswordChar | published | Allows obfuscation of the displayed text, showing all characters as PasswordChar. |
PopupMenu | published | A context-sensitive menu that pops up when the right mouse button is clicked over this control. |
ShowHint | published | Enables Hint display for the control. |
TabOrder | published | Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key. |
TabStop | published | Allows the user to navigate to / from the control by pressing the Tab or Shift+Tab keys. |
TextHint | published | Default hint text shown when the Text property is empty for the control. |
Visible | published | Allows the control, and all of its children, to be displayed or hidden. |
Methods
GetReadOnly | protected | Gets the value for the ReadOnly property. |
SetReadOnly | protected | Sets the value for the ReadOnly property. |
KeyDown | protected | Handles key down events in the control. |
UTF8KeyPress | protected | Handles UTF-8 characters for the data-aware control. |
Notification | protected | Handles notifications when a component is added or removed from the control. |
EditCanModify | protected | Indicates if the control can modify the text for the control value. |
GetEditText | protected | Gets the value for the EditText property. |
Change | protected | Performs actions needed when the value for the control has been changed. |
Reset | protected | Cancels pending changes to the linked dataset. |
WMSetFocus | protected | Ensures that the control has the input focus. |
WMKillFocus | protected | Ensures that the liked dataset is updated when the modified control loses input focus. |
WndProc | protected | Handles the specified LCL message for the control. |
Create | public | Constructor for the class instance. |
Destroy | public | Destructor for the class instance. |
ExecuteAction | public | Provides support for TBasicAction in the control. |
UpdateAction | public | Updates the specified action to reflect the current state in the linked dataset. |
Events
OnChange | published | Event handler signalled when the text for the control is changed. |
OnClick | published | Notification handler for mouse clicks. |
OnContextPopup | published | Invoked when a context-sensitive pop-up menu is requested. |
OnDblClick | published | Event handler signalled when a mouse double click occurs in the control. |
OnDragDrop | published | Event handler signalled when an object is dropped onto the control. |
OnDragOver | published | Event handler signalled when a control is dragged over the control instance. |
OnEditingDone | published | Event handler signalled when editing is completed for the control. |
OnEndDrag | published | Event handler signalled for the end of a drag-drop operation. |
OnEnter | published | Event handler signalled when the control receives focus. |
OnExit | published | Event handler signalled when the control loses focus. |
OnKeyDown | published | Event handler signalled when a key is down while control has focus. |
OnKeyPress | published | Event handler signalled when a key is being pressed while the control has focus. |
OnKeyUp | published | Event handler signalled when a key becomes up (not pressed) while the control has focus. |
OnMouseDown | published | Event handler signalled when a mouse down event is handled for the control. |
OnMouseEnter | published | Event handler signalled when the mouse pointer has entered the control. |
OnMouseLeave | published | Event handler signalled when the mouse pointer has left the control. |
OnMouseMove | published | Event handler signalled when the mouse pointer is moved in the control. |
OnMouseUp | published | Event handler signalled when a mouse up event is handled for the control. |
OnMouseWheel | published | Event handler for mouse wheel turned. |
OnMouseWheelDown | published | Event handler signalled for a downward movement of the mouse wheel. |
OnMouseWheelUp | published | Event handler signalled for an upward movement of the mouse wheel. |
OnStartDrag | published | Event handler signalled for the start of a dragging operation. |
OnUTF8KeyPress | published | Handler for a character entered by the user. |
Inherited
From TCustomMaskEdit (41)
ApplyMaskToText CanShowEmulatedTextHint CheckCursor Clear CutToClipBoard DisableMask DoEnter DoExit DoValidationError EditText EnableSets GetMaxLength GetSel GetTextWithoutMask GetTextWithoutSpaceChar HandleKeyPress IsMasked KeyPress LMClearSel LMCutToClip LMPasteFromClip Loaded Modified MouseUp OnValidationError PasteFromClipBoard RealGetText RealSetText RestoreMask SelectAll SetCharCase SetEditText SetMaxLength SetNumbersOnly SetSel SetTextApplyMask SpaceChar TextChanged ValidateEdit ValidationErrorMode WSRegisterClass
From TCustomEdit (42)
AddHandlerOnChange AutoSelected CalculatePreferredSize CanUndo CaretPos ChildClassAllowed ClearSelection CMWantSpecialKey CopyToClipboard CreateParams EchoMode EditingDone EmulatedTextHintStatus FontChanged GetCaretPos GetControlClassDefaultSize GetNumbersOnly GetSelLength GetSelStart GetSelText GetTextHint HideSelection InitializeWnd KeyUpAfterInterface Layout NumbersOnly Options RemoveAllHandlersOfObject RemoveHandlerOnChange SelLength SelStart SelText SetCaretPos SetEchoMode SetSelLength SetSelStart SetSelText SetTextHint ShouldAutoAdjust Text Undo WMChar
From TWinControl (214)
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 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 KeyDownAfterInterface KeyDownBeforeInterface KeyUp KeyUpBeforeInterface LockRealizeBounds MainWndProc NotifyControls OnAlignInsertBefore OnAlignPosition OnDockDrop OnDockOver OnGetDockCaption OnGetSiteInfo OnUnDock PaintControls PaintHandler PaintTo PaintWindow 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 VisibleDockClientCount WindowHandle WMContextMenu WMDestroy WMEnter WMEraseBkgnd WMExit WMKeyDown WMKeyUp WMMove WMNotify WMPaint WMShowWindow WMSize WMSysChar WMSysKeyDown WMSysKeyUp WMWindowPosChanged WriteLayoutDebugReport WSSetText
From TControl (324)
AccessibleDescription AccessibleName AccessibleRole AccessibleValue Action ActionChange ActionLink ActiveDefaultControlChanged AddHandler AddHandlerOnBeforeDestruction AddHandlerOnChangeBounds AddHandlerOnEnabledChanged AddHandlerOnEnabledChanging AddHandlerOnKeyDown AddHandlerOnMouseWheel AddHandlerOnResize AddHandlerOnVisibleChanged AddHandlerOnVisibleChanging AdjustSize AnchorAsAlign AnchorClient AnchoredControlCount AnchoredControls AnchorHorizontalCenterTo AnchorParallel AnchorSame AnchorSide AnchorSideBottom AnchorSideChanged AnchorSideLeft AnchorSideRight AnchorSideTop AnchorToCompanion AnchorToNeighbour AnchorVerticalCenterTo AssignTo AutoSizing AutoSizingAll AutoSizingLockCount BaseBounds BaseParentClientSize BeforeDestruction BeforeDragStart BeginAutoDrag BeginAutoSizing BeginDrag 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 ColorIsStored ConstrainedResize 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 DragDrop Dragging DragOver EnableAutoSizing EnabledChanged EnabledChanging EndAutoSizing EndDrag ExecuteCancelAction ExecuteDefaultAction FindSubComponent FixDesignFontsPPI Floating FloatingDockSiteClass 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 OnChangeBounds OnConstrainedResize OnEndDock OnMouseWheelHorz OnMouseWheelLeft OnMouseWheelRight OnQuadClick OnResize OnShowHint OnStartDock OnTripleClick Parent ParentBackground ParentDestroyingHandle ParentFontChanged 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 TBDockHeight Top TripleClick UndockHeight UndockWidth UpdateAnchorRules UpdateBaseBounds UpdateMouseCursor UpdateRolesForForm UseRightToLeftAlignment UseRightToLeftReading UseRightToLeftScrollBar 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 (62)
_AddRef _Release CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DesignInfo DestroyComponents Destroying 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 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.
