CustomControl#

Qualified name: delphivcl.CustomControl

class CustomControl#

Bases: WinControl

Base class for controls that wrap Windows screen objects but perform their own rendering. In most descendants of TWinControl, the job of drawing the control’s surface belongs to the underlying Windows screen object. If a control has visible features that cannot be rendered by a Windows screen object, it requires access to a canvas object so it can do its own drawing. TCustomControl is one of two base classes for controls that draw their own surfaces. Because TCustomControl is descended from TWinControl, instances of its descendants can receive focus and serve as containers. Classes of controls that perform their own screen rendering and do not need the features of TWinControl should be descendants of TGraphicControl instead of TCustomControl. TGraphicControl objects can render themselves with less overhead, because they do not have underlying Windows screen objects. TCustomControl objects have a Paint method, which is called whenever the control needs to render its image. Custom controls paint themselves using the Canvas property.

Methods

BringToFront

Puts the control in front of all other controls in its parent control.

ClientToScreen

Translates a given point from client area coordinates to global screen coordinates.

Create

Creates an instance of TCustomControl.

Destroy

Destroys an instance of TCustomControl.

Hide

Hides the wrapped Control

Invalidate

Completely repaint control.

Repaint

Forces the control to repaint its image on the screen.

ScreenToClient

Converts the screen coordinates of a specified point on the screen to client coordinates.

SendToBack

Puts a windowed control behind all other windowed controls, or puts a non-windowed control behind all other non-windowed controls.

SetBounds

Sets the Left, Top, Width, and Height properties all at once.

Show

Shows the wrapped Control

Update

Processes any pending paint messages immediately.

Attributes

Action

Specifies the action associated with the control.

Align

Determines how the control aligns within its container (parent control).

AlignDisabled

Indicates child control realignment disabled.

AlignWithMargins

Specifies whether a control should be constrained by margins.

Anchors

Specifies how the control is anchored to its parent.

BiDiMode

Specifies the bidirectional mode for the control.

BoundsRect

Specifies the bounding rectangle of the control, expressed in the coordinate system of the parent control.

Brush

Determines the color and pattern used for painting the background of the control.

ClassName

Returns the TObject.ClassName

ClientHeight

Specifies the height of the control's client area in pixels.

ClientOrigin

Specifies the screen coordinates (in pixels) of the upper-left corner of a control's client area.

ClientRect

Specifies the size of a control's client area in pixels.

ClientWidth

Specifies the horizontal size of the control's client area in pixels.

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Indicates the number of components owned by the component.

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

<Delphi indexed property Components of type TComponent at 21141642500>

Constraints

Specifies the size constraints for the control.

ControlCount

Returns the number of child controls.

ControlState

Specifies the current state of a control at run time.

ControlStyle

Determines style characteristics of the control.

Controls

<Delphi indexed property Controls of type TWinControl at 211416EE760>

CurrentPPI

Embarcadero Technologies does not currently have any additional information.

Cursor

Specifies the image used to represent the mouse pointer when it passes into the region covered by the control.

CustomHint

CustomHint is a custom hint for the control.

DesignInfo

Contains information used by the Form designer.

DockClientCount

Specifies the number of controls that are docked on the windowed control.

DockClients

<Delphi indexed property DockClients of type TWinControl at 211416EE520>

DockManager

Specifies the control's docking manager interface.

DockOrientation

DockOrientation specifies how the control is docked relative to other controls docked in the same parent.

DockSite

Specifies whether the control can be the target of drag-and-dock operations.

DoubleBuffered

Determines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first.

Enabled

Controls whether the control responds to mouse, keyboard, and timer events.

ExplicitHeight

Specifies the explicit vertical size of the control in pixels.

ExplicitLeft

Specifies the explicit horizontal pixel coordinate of the left edge of a component relative to its parent.

ExplicitTop

Specifies the explicit vertical pixel coordinate of the top edge of a component relative to its parent.

ExplicitWidth

Specifies the explicit horizontal size of the control in pixels.

Floating

Specifies whether the control is floating.

FloatingDockSiteClass

Specifies the class of the temporary control that hosts the control when it is floating.

Handle

Provides access to the underlying Windows screen object for the control.

Height

Specifies the vertical size of the control in pixels.

HelpContext

The HelpContext property contains the numeric context ID that identifies the Help topic for the control.

HelpKeyword

The HelpKeyword property contains the keyword string that identifies the Help topic for the control.

HelpType

Specifies whether the control's context-sensitive Help topic is identified by a context ID or by keyword.

Hint

Hint contains the text string that appears when the user moves the mouse over the control.

HostDockSite

Specifies the control in which the control is docked.

IsDrawingLocked

IsDrawingLocked property returns True when redrawing for this control is locked.

LRDockWidth

Specifies the width of the control when it is docked horizontally.

Left

Specifies the horizontal coordinate of the left edge of a component relative to its parent.

Margins

Specifies the margins of the control.

MouseInClient

Indicates whether the mouse pointer is currently in the client area of the control.

Name

Specifies the name of the component as referenced in code.

Observers

Indicates the TObservers object added to the TComponent.

OnGesture

<Delphi property OnGesture of type TControl at 211418EC500>

Owner

Indicates the component that is responsible for streaming and freeing this component.

Padding

Specifies the padding of a control.

Parent

Returns/Sets the Control Parent

ParentCustomHint

Specifies where a control looks for its custom hint.

ParentDoubleBuffered

ParentDoubleBuffered defers the DoubleBuffered property of this component to the value of the parent's DoubleBuffered property.

ParentWindow

Reference to parent's underlying control.

PixelsPerInch

Embarcadero Technologies does not currently have any additional information.

RedrawDisabled

RedrawDisabled property returns True when redrawing for this control is locked.

ScaleFactor

Embarcadero Technologies does not currently have any additional information.

ShowHint

ShowHint specifies whether to show the Help Hint when the mouse pointer moves over the control.

Showing

Indicates whether the control is showing on the screen.

StyleElements

Specifies the style elements that are used by the control.

StyleName

Embarcadero Technologies does not currently have any additional information.

TBDockHeight

Specifies the height of the control when it is docked vertically.

TabOrder

Indicates the position of the control in its parent's tab order.

TabStop

Determines whether the user can tab to a control.

Tag

Stores a NativeInt integral value as a part of a component.

Top

Specifies the Y coordinate of the upper-left corner of a control, relative to its parent or containing control in pixels.

Touch

Specifies the touch manager component associated with the control.

UndockHeight

Specifies the height of the control when it is floating.

UndockWidth

Specifies the width of the control when it is floating.

UseDockManager

Specifies whether the docking manager is used in drag-and-dock operations.

VCLComObject

Represents information used internally by components that support COM.

Visible

Specifies whether the component appears onscreen.

VisibleDockClientCount

Specifies the number of visible controls that are docked on the windowed control.

Width

Specifies the horizontal size of the control or form in pixels.

WindowProc

<Delphi property WindowProc of type TControl at 211418EC1C0>

BringToFront()#

Puts the control in front of all other controls in its parent control.

ClientToScreen()#

Translates a given point from client area coordinates to global screen coordinates.

Create(AOwner: Component)#

Creates an instance of TCustomControl. Calling Create constructs and initializes an instance of TCustomControl. However, you should never attempt to instantiate a TCustomControl. This class is intended solely as a base class from which other control classes descend and you should only call Create to instantiate one of these descendants. Controls placed on forms at design time are created automatically. After calling the inherited constructor, Create initializes the control and also a TCanvas object for its Canvas property. When overriding Create, always call the inherited Create method first, then proceed with the control’s initialization. Remember to specify the override directive when overriding the Create method.

Note: If a component’s constructor allocates resources or memory, also override the destructor to free those resources.

Destroy()#

Destroys an instance of TCustomControl. Do not call Destroy directly in an application. Instead, call Free. Free verifies that the control is not nil, and only then calls Destroy. Applications should only free controls explicitly when the constructor was called without assigning an owner to the control. As the control is destroyed, it destroys the TCanvas object in its Canvas property. Override Destroy to free any memory or resources allocated in the Create method. When declaring a Destroy method in a descendent control type, always add the override directive to the declaration and call the inherited Destroy as the last statement in the redeclared method. When a control is created, Delphi automatically provides exception handling around the constructor call. The destructor is called if an exception escapes from the constructor. This means that the destructor code must be prepared to clean up a partially constructed instance. Check all data fields for zero before disposing of their contents.

Hide()#

Hides the wrapped Control

Invalidate()#

Completely repaint control.

Parent#

Returns/Sets the Control Parent

Repaint()#

Forces the control to repaint its image on the screen.

ScreenToClient()#

Converts the screen coordinates of a specified point on the screen to client coordinates.

SendToBack()#

Puts a windowed control behind all other windowed controls, or puts a non-windowed control behind all other non-windowed controls.

SetBounds(Left, Top, Width, Height)#

Sets the Left, Top, Width, and Height properties all at once.

Show()#

Shows the wrapped Control

Update()#

Processes any pending paint messages immediately.