Contains types, constants, classes, and routines used to implement visual controls.

controls.pp contains classes, types, constants, and routines used to implement visual controls used in the Lazarus Component Library (LCL). Most of the classes are base classes, or used in the implementation of controls defined in others units.

The following components are added to the Common Controls tab in the Lazarus IDE component palette:

  • TImageList

The following components are registered but not displayed on the Lazarus IDE component palette:

  • TCustomControl
  • TGraphicControl

controls.pp is part of the Lazarus Component Library (LCL).

Starting value for control message constants defined in the LCL. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Control message constant. Starting value for control notification messages in the LCL. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Control notification message constant. Modal dialog exited with the None button. Modified in LCL 3.0 to be an alias to mrNone in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the OK button. Modified in LCL 3.0 to be an alias to mrOK in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the Cancel button. Modified in LCL 3.0 to be an alias to mrCancel in System.UITypes for FPC 3.2.0 or higher. Modal dialog aborted. Modified in LCL 3.0 to be an alias to mrAbort in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the Retry button. Modified in LCL 3.0 to be an alias to mrRetry in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the Ignore button. Modified in LCL 3.0 to be an alias to mrIgnore in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the Yes button. Modified in LCL 3.0 to be an alias to mrYes in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the No button. Modified in LCL 3.0 to be an alias to mrNo in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the All button. Modified in LCL 3.0 to be an alias to mrAll in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the NoToAll button. Modified in LCL 3.0 to be an alias to mrNoToAll in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the YesToAll button. Modified in LCL 3.0 to be an alias to mrYesToAll in System.UITypes for FPC 3.2.0 or higher. Modal dialog exited with the Close button. Modified in LCL 3.0 to be an alias to mrClose in System.UITypes for FPC 3.2.0 or higher. Last (highest) value of modal results. Modified in LCL 3.0 to be an alias to mrLast in System.UITypes for FPC 3.2.0 or higher. Deprecated; Use the ModalResultStr array from the UITypes unit. Gets the string representation for a modal result value.

ModalResultStr is an indexed ShortString property used to get the string representation for the specified TModalResult constant. The read access specifier for the property has been deprecated; Use the ModalResultStr array from the UITypes unit directly.

ModalResultStr TModalResult
Alias to the fsSurface constant in the GraphType unit. Alias to the fsBorder constant in the GraphType unit. Alias to the bvNone constant in the GraphType unit. Alias to the bvLowered constant in the GraphType unit. Alias to the bvRaised constant in the GraphType unit. Alias to the bvSpace constant in the GraphType unit. Defines the key used for shortcuts on different platforms.

ssModifier is a constant which defines the modifier for keyboard shortcuts, like Ctrl+C (Copy), Ctrl+Z (UnDo), Ctrl+X (Cut), and Ctrl+V (paste). Mac and iOS use the Meta key (instead of the Ctrl key) for those shortcuts.

GUID for the Object Inspector in the Lazarus IDE. Value is '{37417989-8C8F-4A2D-9D26-0FA377E8D8CC}' Defines an interface used in the Lazarus Object Inspector.

Allows the Lazarus object inspector to query controls which implement the interface about the ability to add or delete items in the control.

TFlowPanelControl TFlowPanelControlList
Returns True an item can be added in a control. Returns True if an item can be added to a control. Returns True if an item can be deleted from a control. Returns True an item can be delteted in a control. TWinControlClass - class of TWinControl. TControlClass - class of TControl. Defines a structure used for mouse wheel control messages.

Holds mouse wheel details that include:

  • the Message associated with the wheel
  • the shift state (i.e. whether Shift, Alt, Control keys have been pressed)
  • the mouse position
  • the message Result
Cardinal value with the CM_MOUSEWHEEL identifier for the mouse wheel message. State of the modifier for keys and mouse buttons. Inserted for alignment only. Number of notches or units the mouse wheel was moved. Negative for mouse wheel up movements. Mouse position as a TSmallPoint value. Mouse X position as a SmallInt value. Mouse Y position as a SmallInt value. Result for the mouse wheel message. Zero (0) indicates the message was handled. Alias for the TLMNCHitTest type. TLMNCHitTest Alias for the TLMMouse type. TLMMouse Contains values representing a Control Change Message.

TCMControlChange is a record type which contains values representing the arguments and the result for a Control Change Message. TCMControlChange is the type passed to the CMControlChange method in TCustomFlowPanel.

TCustomFlowPanel.CMControlChange
Mouse message constant for the change notification. Control to receive the change message. Indicates if the control message is an insert operation. Result for the control change message. Not used in the current LCL implementation. Not used in the current LCL implementation. Alias for the TLMKey type. TLMKey Used in LazReport controls. Alias for the TLMKey type. TLMKey Used in the jvcllaz package. Alias for the TLMEnter type. TLMEnter Alias for the TLMExit type. TLMExit Contains information representing a CM_CANCELMODE control message. Used in the jvcllaz package. Message constant. Padding for alignment. Control which generated the message. 0 if the message has not been handled. Not used in the current LCL implementation. Alignment options for a control, within its Parent control.

TAlign is an enumeration type with values that indicate the alignment for a control within its Parent. The enumeration includes the following values and meanings:

alNone
fixed position and extent
alTop
stacked at top, full width
alBottom
stacked at bottom, full width
alLeft
stacked at left, full height
alRight
stacked at right, full height
alClient
filling entire remaining client area
alCustom
other alignment, in drag-dock: notebook

At most, one control can have alClient alignment for a given form or container.

The order of multiple controls with the same (stackable) alignment is determined by their Left and/or Top coordinate. The precedence of conflicting alignment requests (e.g. one at top, one at right) is resolved.

Control has fixed size and position. Control stacked at top, full width. Control stacked at bottom, full width. Control stacked at left, full height. Control stacked at right, full height. Control fills remaining client area. Control has special alignment. Set of alignment options. TAlign The control side to be anchored.

With the TAnchorSideReference value asrCenter, the sides mean horizontal or vertical alignment of the control's center.

Modified in LCL 3.0 to be an alias to the TAnchorKind type in System.UITypes for FPC 3.2.0 or higher.
Top side (or center vertically). Left side (or center horizontally). Right side (or center horizontally). Bottom side (or center vertically). Set type used to store values from the TAnchorKind enumeration.

TAnchors is the the type used to implement the Anchors property in TControl and descendent classes.

Modified in LCL 3.0 to be an alias to the TAnchors type in System.UITypes for FPC 3.2.0 or higher.
The side of another control, to which this control's side is anchored. Modified in LCL 3.0 to be an alias to the TAnchorSideReference type in System.UITypes for FPC 3.2.0 or higher. Anchor to the top side. Anchor to the bottom side. Anchor to the center of the other control. Represents the enumeration value akLeft in TAnchorKind. Added in LCL 3.0 as an alias to the System.UITypes constant for FPC 3.2.0 or higher. Represents the enumeration value akTop in TAnchorKind. Added in LCL 3.0 as an alias to the System.UITypes constant for FPC 3.2.0 or higher. Represents the enumeration value akRight in TAnchorKind. Added in LCL 3.0 as an alias to the System.UITypes constant for FPC 3.2.0 or higher. Represents the enumeration value akRight in TAnchorKind. Added in LCL 3.0 as an alias to the System.UITypes constant for FPC 3.2.0 or higher. Represents the enumeration value asrTop in TAnchorSideReference. Added in LCL 3.0 as an alias to the System.UITypes constant for FPC 3.2.0 or higher. Represents the enumeration value asrBottom in TAnchorSideReference. Added in LCL 3.0 as an alias to the System.UITypes constant for FPC 3.2.0 or higher. Represents the enumeration value asrCenter in TAnchorSideReference. Added in LCL 3.0 as an alias to the System.UITypes constant for FPC 3.2.0 or higher. Anchor to the left side (=asrTop). Anchor to the right side (=asrBottom). A string type used for the caption on a control.

TCaption is an alias for the TTranslateString type. It allows a string value defined using the type to be recognized in the LCL translation system. TCaption is the type used to implement properties like TControl.Caption, TControl.Text, TControl.AccessibleName, TControl.AccessibleValue, et. al.

Defines the range of values used for cursor shapes.

TCursor is an Integer type which defines the range of values used for cursor shapes. TCursor includes the following values:

Standard Cursors

crDefault
TCursor(0) - current cursor unchanged
crNone
TCursor(-1) - hide cursor
crArrow
TCursor(-2) - normal cursor
crCross
TCursor(-3) - graphics cursor, for pixel or rectangle selection
crIBeam
TCursor(-4) - text cursor, for setting insertion point

Sizing Cursors

crSize
TCursor(-22)
crSizeAll
TCursor(-22)
crSizeNESW
TCursor(-6) - diagonal north east - south west
crSizeNS
TCursor(-7)
crSizeNWSE
TCursor(-8)
crSizeWE
TCursor(-9)
crSizeNW
TCursor(-23)
crSizeN
TCursor(-24)
crSizeNE
TCursor(-25)
crSizeW
TCursor(-26)
crSizeE
TCursor(-27)
crSizeSW
TCursor(-28)
crSizeS
TCursor(-29)
crSizeSE
TCursor(-30)

Drag and Drop Cursors

crDrag
TCursor(-12) - dragging, drop allowed
crNoDrop
TCursor(-13) - dragging, drop disallowed/rejected
crMultiDrag
TCursor(-16) - dragging multiple items
crNo
TCursor(-18)
Splitter Cursors
crHSplit
TCursor(-14)
crVSplit
TCursor(-15)

Other Cursors

crUpArrow
TCursor(-10)
crHourGlass
TCursor(-11) - busy
crSQLWait
TCursor(-17)
crAppStart
TCursor(-19)
crHelp
TCursor(-20)
crHandPoint
TCursor(-21)
Defines special form behavior. An ordinary (overlapping) form. The form is an MDI child. The form is an MDI parent form, containing MDI child forms. The form is in the foreground, on top of all other application forms. The form is used as a Splash form.

Signifies that the form cannot become the main form in an application. Implies that the form responds to fewer messages; generally, paint messages and little else. May affect the border style and even the window class used for the form on some widgetsets.

The form stays system-wide on top.

Used in forms for a modal system dialogs. Prevents another form from having a higher Z-order value than the current one. Generally treated the same as fsStayOnTop except for macOS Cocoa.

Represents border styles available for a Form. A border is not used or displayed. Single line border, the form cannot be resized. The form can be resized (standard). The form is a dialog, cannot be resized. Single line border, small caption, not resizable. Small caption, form can be resized. Possible types of borders (with or without border). TFormBorderStyle Possible types of control borders (with or without border).

A subset of TFormBorderStyle, listing only the styles available to a control that is not a form.

TFormBorderStyle
Possible default actions on special keys. This control is notified when the user presses Return. This control is notified when the user presses Escape. Set type used to store values from the TControlRoleForForm enumeration.

TControlRolesForForm is the type returned from the TCustomForm.GetRolesForControl method.

TCustomForm
Alias for the TGraphicsBevelCut type.

TBevelCut is the type used to represent bevel styles passed as arguments to methods in widgetset classes.

TGraphicsBevelCut
Enumeration with values for logical mouse buttons.

These are logical buttons; the left and right physical buttons can be swapped for left-handed users.

Modified in LCL version 3.0 to be an alias for the TMouseButton type in System.UITypes for FPC 3.2.0 or higher.
Represents the left mouse button. It might be physically the right button if the system is configured to act like that, for example for a left handled person. Represents the right mouse button. It might be physically the left button if the system is configured to act like that, for example for a left handled person. Represents the middle mouse button. Represents the first extra mouse button. Represents the second extra mouse button. Represents the mbLeft enumeration value in TMouseButton. Added in LCL 3.0 as an alias to the constant in System.UITypes for FPC 3.2.0 or higher. Represents the mbRight enumeration value in TMouseButton. Added in LCL 3.0 as an alias to the constant in System.UITypes for FPC 3.2.0 or higher. Represents the mbMiddle enumeration value in TMouseButton. Added in LCL 3.0 as an alias to the constant in System.UITypes for FPC 3.2.0 or higher. Represents the mbExtra1 enumeration value in TMouseButton. Added in LCL 3.0 as an alias to the constant in System.UITypes for FPC 3.2.0 or higher. Represents the mbExtra2 enumeration value in TMouseButton. Added in LCL 3.0 as an alias to the constant in System.UITypes for FPC 3.2.0 or higher. Set of form styles which make a form stay on top. Set of form styles except those which make a form stay on top of all other forms of the system. Highest defined cursor constant (0). Indicates that the default cursor from the system should be utilized. Indicates that the cursor should be invisible. The Arrow cursor, which is the most common and the default one in most cases. A cursor utilized for graphics, for pixel or rectangle selection, often in the shape of a cross. A text cursor, for setting insertion point. Often used in text editors. A generic sizing cursor, to indicate that here one may drag to resize something. Is the same as crSizeAll. A cursor for resizing which runs diagonally from NorthEast to SouthWest (-6). A cursor for resizing which cursor runs from North to South (-7). A cursor for resizing which cursor runs from NorthWest to SouthEast. A cursor for resizing which has an arrow with two points, one to the left and another to the right, to indicate resizing possibility in both directions. A cursor for resizing which has an arrow pointing to the left-top corner, to indicate resizing possibility in this direction. A cursor for resizing which has an arrow pointing upwards, to indicate resizing possibility in this direction. A cursor for resizing which has an arrow pointing to the right-top corner, to indicate resizing possibility in this direction. A cursor for resizing which has an arrow pointing to the left, to indicate resizing possibility in this direction. A cursor for resizing which has an arrow pointing to the right, to indicate resizing possibility in this direction. A cursor for resizing which has an arrow pointing to the left-bottom corner, to indicate resizing possibility in this direction. A cursor for resizing which has an arrow pointing downwards, to indicate resizing possibility in this direction. A cursor for resizing which has an arrow pointing to the right-bottom corner, to indicate resizing possibility in this direction. Up Arrow cursor constant (-10). Busy cursor constant, utilized to indicate that one should wait while an action is done. A cursor to indicate that one can drop a dragged item in this area. A cursor to indicate that one cannot drop a dragged item in this area. Horizontal Splitter cursor constant (-14). Vertical Split cursor constant (-15). Multiple Object dragging cursor constant (-16). Waiting for SQL cursor constant (-17). Shows a negative sign. See also . Application starting cursor. "What's This" Help cursor constant (-20). Pointing hand cursor constant (-21). All Directions sizing cursor constant (-22). Lowest defined cursor constant (-30). Set type used to store TMouseButton values.

TCaptureMouseButtons is a set type used to store TMouseButton enumeration values. TCaptureMouseButtons is the type used to implement the CaptureMouseButtons property in TControl.

Method type for WindowProc handlers. Message with the command constant and key code processed in the handler. Enumerated type with values for features or behaviors for a control.

TControlStyleType is an enumeration type with values that represent features or behaviors that can be enabled or disabled in a control. Zero or more values from TControlStyleType can be stored in the TControlStyle set type used to implement the ControlStyle property in TControl.

When an enumeration value is present in the set, it indicates that the corresponding feature or behavior is enabled for the control. Conversely, when the value is omitted from the set the feature or behavior is disabled.

Indicates that one can add child controls to this control in the form designer. Control focus and style changes when under the mouse cursor. Control handles mouse events at design-time. Control responds to mouse click events. Control has a 3D frame; used on scroll bars in the current LCL version. Indicates that the Caption for a control is updated when a value is assigned to the Name property. As long as Name=Text, changing the Name will set the Caption. When, for example, a button's Name and Caption have the value 'Button1' and the Name is changed to 'Button2' then the Caption is changed as well. When Name and Caption differ, this flag has no effect. This flag has no effect when loading the control using the LCL component streaming mechanism. Control is drawn with a non-transparent background; implementation is widgetset-specific. Indicates that the control understands mouse double click events. Indicates that the control understands mouse triple click events. Indicates that the control understands mouse quadruple click events. Indicates that the control cannot change its width. Indicates that the control cannot change its height (e. g. a combo-box). Indicates that the control is invisible in the form designer. Control can be drawn using the TWinControl.PaintTo method. Key messages are handler by widgetset classes instead of control events. Display images from the drag imagelist during a drag operation over the control. Control responds to size, focus, and dialog messages and can be used as an ActiveX control (Windows). Control includes support for TBasicAction. Control responds to menu and menu item events. Indicates that the control or form cannot receive focus. Indicates that the client area for the control needs to be redrawn including its borders. LCL controls do not use this value in their control styles property. Implemented for JVCL controls and its theme engine. Indicates whether the background for the parent control is used to fill the client area in the control. Used for controls which have a window handle for the parent control and do not use csOpaque in their control style. On some platforms (like WinXP and Windows 7), csParentBackground can be used to reduce flicker when the parent control is resized. WYSIWYG resizing is not used on the design surface. Control cannot be moved or resized on the designer surface. Control executes a default action when the Space or Enter key is pressed. Control executes an action when the Escape key is pressed or the form/dialog is closed using the window decoration. Control cannot be selected at design-time. Child controls owned by this control are not selectable in the designer. If the preferred size is 0x0 pixels then the control is auto-sized; the default minimum client size will be 1x1 pixels. When AutoSize is True, do not move child controls horizontally. When AutoSize is True, do not move child controls vertically. Indicates that a control requires keyboard input to be utilized by the user. Used for the Android (and other) platforms to activate the virtual keyboard when an active control needs to respond to input values. Used primarily for devices that do not have a hardware keyboard. Set type used to store values from the TControlStyleType enumeration.

TControlStyle is a set type used to store zero or more values from the TControlStyleType enumeration. Values from TControlStyleType are included in the set when the corresponding feature or behavior is enabled for a control.

TControlStyle is the type used to implement the ControlStyle property in TControl and descendent classes.

Set of style values which require/provide multiple clicks on a control. State flags of a Control.

TControlStateType is an enumeration type which contains values that represent state information for control class instances, including:

  • csLButtonDown
  • csClicked
  • csPalette
  • csReadingState
  • csAlignmentNeeded
  • csFocusing
  • csCreating
  • csPaintCopy
  • csCustomPaint
  • csDestroyingHandle
  • csDocking
  • csVisibleSetInLoading

Values from the TControlStateType enumeration are stored in the TControlState type, and used to implement the ControlState property in TControl.

Indicates the Left mouse button was down for the control. Indicates the control was clicked; occurs after button down/up processing. Palettes are not currently implemented in LCL. Indicates the ReadState method has been called for the control. Indicates the focus for the control has been changed. Introduced for Delphi compatibility; not used in LCL. Indicates a device context was copied in PaintControls. Indicates a custom paint method is used to draw the control; determines the handler called to paint the control. Used to suppress message processing when the control is freed. Indicates the Dock method has been called for a control. Indicates the control is being loaded using the LCL component streaming mechanism. Set of control states used in a control. Base class which provides a canvas property used in graphic controls.

TControlCanvas is a TCanvas descendant that implements the base class which provides a canvas used in graphic controls. TControlCanvas extends the ancestor class by including a property representing the TControl associated with the canvas, a window handle for the associated control, and the device context for the handle.

TControlCanvas is used in the implementation of classes like TGraphicControl and TCustomControl, and other visual controls.

TCanvas
Sets the value for the Control property. New value for the Control property. Ensures that a handle exists for the class instance.

Calls the inherited method on entry when a value has not been assigned to the Control property.

Otherwise, Control is used to check for an existing device context (HDC) for the class instance. When assigned, its value is copied into the Handle for the control.When not assigned, the HandleNeeded method in TWinControl is called to create the window handle and get its device context. If Control is not derived from TWinControl, its Parent is used to call the HandleNeeded method.

This is done to prevent resource leaks that might occur when directly accessing he window Handle before it has actually been allocated (recursive calls to the method).

If the device context remains unassigned, the GetDeviceContext method in Control is called to get the device context for the window Handle.

TCanvas.CreateHandle
Gets the color value used for clDefault.

GetDefaultColor is used to resolve the default color (clDefault) to the TColor value used for the brush or font on the canvas. The ADefaultColorType argument indicates which value is needed in the return value. See TDefaultColorType for the values available in the argument.

GetDefaultColor is overridden in TControlCanvas to ensure that the Control is used (when assigned) to retrieve the default color by calling its GetDefaultColor method. If Control is not assigned, the inherited method is called to get the default color value (unresolved in the ancestor class).

TCanvas.GetDefaultColor TControl.GetDefaultColor TDefaultColorType
TColor value for the specified color type. clDefault when the Control has not been assigned for the class instance. Identifies whether the font or brush color is resolved in the method. Constructor for the class instance.

Create is the overridden constructor for the class instance. Create calls the inherited constructor, and sets the default unassigned values for the device context, window handle, and control used in the class instance. The device context and window handle are maintained in methods which use the respective members. Use the Control property to set the owner for the class instance.

Destructor for the class instance.

Destroy is the overridden destructor for the class instance. Destroy ensures that a device context allocated for the window handle in Control is freed prior calling the inherited destructor.

Frees the Handle for the control canvas, and its device context when assigned.

FreeHandle is an overridden method in TControlCanvas. It calls the inherited method on entry to set the value in Handle to 0 (the unassigned value). If a device context (DC) has been allocated for the window handle (HWND), the ReleaseDC routine is called to release the device context.

FreeHandle is called when a new value is assigned to the Control property, or when the class instance is freed.

TCanvas.Handle TCanvas.FreeHandle ReleaseDC
Indicates if the Control has called but not completed its Paint method.

ControlIsPainting is a Boolean function which indicates if the Control has called but not completed its Paint method. ControlIsPainting returns True when the Control has been assigned (contains a non-Nil value) and its IsProcessingPaintMsg method returns True.

ControlIsPainting is used in the implementation of the CreateHandle method.

True when the Control has been assigned is repainting. The Control object for which the Canvas is used.

Control is a TControl property which represents the control associated with the canvas in the class instance. Setting the value in Control causes an existing Window handle (and its device context) in the class instance to be freed. The handle and its device context are recreated (eventually) when the control is displayed.

Pointer to a THintInfo instance.

PHintInfo is a Pointer to a THintInfo instance. PHintInfo is the type passed as an argument to the TControlShowHintEvent event handler procedure, and the DoOnShowHint method in TControl.

Contains content and state information for Hints displayed for a window or control. Control for the hint display. Window class for the hint display. TPoint with the screen coordinates for the hint display. Maximum width for the hint. Color for the hint window. Rectangle with the coordinates and size for the cursor. TPoint with the location for the mouse cursor. If set to a value greater than Zero (0), call after value milliseconds OnShowHint again. Used to update the hint text display after the specified delay while it is showing. Duration in milliseconds for the hint display. String value displayed as a hint for the associated control. Pointer to the data used to derive the hint text. Helper class for TCustomImageList useful for images on TControl instances.

TImageListHelper is a helper class for TCustomImageList. TImageListHelper extends TCustomImageList to provide additional properties and methods that are useful when working with TControl class instances.

Use the overloaded DrawForControl method to render an image from the multiple resolution image list to a control canvas.

Use the ResolutionForControl property to access a scaled image resolution with images of a specified width used on a control instance.

TCustomImageList
Gets the value for the ResolutionForControl property. Value for the property. ImageWidth desired in the scaled image resolution. Control which provides the PPI display density for scaled images in the resolution. Draws an image scaled to the display density (PPI) for the specified control.

DrawForControl is an overloaded procedure used to draw the specified image scaled to the display density (PPI) for the specified control. DrawForControl calls the DrawForPPI method in the image list to render the selected image using the display density and drawing effect required.

ACanvas contains the control canvas where the image is drawn. AX and AY contains the left and top coordinates on the canvas where the image is drawn.

AIndex specifies the ordinal position in the scaled image list for the image drawn in the method.

AImageWidthAt96PPI contains the width for the image at 96 PPI. The actual image width is scaled to the display density using scaling factor required for the control.

AControl contains the TControl instance that provides the display density and canvas scaling factor required for the image.

When AEnabled is True, the image is drawn using its Enabled state. Otherwise, it is rendered using the disabled state.

ADrawEffect contains the TGraphicsDrawEffect used when rendering the image to the control canvas.

TCustomImageList.DrawForPPI
Canvas where the image is drawn. Horizontal position on the canvas where the image is drawn. Vertical position on the canvas where the image is drawn. Ordinal position for the image drawn in the method. Image width using the standard display density. Control with the display density (Font PPI) and canvas scaling factor used in the method. Indicates the image is drawn in the enabled state when True. Indicates the TGraphicsDrawEffect applied to the image. Provides access to an image resolution with the specified width scaled to the display density for a control.

ResolutionForControl is a read-only TScaledImageListResolution property which provides access to a scaled image resolution suitable for the control in AControl. AImageWidth contains the image width requested from the multi-resolution image list. AControl contains the TControl instance which provides the display density (PPI) and the scaling factor used to generate the scaled image resolution.

TScaledImageListResolution
Image width requested in the image list Control which provides the display density and scaling factor for the scaled image resolution. Implements an image list resolution with features used in Drag and Drop operations.

TDragImageListResolution is a TCustomImageListResolution descendant which implements an image list resolution with features used in Drag and Drop operations. TDragImageListResolution is used in the implementation of TDragImageList.

Gets the value for the ImageList property. Value for the property. List with images used in Drag and Drop operations.

ImageList is a read-only TDragImageList property which provides access to the images used for Drag and Drag operations, and methods used to render the images.

"
Constructor for the class instance.

Create is the overridden constructor for TDragImageListResolution. Create calls the inherited constructor using TheOwner as the owner for the class instance. Create sets the initial the values for internal members in the class instance.

TComponent.Create
Owner of the new class instance. Gets the HotSpot for the image resolution.

GetHotSpot is an overridden TPoint function which gets the HotSpot for the image list resolution. GetHotSpot uses the value from the DragHotspot property. It contains the screen coordinates where the Drag and Drop operation was started. X is is the horizontal position, and Y is the vertical position in the TPoint type.

Value for the HotSpot. Starts display of images in the resolution for a Drag and Drop operation.

BeginDrag is a Boolean function used to start display of images in the resolution for a Drag and Drop operation. The return value is True if the widgetset successfully received the BeginDrag notification.

No actions are performed in the method if the widgetset class does note successfully start the drag operation.

BeginDrag calls the DragLock method to lock the window handle for the control, and to start displaying the drag image for the operation. The current screen cursor is captured, and the DragCursor in ImageList is displayed for the operation.

True if the Drag operation was successfully started. Window handle where images are displayed for the operation. Horizontal screen position where the operation was started. Vertical screen position where the operation was started. Shows the Drag image and optionally locks the Window handle during the Drag operation. True if the drag operation was started or the drag image position was updated. Window handle used as the lock handle when not already assigned. Horizontal coordinate for the drag image. Vertical coordinate for the drag image. Moves the drag image to the specified position.

DragMove is a Boolean function used to move the drag image in the resolution to the position specified in the X and Y arguments.

The return value indicates that the Dragging property is already set to True, and that the widgetset class was able to perform the move operation. An internal member with the last position for the drag image is updated when the method is successfully completed.

DragMove is called from the corresponding method in TDragImageList.

True if the drag image is already active and its position is updated in the widgetset class. New horizontal coordinate for the drag image. New vertical coordinate for the drag image. Hides the Drag image and removes the update lock for the Window. Removes the drag lock and restores the saved cursor when the drag operation has ended.

EndDrag is a Boolean function used to remove the drag image from the image resolution. EndDrag calls the DragUnlock method to hide the drag image, and to reset the internal lock window and drag position used in the class instance. The corresponding method (EndDrag) in the widgetset class is called.

Dragging is set to False prior to exit from the method. EndDrag restores the previous cursor shape by calling the EndTempCursor method in the Screen singleton.

No actions are performed in the method if Dragging is set to False.

The return value contains the value from the Dragging property on entry into the method.

EndDrag is called from the EndDrag method in TDragImageList.

Value in the Dragging property on entry. Notifies the widgetset class to hide the drag image.

Hides the drag image in the resolution without unlocking the window. No actions are performed in the method if Dragging is set to False.

HideDragImage is called from the HideDragImage method in TDragImageList.

Notifies the widgetset class to display the drag image.

Displays the drag image from the image resolution. No actions are performed in the method if Dragging is set to False.

ShowDragImage is called from the ShowDragImage method in TDragImageList.

Contains the mouse position for the drag image.

DragHotspot is a TPoint property which contains the mouse position for the Drag hotspot. It contains the value read and written using the DragHotspot property in the TDragImageList for the image resolution. It is also updated when the SetDragImage method in TDragImageList is called to update the index position for the drag image.

Indicates that BeginDrag has been called for the image resolution. A multi-resolution list of Images used during Drag operations.

TDragImageList is a TCustomImageList descendant which provides a multi-resolution container for images displayed when a drop-drop operation is active. A drag image is shown when a drag operation is active and a DragImageList has been supplied.

TDragImageList overrides and reimplements methods from the ancestor to support the TDragImageListResolution type used in the image Resolution property. Additional properties and methods are provided to work with a drag image and its hot spot when the operation is started or stopped, and when the mouse position is changed.

In drag-dock operations, a drag image is not typically displayed since the DockRect frame already provides visual feedback.

This is a general overview of the usage of this class:

  • SetDragImage selects an image from the list, and defines the hotspot within this image. Te hotspot typically is the offset of the mouse position to the origin of the dragged control.
  • BeginDrag starts dragging, the image is shown at the starting location.
  • DragMove moves the image.
  • EndDrag stops dragging, the image is removed from the screen.

TDragImageList is the ancestor for the TImageList class defined in the LCL. It is also the type returned from the GetDragImages method in TControl.

TCustomImageList
Position where the image was last painted. The window whose updates are locked while dragging. Sets the value for the DragCursor property. New value for the DragCursor property. Gets the value for the DragHotSpot property. TCustomImageList.GetHotSpot Value for the DragHotSpot property. Sets the value for the DragHotSpot property. New value for the DragHotSpot property. initializes the cursor shape and image index for the list.

Initialize is an overridden method in TDragImageList. It calls the inherited method on entry. It sets the default values in DragCursor (crNone) and the internal selected image index (0).

TCustomImageList.Initialize
Start dragging an image; returns True if successful. Locks a window for updates, remembers the current cursor shape, and sets the new cursor shape. True if successful. The associated window. The mouse position. The mouse position. Show drag image during drag operation. True if Dragging and image shown. The locked window. The mouse position. The mouse position. Shows the drag image at a new location. True if Dragging and image moved. The new mouse position. The new mouse position. Hide the drag image. Finish dragging of the image, restore the old cursor shape. True when dragging was started before. Hides the drag image without unlocking the window.

Calls the HideDragImage method in DraggingResolution. No actions are performed in the method when an image resolution is not available in the DraggingResolution property.

Set index of dragged image and hotspot. Always True. List index of the image to use. Offset from mouse position to image position. Offset from mouse position to image position. Displays the drag image.

Calls the ShowDragImage method in DraggingResolution. No actions are performed in the method when an image resolution is not available in the DraggingResolution property.

The cursor shape to use while dragging. The position of the HotSpot image, i.e. the offset to the mouse position while dragging. True if dragging in progress. Gets the scaled image resolution with the drag images for the list. Gets the image resolution for the specified image width.

Resolution is a read-only indexed TDragImageListResolution property which provides the image resolution for images with the width specified in AImageWidth. Reading the property value causes the image resolution to be cast to the required TDragImageListResolution type.

Image width requested in the image resolution. Defines an event handler for key events.

TKeyEvent is an object procedure type which specifies a handler for key events.

TKeyEvent is the type used to implement the OnKeyDown and OnKeyUp event handlers in TWinControl. Applications must implement an object procedure using the signature for the event, and assign it to the event handler to respond to the notification.

See for the handler used to implement OnKeyPress events.

TObject for the key event. ScanCode for the key in the event. TShiftState modifier for the specified key. Specifies an event handler for key press events.

TKeyPressEvent is an object procedure type that defines an event handler for key press events.

TKeyPressEvent is the type used to implement the OnKeyPress event handler in TWinControl. Applications must implement an object procedure using the signature for the event handler, and assign it to the property to respond to the event notification.

TObject for the event notification. Character value for the key press in the event notification. Specifies an event handler for UTF-8-encoded key press events.

TUTF8KeyPressEvent is an object procedure type which specifies an event handler for UTF-8-encoded key press events.

TUTF8KeyPressEvent is the type used to implement the OnUTF8KeyPress event handler in TWinControl. Applications must implement an object procedure using the signature for the event handler, and assign it to the property to respond to the event notification.

TObject for the event notification. Value for the UTF-8-encoded character in the key press event. Specifies an event handler used to respond to mouse button events.

TMouseEvent is an object procedure type which specifies an event handler for mouse button events.

TMouseEvent is the type used to implement the OnMouseDown and OnMouseUp event handlers in TControl. Applications must implement an object procedure using the signature for the event handler, and assign it to the property to respond to the event notification.

TObject for the event notification. Mouse button for the event notification. Modifier applied to the mouse button. Horizontal position for the mouse cursor in the button event. Vertical position for the mouse cursor in the button event. Specifies an event handler used to respond to mouse movement events. TObject for the event notification. Key modifier in effect for the event. Horizontal mouse coordinates. Vertical mouse coordinates. Specifies an event handler used to respond to mouse wheel events. The control under the mouse. State of the modifier keys and mouse buttons. How many notches the wheel has been turned. The mouse position, in client coordinates. Set Handled to True when the event was handled. Type of OnMouseWheelUp/Down event handlers. The control under the mouse. State of the modifier keys and mouse buttons. The mouse position, in client coordinates. Set Handled to True when the event was handled. Specifies an event handler used to get the caption for a docked control.

TGetDockCaptionEvent is an object procedure type which specifies an event handler used to get the caption for a docked control. It allows a value other than the Caption for a control to be displayed when a control is docked.

Use AControl to examine properties for the docked control. Assign a value to the ACaption argument to set the docking caption for the control.

TGetDockCaptionEvent is the type used to implement the OnGetDockCaption event handler in TWinControl. Applications must implement an object procedure using the signature for the type, and assign it to the property to allow responding to the event notification.

TObject for the event notification. Control with the default caption value. Caption to use for the docked control. Indicates whether the control performs drag-drop or drag-dock operation.

TDragKind is an enumeration type with values that indicate the action performed when the mouse is used to start a drag operation.

TDragKind is the type used to implement the Dragkind property in TControl.

Modified in LCL 3.0 to be ab alias to TDragKind in System.UITypes for FPC 3.2.0 or higher.
Drag operation is for drag-and-drop. Drag operation is for drag-and-dock. Indicates whether a drag operation can start automatically. Modified in LCL 3.0 to be an alias to TDragMode in System.UITypes for FPC 3.2.0 or higher. Dragging can start only by explicit code. Dragging starts when the left mouse button is pressed on the control. Values representing State changes for a drag operation. These values are sent in drag messages, allowing the control to perform special actions when the mouse moves over, enters, or leaves the control. Modified in LCL 3.0 to be an alias to TDragState in System.UITypes for FPC 3.2.0 or higher. Mouse has just entered the control. Mouse has just left the control. Mouse is moving over the control. Message types used in DragManager.

All messages are sent to the target control, except dmDragDrop and dmDragCancel is sent to the source control.

dmDragEnter
Mouse enters control
dmDragLeave
Mouse leaves control
dmDragMove
Mouse moves over control (after dmDragEnter)
dmDragDrop
Control dropped
dmDragCancel
Dragging aborted
dmFindTarget
Find child control under the mouse
Modified in LCL 3.0 to be an alias to TDragMessage in System.UITypes for FPC 3.2.0 or higher.
mouse enters control. mouse leaves control. mouse moves over control (after dmDragEnter). control dropped. dragging aborted. find possible target control under the mouse. The type of an OnDragOver handler.

An OnDragOver event is sent by a control, when an object is dragged over it. The handler can specify whether a drop will be accepted or rejected.

Source is polymorphic, can be either the DragObject or the dragged control! This depends on DragObject.AutoCreated, for no sane reason.
The possible drop target (control). The object (TDragObject or TControl) being dragged. X coordinate of the mouse on screen. Y coordinate of the mouse on screen. The current DragState (entering, leaving or moving over the target). Set Accept to False to reject an drop (default is True). The type of an OnDragDrop notification handler. An OnDragDrop event is generated by the target control, on the drop of a dragged object. The target control of the drop. The dragged control. The client coordinates of the drop. The client coordinates of the drop. The type of an OnStartDrag handler.

An OnStartDrag event is generated for a control when it is dragged and its DragKind is dkDrag. The handler can provide a specific DragDrop object. Otherwise, a standard TDragDropObjectEx is automatically created by the DragManager.

The control to be dragged. Supply your own DragObject, or leave it Nil for automatic creation. The type of an OnEndDrag handler.

An OnEndDrag event is sent for a dragged control, when the drag operation is finished. This happens regardless of whether the operation was drag-drop or drag-dock, and whether the operation ended with a drop or was cancelled.

Check for an unassigned value in Target to distinguish between a drop and a cancelled operation (Nil).

The dragged control. The drop target (control), or Nil if cancelled. The mouse coordinate, in client coordinates if dropped, else in screen coordinates. The mouse coordinate, in client coordinates if dropped, else in screen coordinates. Base class for managing drag operations and user feedback.

Every dragging operation has an associated DragObject, holding references to the source and target controls, and other parameters for the customization of the visual user feedback.

A default DragObject is created automatically when a dragging operation starts, and is destroyed when the operation has ended; you do not need to maintain it. But an application can provide a customized DragObject in the or handlers for the source control (the one being dragged).

AutoCreated DragObjects imply different behavior in the DragOver and DragDrop events, where the Source becomes the dragged control, while the DragObject itself is passed as Source.

TDragObject is the ancestor of a whole tree of dragging objects, with the main branches supporting either drag-drop or drag-dock operations. The type of the operation is determined using the property in the source control.

In contrast to the Delphi implementation, Lazarus has moved a couple of methods into the drag performers; these methods are no longer available for customization.

A Lazarus DragObject mainly supplies the cursor and images, used in visual user feedback. Drag-drop operations typically signal acceptance of an possible drop by variations of the mouse cursor, and optionally can attach to it shapes of the dragged object(s). Drag-dock operations instead show a docking rectangle, that snaps to possible target locations when the mouse moves over docksites.

Called when a dragging operation ends. The default implementation calls Control.DoEndDrag, which in turn invokes an OnEndDrag handler. The control onto which the dragged object is dropped (can be Nil). Horizontal mouse coordinate when the method is called. Vertical mouse coordinate when the method is called. Returns a list of images for dragging.

The returned provides methods for the selection and display of an image shown while dragging. This implementation returns Nil, and must be overridden (e.g. in TDragControlObject).

The ImageList to use, is Nil by default! Returns the dragging cursor type (shape).

In drag-drop operations the cursor signals acceptance or rejection of an drop, depending on Accepted.

The cursor to show. Which cursor to return (rejected: crNoDrop or accepted: crDrag). Horizontal coordinate for the drag cursor. Vertical coordinate for the drag cursor. Constructor for the class instance.

Create is the constructor for the class instance. It stores the value from the AControl argument to the Control property.

The control being dragged. Special constructor which enforces destruction of the object at the end of the dragging operation.

This constructor sets the AutoCreated and AutoFree flags. AutoFree is tested by the DragManager at the end of the dragging operation.

The control being dragged. Asks the image list to hide the drag image.

Calls the GetDragImages method to get the TDragImageList instance with the images displayed for the Control during drag and drop / dock operations.

Please note that the image list is always unassigned (Nil) in TDragObject; it is provided by an overridden method in descendent classes like TDragControlObject.

Asks the image list to show the drag image. Should the image of dragged objects always be shown? This is another chance for enforcing the display of a drag image, even if a drop is acceptable. Was the drag object created automatically? This property is of little use, more important is the AutoFree property. Indicates whether the object shall be destroyed at the end of the dragging operation. This is a Lazarus specific property, introduced to get rid of the special Delphi TDrag...Ex classes. The control that is dragged (source). Current mouse position in screen coordinates. The control over which the object currently is dragged (target). Mouse position in client coordinates of the DragTarget. Indicates whether the drag object has been dropped yet. Contains False while dragging is in progress, or when dragging has been aborted. A class type. Extends TDragObject to automatically free itself in the DragManager.

TDragObjectEx is a TDragObject descendant. It provides an overridden constructor which sets the AutoFree property to True.

Constructor for the class instance.

Create is the overridden constructor for the class instance. Create sets the value in AutoFree to True. AutoFree is tested by the DragManager at the end of a dragging operation.

Control for the class instance. A drag object for dragging a control.

While a TDragObject can be used for dragging controls, this class knows that it drags a control, and asks it for a DragCursor and DragImages.

Asks the Control to provide a drag cursor.

Called when a TDragPerformer repositions the the mouse pointer during an active drag operation.

TCursor shape used as the drag cursor. crDrag when Accepted. crNoDrop when not Accepted. True when the dragged object can be dropped at the specified position. Horizontal coordinate for the mouse pointer. Vertical coordinate for the mouse pointer. Asks the Control to provide an ImageList. The Image list to be used in dragging this control. Constructor for the class instance. The control to drag. Orientation of DockZones and docked controls, similar to

This is a Delphi relic, bound to TDockTree and not very useful in application code. All DockZones in a DockTree have an orientation, horizontal or vertical, indicating how controls are arranged in the dock zone. When a control is docked into a zone, it obtains the orientation of that zone.

The orientation for the control can be stored as the opposite for the dock zone, depending on the DockManager used.
no orientation applies (like alNone). siblings are arranged horizontally, children top-to-bottom. siblings are arranged vertically, children left-to-right. children are pages in a tabbed control. The type of an OnDockDrop handler.

An OnDockDrop event is sent by the drop target (dock site) on the drop of a dragged object.

The drop target (docksite control). The DragDock object, containing information about the dragged object. The type of an OnDockOver handler.

An OnDockOver event is sent by a dock site, when an object is dragged over it. The handler can specify whether a drop will be accepted or rejected.

The possible drop target. The type used for OnUnDock event handler.

An UnDock event is sent by a dock site, and occurs before a control is undocked. The handler can reject undocking, by setting Allow to False.

The docksite from which the object is undocked. The control to be undocked. The new docksite for Client, Nil when undocked into floating state. Set Allow to False to reject undocking. The type of an OnStartDock handler.

An OnStartDock event is sent by a control when it shall be dragged and its DragKind is dkDock. The handler can provide a specific DragDock object, else a standard TDragDockObjectEx is automatically created by the DragManager.

The control being dragged. Supply your own TDragDockObject, or leave it Nil to request automatic creation. An OnGetSiteInfo handler returns information about a docksite.

An OnGetSiteInfo event is sent by the DragManager to all docksites. The handler can adjust the snapping rectangle (InfluenceRect), and can reject an drop.

The dock site near the mouse pointer. The dragged control. The screen rectangle where a drop or mouse move is directed to this docksite. The current position of the mouse. Set CanDock to False to reject docking. Event handler used to draw the docking image in a drag and dock operation.

TDrawDockImageEvent is an object procedure type which specifies an event handler used to draw the docking image for TDragDockObject instances. TDrawDockImageEvent is the type used to implement the OnDrawDockImage variable in the Controls unit.

Object (TDragDockObject) for the event notification. Rectangle with area cleared in the handler routine. Rectangle with area drawn in the handler routine. Operation performed for the notification. Valid values are: disShow, disMove, disHide. Routine used to draw dock images in drag/dock operations

OnDrawDockImage is a TDrawDockImageEvent variable which contains the default routine used to draw the docking image in a drag/dock operation. It is used in TDragDockObject methods which draw docking images likes HideDockImage, ShowDockImage, and MoveDockInage.

A drag object for drag-dock.

This object type serves two main purposes: it allows one to distinguish between drag-drop and drag-dock operations, and it implements docking specific information and behavior.

The primary use is for tree docking, as assumed by methods in TControl and TWinControl.

Adjust the DockRect relative to the dragging hotspot (DockOffset). The parameter type is bad, should be var. Ignore it please.

The default implementation adjusts the stored FDockRect, by DockOffset. This adjustment will make the DockRect appear right over the control, when dragging starts, regardless of where the user clicked onto the control.

You will rarely need to override this method, since the DockRect is adjusted by every target site's DockManager later.

Not used; please ignore it. Gets the drag cursor shape for the class instance. TCursor shape used as the drag cursor. crDrag when Accepted. crNoDrop when not Accepted. True when the dragged object can be docked at the specified position. Horizontal coordinate for the mouse pointer. Vertical coordinate for the mouse pointer. Finish docking. Invokes Control.DoEndDock. The target docksite, or Nil to make the Control float. Horizontal coordinate for the mouse pointer. Vertical coordinate for the mouse pointer. Initializes the dragging coordinates.

Determines the hotspot offset for adjusting the floating DockRect. Since the undocked extent of the control doesn't change while dragging, we fix the hotspot offset here.

Usage:

OffsetRect(DockRect, FDockOffset);
Shows the DockRect, and remembers the coordinates in EraseDockRect. Hides the DockRect, and invalidates EraseDockRect to prevent further erases. Moves an already visible DockRect.

Checks the DockRect for changes against EraseDockRect, to prevent flicker. Remembers the drawn frame coordinates in EraseDockRect.

Checks for an assigned OnDrawDockImage event handler.

HasOnDrawImage is a Boolean function used to determine if an event handler has been assigned to the OnDrawDockImage property. The return value is True if a routine has been assigned to the property. If an event handler has not been supplied, the HintDockImage routine is assigned to the event handler, and the return value is set to True.

For platforms where the Alpha blending is not enabled for Forms, the return value is always False (determined by calling GetSystemMetrics for the SM_LCLHasFormAlphaBlend metric in the widgetset class).

HasOnDrawImage is used in methods like ShowDockImage, HideDockImage, and MoveDockImage.

True when an event handler has been assigned to OnDrawDockImage. The hotspot offset of the dragged DockRect. Screen coordinates for a possible drop location.

DockRect gives feedback to the user where the dragged control may be dropped. When no docksite signals acceptance, the DockRect uses the floating state of the dragged control. When a drop will dock the control, the DockRect signifies the approximate position for the docked control.

How the dragged control will be docked, relative to the target control.

When the target is a DockTree, DropAlign indicates the placement of the control relative to DropOnControl. Other docking methods require a specialized (derived) DragDockObject.

The already docked control, relative to which the dragged control will be docked. Nil for an empty docksite. The final state of the dragged control (after drop).

True when the dragged control becomes or stays floating.

Indicates whether the dock site is enlarged after a Control has been docked.

The property value is assigned when the ManualDock method is called for the Control. It is set to the inverse of the KeepDockSiteSize argument passed to the ManualDock or ManualFloat methods in Control. The value is not, however, subsequently used in the current LCL implementation.

Area to be erased when refreshing the display for the docking rectangle.

EraseDockRect is a TRect property that represents the area to be erased when redrawing the docking rectangle. The value in EraseDockRect is assigned in InitDock, and updated to contain the value from DockRect when the docking rectangle has been altered in methods like ShowDockImage, HideDockImage, and MoveDockImage.

EraseDockRect is passed as an argument to OnDrawDockImage, and to the underlying widgetset class.

A drag object for docking that is automatically destroyed after use. Constructor for the class instance.

Create is the overridden constructor for the class instance. It calls the inherited constructor on entry to assign the value in AControl to the Control property. It sets the default value for the AutoFree property to True.

Control for the drag and drop / dock operation. The abstract base class used to manage dragging of controls (for drop or dock operations).

TDragManager specifies an object-oriented version of the Delphi drag manager. It is implemented by the TDragManagerDefault descendant.

The registered dock sites should be stored in a persistent list, not in a DragManager instance.
Handler for keyboard key released.

When the Ctrl key is released, a drop is enabled again.

Virtual key code for the key up event. Shift, Ctrl, or Alt modifier for the key up event. Handler for keyboard key pressed.

When (and while) the Ctrl key is pressed, dropping is disabled. The Esc key aborts the current dragging operation immediately.

Virtual key code for the key down event. Shift, Ctrl, or Alt modifier for the key up event. Aborts the dragging operation when the capture control has changed.

CaptureChanged is an abstract virtual method in TDragManager, and must be implemented in a descendent class. In the default drag manager implementation, the DragMode and DragKind properties for child controls are checked to determine if one of them has the mouse capture. If none of them are active, the Parent control calls DragStop.

CaptureChanged is called from the CaptureChanged method in TControl when the LM_CaptureChanged message is received by the control and the drag manager is active.

Control which has the mouse capture change message is handled for the control. Generates visual feedback for mouse movement in a drag operation. Ctrl, Alt, Shift modifier for the mouse movement. Horizontal coordinate for the mouse pointer. Horizontal coordinate for the mouse pointer. Ends a drag operation when a mouse up event has occurred.

MouseUp is an abstract virtual method in TDragManager. It must be implemented in a descendent class to perform actions needed for the notification.

Mouse button for the notification. Ctrl, Shift, or Alt modifier for the notification. Horizontal pointer position when the mouse event was detected. Vertical pointer position when the mouse event was detected. Performs actions when the drag manager needs to respond to a mouse button down event.

MouseDown is an abstract virtual method in TDragManager. It must be overridden in a descendent class to perform actions need for the drag manager implementation.

In the LCL, the drag managers are implementation classes like TDragManagerDefault. This derived classes ignores the button down event in the drag manager to prevent a premature end to a drag operation. The button down event has already been initiated in the message processing loop in TControl. MouseUp handles ending the drag operation.

Mouse button for the mouse button down event. Shift, Ctrl, or Alt modifier for the mouse button down event. Horizontal coordinate for the mouse pointer when the button down event occurred. Vertical coordinate for the mouse pointer when the button down event occurred. Initializes the drag parameters to Delphi-compatible values.

The Delphi VCL sets DragImmediate to True and DragThreshold to 5.

A docking operation never should start immediately.
Owner of the class instance. Check if dragging is in progress. True if dragging. Indicates whether the specified control is the active drag object in the drag manager.

Dragging is an abstract virtual method in TDragmanager. It must be implemented in a descendent class to perform actions needed in the method.

Use IsDragging to determine whether a drag performer is active in the drag manager for a(ny) control.

True if the specified control is being dragged. Control compared to the drag object to get the return value. Adds the control to the list of registered docking sites. This should become a class method, maintaining the list of registered docking sites outside any DragManager instance. The DockSite to register. True for adding, False for removing the site. Starts a drag operation for a control.

A DragObject must be created, depending on the Control.DragKind. The mouse has to be captured, and visual feedback must be initialized.

The control that initiates the drag operation. False when dragging should start only when the mouse is moved (delayed). How much the mouse must move before delayed dragging starts. Updates the visual dragging feedback. Mouse position in screen coordinates. Ends dragging.

The visual feedback is reset.

All related controls are notified of the outcome of the operation (drop, dock, abort).

Finally all temporary objects are destroyed.

False when dragging was aborted. Indicates if the mouse coordinates are within the drag threshold for the specified control.

CanStartDragging is an abstract virtual Boolean function used to determine if the mouse has been moved beyond the threshold that initiates a drag operation. The result is True when the mouse coordinates in X and Y are located within the client rectangle and within the threshold for the specified control in Site.

CanStartDragging must be implemented in a descendent class, like the TDragManagerDefault class in the implementation for the unit.

Start dragging immediately on MouseDown. This is the default value for e.g. BeginDrag. The threshold for mouse movement before delayed dragging starts (default is 5 pixels). The current DragManager (always TDragManagerDefault). A DragManager must be implemented in the Controls unit; it requires access to private members in the classes declared in the unit. The layout manager for a docksite.

TDockManager is an abstract class for managing the controls on a dock site. Every docksite can have a DockManager, which arranges the docked controls. See TDockTree for more info.

Creates an DockManager for ADockSite. This is the TWinControl acting as the docksite. Starts updating the DockSite layout. Finishes updating the DockSite layout. Returns the zone bounds of a docked control.

The TDockTree manager returns the bounds of the dockzone, including the dock header.

When the Control is not docked, an empty Rect(0,0,0,0) is returned.

The docked control. The enclosing rectangle, in client coordinates of the docksite. Determine the DropAlign.

ADockObject contains valid DragTarget, DragPos and DragTargetPos relative dock site. DockRect is undetermined.

DropOnControl may be Nil if nothing has been docked yet, or no target control exists at the mouse coordinates.

Returns True if ADockObject.DropAlign has been determined. If False, the DropAlign has to be determined by default procedures.

True if the DropAlign was determined. The DragDockObject holding all information about the drag-dock operation. Position DropCtl relative Control, using the alignment specified by InsertAt.

InsertControl determines the placement of the just docked control, forcing a repaint of the container control if necessary.

When SetReplacingControl has been called with a non-Nil Control before, the dropped control only should replace that control.

An overloaded version passes the DragDockObject to the dockmanager, allowing to pass more information about the drop. It allows one to implement other than tree-style docksites.

The control relative to which insert. How to insert relative to Control. The control to insert. The DragDockObject holding all information about the drag-dock operation. Restores the layout of the docksite from the specified stream.

The controls to be docked can be retrieved by using ReloadDockedControl in the docksite. This method returns only existing controls of the given name, owned by the owner of the docksite, by default.

The stream with the layout information. Handles the messages sent to a docksite.

This handler must handle all mouse messages, related to the client area of the docksite that is not covered by docked controls (dock headers, et. al.).

Handling mouse messages while dragging is not required. Painting of the docksite has to be implemented in PaintSite.

The message to be processed. Handles special painting of the docksite.

While the docked controls paint themselves, the eventual dockheaders and other decorations have to be painted by the DockManager.

The device context, used to paint. Determines the DockRect while dragging a control over the docksite.

This method updates DockRect to provide visual feedback when a control is dragged over the docksite. The initial DragDockObject.DockRect spans the entire DockSite.

The Delphi-compatible version only can use the parameters determined by the default processing in the docksite.

The Lazarus version can update the DockObject with better-suited parameters. A DockManager here can implement any algorithm for the placement of a dropped control. The default implementation calls the Delphi compatible version. When you override the Lazarus version, you may have to determine the dock sibling and DropAlign again, when the default determination (in TControl and TWinControl) is inappropriate.

The dropped control. The control relative to which Client shall be docked; Nil for docking into the docksite. How to dock, relative to DropCtl. The screen rectangle of the docksite, to be adjusted by this method. The DragDockObject holding all information about the drag-dock operation. Removes the undocked control from the docksite layout.

When SetReplacingControl has been called with a non-Nil argument before, the layout of the docksite should not be changed. Instead, the next inserted control should take the place and role of this control.

Control to remove. Refreshes the layout for the dock site.

This method typically notifies the DockManager when the DockSite calls its Resize method. When the extent of the docksite has changed, the DockManager should reposition and resize all docked controls accordingly.

The layout always should be refreshed when Force is True. This is required when e.g. the visibility of docked controls has changed, but not the size of the docksite.

When True, always update the layout. Saves the docksite layout to Stream. Write the layout information into this stream. Specifies the control to be replaced subsequently.

This method is called by ReplaceDockedControl, to announce a pending replacement of Control by another control. The next RemoveControl should be ignored, and InsertControl should only exchange the controls, without reorganizing the layout of the docksite. When Control is Nil, this call signals the end of the exchange [obsolete].

The name "SetReplacingControl" is a misnomer, it should read "SetControlToBeReplaced".

The intended purpose of this method is the replacement of a docked control by a Notebook, preserving the DockZone. This operation should be handled by an DockManager internally, and calls to this method should be ignored.

The control to be replaced later. Returns True if the DockManager should be destroyed together with the docksite.

This is a Lazarus-specific extension of the Delphi TDockManager. It allows multiple docksites to share the same DockManager instance.

True if the DockManager should be destroyed together with the docksite. Determines whether the specified control is a windowed control using the current dock manager. When the return value is True, the Control can be docked using the dock manager. True when Control can be docked using the dock manager. Control examined in the method.

CanBeDoubleDocked is a Boolean function. CanBeDoubleDocked always returns True in TDockManager.

Always returns True in TDockManager. Can be overridden in descendent classes. The DockManager class type, for use when a DockManager is automatically created. Range for control size constraints. Enumerated type with options used in TSizeConstraints. Not used in the current LCL Implementation. Set type used to store values from the TSizeConstraintsOption enumeration.

TSizeConstraintsOptions is a set type used to store zero or more values from the TSizeConstraintsOption enumeration. TSizeConstraintsOptions is the type used to implement the Options property in TSizeConstraints.

Holds maximum and minimum values that can be used in sizing objects. Sets the value for the Options property. New value for the Options property. Signals an OnChange handler if assigned. Copies property values to the specified persistent object. TPersistent.Assign Persistent object where property values are stored. Sets the value for the MaxHeight property. New value for the MaxHeight property. Sets the value for the MaxWidth property. New value for the MaxWidth property. Sets the value for the MinHeight property. New value for the MinHeight property. Sets the value for the MinWidth property. New value for the MinWidth property. Constructor for the class instance. TControl instance where the size constraints are applied. Asks the interface for size constraints. Used by the LCL interface to set the widgetset constraints.

Should only be used by custom components, not by applications.

Determines the minimum applicable width, given the local and interface constraints. Zero means no constraints. Determines the minimum applicable height, given the local and interface constraints. Zero means no constraints. Determines the maximum applicable width, given the local and interface constraints. Zero means no constraints. Determines the maximum applicable height, given the local and interface constraints. Zero means no constraints. Determines the constrained Width, and transfers it to the widget. The constrained width. The suggested width. Determines the constrained Height, and transfers it to the widget. The constrained height. The suggested height. Adjusts width and height values in the class using the specified scaling factors. Scaling factor applied to width values. Scaling factor applied to height values. The maximum height allowed by the widget. The maximum width allowed by the widget. The minimum height allowed by the widget. The minimum width allowed by the widget. The Control to which these constraints apply. Options used to determine the size constraints. Event handler for a change in the constraints. The maximum height. The maximum width. The minimum height. The minimum width. Specifies an event handler signalled to resize a control to the specified size constraints.

TConstrainedResizeEvent is an object procedure type that specifies an event handler signalled to resize a control to the specified size constraints. The handler routine can update the values in the MinWidth, MinHeight, MaxWidth, and MaxHeight arguments if needed.

TConstrainedResizeEvent is the type used to implement the OnConstrainedResize event in TControl.

TObject for the event notification. Variable argument with the minimum width for the resize event. Variable argument with the minimum hright for the resize event. Variable argument with the maximum width for the resize event. Variable argument with the maximum height for the resize event. Alias to the Integer type.

TSpacingSize is an alias for the Integer type. TSpacingSize is used for values that represent spacing around or between controls. TSpacingSize is the type used to implement properties in TControlBorderSpacingDefault and TControlBorderSpacing.

Modes for aligning a control in a table cell. Causes the cell to fill the available space for the cell. Cell is aligned to the Left and Top coordinates. Cell is aligned to the Right and Bottom coordinates. Cell is aligned to the center of the its width and height. Set type used to store values from the TControlCellAlign enumeration. Defines the default values for TControlBorderSpacing.

TControlBorderSpacingDefault is a record type which defines the default values for properties in a TControlBorderSpacing instance. Used to differentiate default values in derived TControl classes.

Pointer to a TControlBorderSpacingDefault type. Describes the (minimum) spacing around a control.

TControlBorderSpacing defines the spacing around a control. The spacing around its children and between its children is defined in .

Left, Top, Right, Bottom: Integer;
Defines the space available to the auto-sized control. For example: Control A lies left of control B. A has borderspacing Right=10 and B has borderspacing Left=5. Then A and B will have a minimum space of 10 between.
Around: Integer;
Same as Left, Top, Right and Bottom but specified all at once. This will be added to the effective Left, Top, Right and Bottom. Example: Left=3 and Around=5 results in a minimum spacing to the left of 8.
InnerBorder: Integer;
This is added to the preferred size. For example: A buttons widget returns 75x25 on GetPreferredSize. CalculatePreferredSize adds 2 times the InnerBorder to the width and height.
CellAlignHorizontal, CellAlignVertical: TControlCellAlign;
Used, for example, when the Parent ChildSizing.Layout defines a table layout.
Gets the value for the AroundBottom property. Value for the property. Gets the value for the AroundLeft property. Value for the property. Gets the value for the AroundRight property. Value for the property. Gets the value for the AroundTop property. Value for the property. Gets the value for the ControlRight property. Value for the property. Gets the value for the ControlTop property. Value for the property. Gets the value for the ControlWidth property. Value for the property. Implements the storage specifier for the Around property. Returns True if border spacing value in Around has been assigned and contains a non-zero value, or when the value is different than the default value passes to the constructor. Implements the storage specifier for the Bottom property. Implements the storage specifier for the InnerBorder property. Implements the storage specifier for the Left property. Implements the storage specifier for the Right property. Implements the storage specifier for the Top property. Sets the value for the Around property. New value for the Around property. Sets the value for the Bottom property. New value for the Bottom property. Sets the value for the CellAlignHorizontal property. New value for the CellAlignHorizontal property. Sets the value for the SetCellAlignVertical property. New value for the SetCellAlignVertical property. Sets the value for the InnerBorder property. New value for the InnerBorder property. Sets the value for the Left property. New value for the Left property. Sets the value for the Right property. New value for the Right property. Sets the value for the indexed Space property. Identifies the ordinal position in the indexed property. New value for the indexed Space property. Sets the value for the Top property. New value for the Top property. Invalidates the control and signals the OnChange event handler. Currently ignored (distinction no longer required). Constructor for the class instance. The associated control which owns the class instance. Pointer to a record with default settings; can be Nil for all zero defaults. Copies property values from the specified persistent object. TPersistent Persistent object with the values copied in the method. Copies property value from the class instance to the specified persistent object. TPersistent Persistent object where property values are stored. True when the specified spacing is the same as the current settings in the class instance. True when the specified spacing is the same as the current settings in the class instance. TControlBorderSpacing instance with values compared to the current class instance. Returns the bounds with added Around space. Output parameter; the initial contents are ignored. The space on a control side including Around space. The space value. The requested edge. Gets the value for the indexed Space property. Value for the indexed Space property. Ordinal position for the value in the indexed property. Automatically adjusts the size of the control using the specified proportions.

AutoAdjustLayout is a procedure used to automatically adjust the size of the control using the specified proportions.

AXProportion and AYProportion are Double values which contain the scaling factor applied to width and height values in corresponding properties. For example, 1.25 indicates an increase to 125% of the original value, and 0.5 indicates a 50% decrease in the original value.

AutoAdjustLayout scales the value in width and height for properties, including:

  • Around
  • InnerBorder
  • Left
  • Top
  • Right
  • Bottom

When property values are altered in the scaling operation, the InvalidatePreferredSize method is called to recalculate the dimensions for the control. The Change method is called when value(s) in InnerBorder have been altered.

Scaling factor applied to width values. Scaling factor applied to height values. The control to which this border spacing applies. Provides indexed access to the border spacing value for a given anchor side.

Space is an indexed Integer property which provides access to the border spacing used for a specified TAnchorKind value. For example:

AControl.BorderSpacing.Space[akTop] := 6;
The side with border spacing accessed in the property. Spacing reserved on the left-hand side of the control.

AroundLeft is a read-only Integer property which indicates the spacing used around and on the left-hand side of the control.

AroundLeft represents the total space reserved on all sides of the control, plus any additional space reserved on it left-hand edge. The value for the property is calculated as the sum of the values from the Around and Left properties. Updates must be performed to the Around and Left properties.

Space reserved on the top edge of the control. Space reserved on the right-hand side of the control. Space reserved on the bottom edge of the control. Space reserved on the left-hand edge of the control relative to the position for the control.

ControlLeft is a read-only Integer property that indicates the space reserved on the left-hand edge of the control relative to the position for the control class instance. The value in ControlLeft is calculated as the difference between the Left position for the control and the values in the Around and Left properties. For example:

FControl.Left-Around-Left

If a TControl instance is not available in Control, the value for the property is 0 (zero).

Space reserved on the top edge of the control relative to the position for the control. Total width for the control including spacing values in Around, Left, and Right.

ControlWidth is a read-only Integer property that contains the total width for the control including spacing values in the Around, Left, and Right properties. The property value is calculated using the following formula:

TControl.Width + (2 * Around) + Left + Right

If a TControl instance is not available in Control, the value for the property is 0 (zero).

Total height for the control including spacing values in Around, Top, and Bottom. Space reserved on the right-hand edge of the control relative to the position for the control. Space reserved on the bottom edge of the control relative to the position for the control. Event handler for a change in border spacing. The space at the left border. The space at the top border. The space at the right border. The space at the bottom border. The space to add on each side of a control. Space added to the widget's preferred size

When calculating the preferred size of control, the LCL asks the widget first.

When the widget returns a preferred size, e.g. a TButton widget, then the InnerBorder is added twice to this size - e.g. to the Height for top and bottom space.

If the widget does not return a preferred size, the InnerBorder has no effect.

The horizontal alignment inside a table cell. The vertical alignment inside a table cell. Operations in AnchorSide added. AnchorSide removed. AnchorSide changed. Specifies how the side of a control is anchored to other controls.

Class holding the reference sides of the anchors of a TControl. Every TControl has four AnchorSides: AnchorSide[akLeft], AnchorSide[akRight], AnchorSide[akTop] and AnchorSide[akBottom]. Normally if Anchors contain akLeft, and the Parent is resized, the LCL tries to keep the distance between the left side of the control and the right side of its parent client area. With AnchorSide[akLeft] you can define a different reference side. The kept distance is defined by the BorderSpacing. For example:

+-----+ +-----+ | B | | C | | | +-----+ +-----+

If you want to have the top of B the same as the top of C use

B.AnchorSide[akTop].Side:=asrTop; B.AnchorSide[akTop].Control:=C;

If you want to keep a distance of 10 pixels between B and C use

B.BorderSpacing.Right:=10; B.AnchorSide[akRight].Side:=asrLeft; B.AnchorSide[akRight].Control:=C;

Do not setup in both directions, because this will create a circle, and circles are not allowed.

Another example:

+-------+ | | +---+ | B | | A | | | +---+ +-------+

Centering A relative to B:

A.AnchorSide[akTop].Side:=asrCenter; A.AnchorSide[akTop].Control:=B;

Or use this equivalent:

A.AnchorSide[akBottom].Side:=asrCenter; A.AnchorSide[akBottom].Control:=B;
Determines if the Control uses an anchor on the side specified in Kind.

Not used in the current LCL implementation.

Returns True if Control is assigned and the Side property contains a value other than the one in DefaultSideForAnchorKind. Sets the value for the Control property. New value for the Control property. Sets the value for the Side property. New value for the Side property. Gets the owner of the persistent object. TPersistent Owner of the persistent object. Constructor for the class instance.

Create is the constructor for the class instance.

Create calls the inherited constructor, and sets the values in the Owner, Kind, and Side properties. The default value for Side is asrTop.

Owner of the class instance. TAnchorKind value for the Kind property. Destructor for the class instance. Get information about the target control, side and side position. The control we are anchored to. The side we are anchored to. Position of the side to anchor to. Checks for anchor cycles and invalid targets, and returns information about the target side. Can raise an exception with the message: 'TAnchorSide.CheckSidePosition invalid Side'. False when errors have been found. The control we are anchored to. The side we are anchored to. Position of the side to anchor to. Copies properties from the specified persistent object into the current class instance.

Assign is an overridden method in TAnchorSide used to copy property values from the persistent object in Source into the current class instance. When Source is derived from TAnchorSide, the following properties are copied:

  • Side
  • Control

If Source is not derived from TAnchorSide, the inherited method is called using Source as an argument.

TPersistent
Persistent object with the properties copied in the method. True when we are anchored to our parent, at least on the ParentSide. Remove conflicting anchors.

With asrCenter, both sides are controlled by one anchor. Disable opposite anchor and all aligning.

The control being anchored.

For example:

AButton1.AnchorSide[akBottom].Owner = AButton1
The control side being anchored.

Every control has four AnchorSide elements, one for each side. For example:

AButton1.AnchorSide[akLeft].Kind := akLeft.
The target control of the anchor.

For example: if the right side of a Button1 is anchored to the left side of Edit1, then:

Button1.AnchorSide[akRight].Control // contains Edit1

and

Button1.AnchorSide[akRight].Side // contains asrLeft
The side of the target Control, to which we anchor.

For example, if the right side of a Button1 is anchored to the left side of Edit1, then:

Button1.AnchorSide[akRight].Control=Edit1

and

Button1.AnchorSide[akRight].Side=asrLeft
Links an Action to a control.

An ActionLink is created when an Action is assigned to the control. TControl.Action effectively becomes TControl.ActionLink.Action.

An ActionLink propagates changes in Action properties to the client control. It's assumed that properties of the same value (in the Control and Action) are linked to the Action, and follow changes to the Action properties.

Linked control properties are (by default):

  • Caption
  • Enabled
  • Hint
  • HelpContext, HelpKeyword, HelpType: these are linked only if all three property values match.
  • Visible
  • OnClick is linked to Action.Execute

The control can update itself, when it receives a Change notification from the ActionLink .

The client control that is linked to the action. It can be assumed that FClient is not Nil. Called during construction, sets FClient to the given control. TBasicActionLink The control linked to the action. Sets the client Caption when it is linked to the Action for the control. TActionLink.SetCaption New value for the Caption property in the client control. Sets the client Enabled property when it is linked to the action. TActionLink.SetEnabled New value for the Enabled property in the client control. Sets client Hint when it is linked to the action. TActionLink.SetHint New value for the Hint property in the client control. Sets the HelpContext, if the old Help properties match (IsHelpLinked). New value for the HelpContext property in the client control. Sets the HelpKeyword, if the old Help properties match (IsHelpLinked). New value for the HelpKeyword property in the client control. Sets the HelpType, if the old Help properties match (IsHelpLinked). New value for the HelpType property in the client control. Sets the Visible property in the client, if the old values match. New value for the Visible property in the client control. Set OnClick handler for the client, if the old values match.

Formerly, this method changed the OnClick event handler for the client control. That action no longer need because TControl.Click now calls the OnExecute handler in the action.

In the current LCL version, this method is a NOP.

New value for the OnClick event handler in the client control. True if the OnClick handler in the client is the same routine assigned to the OnExecute handler in the action. True if the OnClick handler in the client is the same routine assigned to the OnExecute handler in the action. Formats the hint string for the client control when it includes a ShortCut or accelerator key.

DoShowHint is a Boolean function used to build a hint string for the client control when it includes a shortcut or accelerator key. In short, a HintStr like:

'&Save your work.'

Is formatted as:

'Save your work. (Ctrl+S)'

No actions are performed in the method if the Action is not derived from TCustomAction, HintShortCuts has not been enabled in the Application, or the action has the value scNone in its ShortCut property.

DoShowHint signals the OnHint event handler in the action (when assigned) to get custom hint text. HintStr is replaced with the combined value for the hint text and the ShortCut for the Action. ShortCutToText is called to convert the TShortCut value to its string representation like 'Ctrl+S'.

The return value is always True.

TCustomAction.DoHint TCustomAction.OnHint TCustomAction.ShortCut TApplication.HintShortCuts
Always True. The hint text for the client control. Help properties are assumed linked only when all these properties match. Compares the HelpContext, HelpKeyword and HelpType properties. TActionLink.IsHelpLinked True only if all three Control properties match the Action properties. Class type used to create new instances of TControlActionLink. Exception raised when a loop is detected when adjusting the size for controls.

ELayoutException is an Exception descendant that implements the exception raised when a loop is detected when adjusting the size for controls, or when an invalid value is assigned to the control width or height.

Represents AutoSizing phases for controls.

TControlAutoSizePhase is an enumerated type with values that represent phases or steps in the auto-sizing process for controls. Values from TControlAutoSizePhase are stored in the TControlAutoSizePhases set type.

Indicates propertied have been locked while auto-sizing is active. Create/Destroy handles. Indicates that auto-sizing for a control and its child controls is being performed. Indicates that the wcfRealizingBounds flag is present in the control flags. Makes a handle visible. Set type used to store values from the TControlAutoSizePhase enumeration. Range type used to represent the tab order for windowed controls. Modified in LCL 3.0 to be an alias to TTabOrder in System.UITypes for FPC 3.2.0 or higher. Type used to implement an OnShowHint event handler. TObject for the event notification. Hint information used to derive hint value. Handler type for OnContextPopup. The clicked control. Mouse position in client coordinates; (-1,-1) if the event was not generated by a mouse click. Set Handled to True when everything was handled; False shows the associated PopupMenu, by default. Flags values used mostly for pending actions in a control. Set by TControl.ReadState, and unset by TControl.Loaded when all controls for the form have finished loading. Set when AutoSize was delayed. Set when Left was set during loading. Set when Top was set during loading. Set when Width was set during loading. Set when Height was set during loading. Set when ClientWidth was set during loading. Set when ClientHeight was set during loading. Set when BoundsRectForNewParent has been initialized. Indicates if the rectangle in the base bounds for a control is valid. Set when PreferredSize has been calculated (CalculatePreferredSize). Set when PreferredSize has been calculated (CalculatePreferredSize) for the minimum height and width for a control. Set when the BoundsRect for a control has been changed and the host has not been updated. Set (in WndProc) while processing an LM_PAINT message. Set when a control is auto-sized. Used to prevent recursive calls when a control, its Parent, or its Children are auto-sized. Set when a control is auto-sized. Used to prevent recursive calls when a control, its Parent, or its Children call their InvalidatePreferredSize methods. Set when a control is auto-sized. Used to prevent recursive calls when a control, its Parent, or its Children call their AdjustSize methods. Set type used to store values from the TControlFlag enumeration. Notification handler types.

Notification handlers only receive a Sender argument, and must know themselves why they have been invoked.

Notification request for OnResize. Notification request for OnChangeBounds. Notification request for OnVisibleChanging. Notification request for OnVisibleChanged. Notification request for OnEnabledChanging. Notification request for OnEnabledChanged. Notification request for OnKeyDown. Indicates the policy for the LCL to execute automatic adjustments in the form layout. Widgetset dependent. A fixed absolute layout on all platforms. Smartphone platforms use this one; the x axis is stretched to fill the screen and the y axis is scaled to fit the DPI. For desktops using High DPI, scale x and y to fit the DPI. Indicates the role which a accessible object takes in the user interface. Something to be ignored. For example a blank space between other objects. An object that displays an animation. A button. A cell in a table. An object that displays a graphical representation of data. An object that can be checked or unchecked, or sometimes in an indeterminate state. A clock displaying time. A control which allows selecting a color. A generic column in a table. A list of choices that the user can select from. A controls which displays and possibly allows one to choose a date. A grid control which displays cells. A control which groups others, such as a TGroupBox. A graphic or picture or an icon. A text label as usually placed near other widgets. A list of items, from which the user can select one or more items. An item in a list of items. A main menu bar. A item in a menu. A control which shows a progress indication. A radio button, see for example TRadioButton. A grip that the user can drag to change the size of widgets. A generic row in a table. A control to scroll another one. A control which allows one to increment / decrement a value. A control with tabs, like TPageControl. Text inside of a control, like text in a row cell. A multi-line text editor (for example: TMemo, SynEdit). A single-line text editor (for example: TEdit). A control that holds ToolButtons. A button on a ToolBar. A control which allows one to drag a slider. A list of items in a tree structure. An item in a tree structure. An item that doesn't fit any of the other categories. A top level window. Implements an enumerator for a list of TLazAccessibleObject instances. Gets the value for the Current property. Value for the property. Current value for the enumerator. Represents an accessibility object for user or accessibility tool interactions.

Every TControl has a TLazAccessibleObject instance associated with it, which means that every TControl is potentially accessible. But to actually be usable, the accessible object needs to have its properties set, the most important of which are the role, description and value. Native windowed classes should already receive accessibility properties from the underlying widgetset, while TCustomControl descendants will use the accessibility properties provided by LCL itself.

User applications should add accessibility for their own TCustomControl descendant classes, and possibly customize the descriptions of some elements. It is also possible to make an accessible object invisible to the user, which is done by setting its AccessibleRole property to larIgnored.

Accessibility support in Lazarus is also documented on the Wiki at: .

Gets the value for the Position property. Value for the property. Gets the value for the Size property. Value for the property. Sets the value for the Handle property. New value for the Handle property. Sets the value for the Position property. New value for the Position property. Sets the value for the Size property. New value for the Size property. Member with the Handle for the accessibility object. Member with the AVL tree for the sorted child objects. Member with the value for AccessibleName. Member with the value for AccessibleDescription. Member with the value for AccessibleValue. Member with the value for AccessibleRole. Gets the value for the AccessibleValue property. Value for the property. Gets the value for the Handle property. Value for the property. The control that this accessible object is attached to. It might be the main accessible object of this control or it might represent a sub-part of a control.

The control that this accessible object is attached to. It might be the main accessible object of this control, or it might represent a sub-part of a control which does not have a corresponding TControl, like an item of TTreeView. One can verify if this is the main accessible object of the control by checking if (lAccessibleObject.OwnerControl = lAccessibleObject.OwnerControl.GetAccessibleObject())

The parent TLazAccessibleObject of this accessible object. Available to be used to connect to an object. Available for Widgetsets to use. Constructor for the class instance. Destructor for the class instance. Returns if the handle of this object was already allocated or not. Utilized to set all properties of this property via widgetset routines when creating the handle. Sets the value for AccessibleName. New value for the AccessibleName property. Setter for the property AccessibleDescription. Setter for the property AccessibleValue. Setter for the property AccessibleRole. Inspect the tree of accessible objects upwards until it finds a parent which is attached directly to a windowed control, a TWinControl. Creates and returns a new child accessibility object. Child accessibility object created in the method. Inserts an already created child accessible object as a child of this one. Removes all children of this control; freed if they are not attached to a TControl instance. Removes a child accessible object. Obtains a child accessible object by its index. Obtains a child accessible object by its DataObject property. Returns the number of direct children that this accessible object has. Searches in sub-controls for the first child accessibility object. Searches in sub-controls for the next child accessibility object. Returns the currently selected child accessible object or Nil if none are selected; Override this method in your sub class. Returns the child of this control located at a particular position given as a client position for the control. The name for this accessible object. The description of this accessible object. The value of this accessible object. The role of this accessible object. The position of this accessible object. The size of this accessible object. The widgetset handle of this accessible object. Default enumerator for the children. The base class for visible controls.

TControl is a TLCLComponent descendant which implements the base class for visual controls in the LCL (Lazarus Component Library). TControl extends ancestor classes, like TLCLComponent and TComponent, with properties and methods needed to configure the appearance and behavior for the visual control and handle user interactions at run-time.

Some properties and methods are in all of its descendent classes. Others are implemented as needed in descendent classes. The properties and methods fall into categories like:

  • Appearance
  • Position and Orientation
  • Sizing and Aligning
  • Assistance and Accessibility
  • Drag and Drop
  • Docking
  • Action Support
  • Hi-DPI Awareness and Scaling
  • Handler Lists for Event Notifications
  • Window and Control Message Handling
  • Keyboard and Mouse Message Handling
  • Widgetset-specific Members and Methods

Applications do not normally create instances of TControl. It is used as an ancestor for descendent classes which implement additional features or behaviors.

TControl does not provide a window handle needed to draw the control in the underlying widgetset class. It includes a Parent property which is the windowed control where the control is hosted. It also provides the handle needed to draw the control.

Use TWinControl for a control which provides its own window handle.

TLCLComponent TComponent
Array of the installable notification handlers. Intended ClientSize, initialized during loading. Implements the storage specifier for the CaptureMouseButtons property. True if CaptureMouseButtons has a value other than [mbLeft]. Implements the OnChange handler routine assigned to the ActionLink.

When an Action is assigned to the control, related properties are updated using ActionChange.

The changed Action. Gets the value for the AccessibleDescription property. Value for the property. Gets the value for the AccessibleValue property. Value for the property. Gets the value for the AccessibleRole property. Value for the property. Gets the value for the AutoSizingAll property.

Returns the value from the AutoSizingAll property in the Parent when Parent has been assigned. Otherwise, the existing property value is used.

Value for the AutoSizingAll property. Gets the value for the indexed AnchorSide property. Value for the indexed AnchorSide property. TAnchorKind value with the array element accessed for the property value. Gets the value for the indexed AnchoredControls property. Value for the indexed AnchoredControls property. Ordinal position in the list of anchored controls for the property value. Gets the value for the BoundsRect property. Value for the BoundsRect property. Gets the value for the ClientHeight property. Value for the ClientHeight property. Gets the value for the ClientWidth property. Value for the ClientWidth property. Gets the value for the LRDockWidth property. Value for the LRDockWidth property. Gets the value for the TBDockHeight property. Value for the TBDockHeight property. Gets the value for the Text property.

Uses RealGetText (which reads the Caption member), instead of GetTextBuf (which calls WM_GETTEXT), when possible.

The value for the Text property. Gets the value for the UndockHeight property. Value for the UndockHeight property. Gets the value for the UndockWidth property. Value for the UndockWidth property. Implements the storage specifier for the Anchors property. True when Anchors has value different than the value in AnchorAlign for the current setting in Align. Implements the storage specifier for the BiDiMode property. True when ParentBidiMode has not been enabled. Implements the storage specifier for the Enabled property. True when ActionLink has not been assigned or its Enabled property is not linked to the control. Implements the storage specifier for the Font property. True when ParentFont has not been enabled. Implements the storage specifier for the Hint property.

The return value is True when the property value is not supplied by an Action linked to the control. This occurs when an ActionLink has not been assigned for the control, or when the IsHintLinked property in the ActionLink is set to False.

True when the property value is stored using LCL component streaming. Generates MouseEnter and MouseLeave events. Modified in LCL version 4.0 to update the capture control at the mouse position prior to passing the mouse message to the Application. TLMessage instance with the command, parameters, and result code for the message. Adjusts the control Bounds using its sizing Constraints. Sets the value for the AccessibleDescription property. New value for the AccessibleDescription property. Sets the value for the AccessibleValue property. New value for the AccessibleValue property. Sets the value for the AccessibleRole property. New value for the AccessibleRole property. Sets the value for the indexed AnchorSide property. Index for the element updated in the method. New value for the AnchorSize property. Sets the value for the BorderSpacing property. New value for the BorderSpacing property. Member with the accessibility object for the control. Member with the value for the ControlState property. Member with the value for the Cursor property. Gets the value for the Cursor property. Value for the Cursor property. Sets the value for the Cursor property.

Calls Perform to send a CM_CURSORCHANGED control message to the processing loop when the member for the property is updated.

New value for the Cursor property. Sets the value for the Visible property.

Changing the value for the property causes additional actions to be performed.

VisibleChanging is called to notify event handler routines for the control. The Perform method is used to send a CM_VISIBLECHANGED control message to the processing loop for the control.

Preferred width and height values in the control, and its children (when derived from TWinControl), are invalidated. To minimize the overhead from the DoAutoSize method, auto-sizing is temporarily disabled when the control is updated. The AdjustSize method is called to perform the equivalent of DoAutoSize without the extra overhead of getting the preferred sizes from the widgetset class. If the control is not Visible but has a Parent control, the AdjustSize method in Parent is called.

VisibleChanged is called to notify event handler routines for the control.

SetVisible ensures that ControlState is updated to include the value csVisibleSetInLoading when csLoading is included in the ComponentState property.

New value for the Visible property. Performs actions needed when the handle for the parent control is freed.

Has an empty implementation in TControl, and must be implement in descendent classes.

For internal use only; call AdjustSize instead. IMPORTANT: Many Delphi controls override this method and many call this method directly after setting some properties.

During handle creation not all interfaces can create complete Device Contexts which are needed to calculate things like text size. That's why you should always call AdjustSize instead of DoAutoSize.

Resizes and aligns the control and all of it children.

No actions are performed in the method when AutoSizingAll is True, or when the control is not derived from TWinControl.

Calls DoAutoSize while the control includes cfAutoSizeNeeded in its ControlFlags property. Called from the AdjustSize and EnableAutoSizing methods.

Raises an EInvalidOperation exception if Parent has not been assigned for the control.
Sets AutoSizing to True; used to prevent loops. End of the auto-sizing process, resets AutoSizing to False. Request further processing after an anchor side was changed. Ignored. Requests further processing after an anchor side has changed, that anchors another control to this one. Anchor side with the control added, removed, or moved in the notification. Operation for the notification. Sets the value for the Align property.

Changing the value for the property causes additional actions to be performed.

New value for the Align property. Sets the value for the Anchors property. New value for the Anchors property. Sets the value for the AutoSize property.

Calls AdjustSize when the property is enabled.

New value for the AutoSize property. Called when the Bounds of the control have been changed; override as required. Notifications can be performed in this method. Creates the default BorderSpacing object instance for the class.

Allocates the class instance used for the BorderSpacing property. Can be overridden in descendent controls to use the type or default values needed for the class instance.

The class instance created in the method. Performs actions needed when value(s) in Constraints have been changed.

DoConstraintsChange calls AdjustSize to ensure that the control and any children are sized and positioned to the new Constraints for the control. The method is overridden in descendent classes, like TWinControl, to perform actions needed for the class instance.

Called from the TSizeConstraints.Change method before it signals the OnChange event handler in the constraints class instance.

Not used in the method. Performs actions needed when border spacing for the control is changed. Object for the notification. Not used in the method. True if the inner border spacing has been changed for the control. Not used in the method. Checks for an assigned value in BorderSpacing.InnerBorder. True when InnerBorder has been assigned and must be applied to the control. Implements the storage specifier for the Caption property.

Returns True if ActionLink has not been assigned, or its IsCaptionLinked property is set to False.

Returns True if ActionLink has not been assigned, or its IsCaptionLinked property is set to False. Sends Move and Size messages through the LCL message paths.

Overridden in TWinControl; in TControl it's a NOP. This method simulates the VCL behavior and has no real effect.

True if a TLMSize message is constructed and dispatched in the method. True if a TLMMove message is constructed and dispatched in the method. Signals the OnConstrainedResize handler.

ConstrainedResize is a method used to signal the OnConstrainedResize event handler (when assigned) for the control.

It is called from the DoConstrainedResize method, and occurs after values from Constraints have been normalized to the constraints from the LCL interface. The normalized values are stored in the MinWidth, MinHeight, MaxWidth, and MaxHeight arguments and passed to the OnConstrainedResize event handler.

Variable argument with the minimum width for the control. Variable argument with the minimum height for the control. Variable argument with the maximum width for the control. Variable argument with the maximum height for the control. Override this method to return the preferred height and width for the control.

Calculates the preferred width and height for a control, which is used by the LCL auto-sizing algorithms as the default size. Negative or zero (0) values are treated as undefined and the LCL uses other sizes instead. This value is independent of constraints and siblings, only the inner parts are relevant.

TWinControl overrides this and asks the interface for theme dependent values. See for more information.

When WithThemeSpace contains True, space is added for stacking.

For example: TRadioButton has a minimum size. But for stacking multiple TRadioButtons there should be some space around the controls. This space is theme-dependent, so the parameter is passed to the widgetset.

Set this argument to the preferred width. Set this argument to the preferred height. True when space around stacked controls should be added. Signals OnResize event handlers for the control.

Signals the OnResize event handler (when assigned) using the control instance as the Sender for the event notification. Calls DoCallNotifyHandler to signal any handler routines using the chtOnResize handler type.

Signals OnChangeBounds event handlers for the control.

DoOnChangeBounds ensures that cfOnChangeBoundsNeeded is removed from the flag values for the control. DoOnChangeBounds signals the OnChangeBounds event handler (when assigned) using the control instance as the Sender for the event notification. Calls DoCallNotifyHandler to signal any handler routines using the chtOnChangeBounds handler type.

Checks for changes and calls DoOnChangeBounds if needed.

Maintains internal members used to track the last bounds rectangle and client size before DoOnChangeBounds is called. Called from the LoadedAll and ChangeBounds methods.

Checks for changes and calls DoOnResize if needed.

No actions are performed in the method at design-time, during LCL component streaming, or when AutoSizeDelayed is set to True.

Resize updates internal members used to track the current values in the Width, Height, ClientWidth, and ClientHeight properties. It calls DoOnResize to signal OnResize event handler(s) (when assigned) for the control.

Asks the parent control to realign all controls that are siblings.

Calls the AdjustSize method to handle resize operations delayed during loading or handle creation.

Update the rules for anchoring the control. Sets the bounds (left, top, height, width) and optionally the BaseBounds of the control.

ChangeBounds is called whenever the position or size of the control is set, either via the properties or by the layout engine in the LCL.

SetBounds calls ChangeBounds internally with KeepBase set to False, while the LCL layout engine calls it with KeepBase set to True.

Override this for code that might change the preferred size or resizes other controls.

You can call this function in your custom controls. Keep in mind that the given aLeft, aTop, aWidth, aHeight might not be valid and will be changed by the LCL before applied.

New value for the Left property in the control. New value for the Top property in the control. New value for the Width property in the control. New value for the Height property in the control. True when the BaseBounds should not be modified. Internal function used to set the bounds for the control (Left, Top, Height, Width).

DoSetBounds is a low-level function used to set the private variables FLeft, FTop, FWidth, FHeight. Do not call this function; only the LCL calls it.

It also updates FClientWidth and FClientHeight accordingly.

Override this to update the content layout within the control, for example scroll bars. As always: do not paint here, but call Invalidate and paint using the OnPaint handler or an overridden Paint method.

Value applied to the Left member in the control. Value applied to the Top member in the control. Value applied to the Width member in the control. Value applied to the Height member in the control. Scales the minimum and maximum Width and Height.

ScaleConstraints is called from the ChangeScale method; never call it directly. Multiplier and Divider contain the values passed as arguments to the ChangeScale method.

Multiplier used to derive the scaling factor for the control constraints. Divisor used to derive the scaling factor for the control constraints. Applies scaling (multiplier and divider) to the bounds coordinates, constraints, and Font in a control.

ChangeScale is a method used to apply scaling, expressed by the Multiplier and Divider arguments, to size values in the control. These values include:

  • The minimum and maximum heights and widths in Constraints (by calling ScaleContraints).
  • The Font height (when ParentFont is not enabled).
  • The bounds rectangle for the control (Left, Top, Bottom, and Right). If the control is the top-most form in a component hierarchy, the Top and Left values are not changed.

ChangeScale calls the MulDiv routine in the LCLType unit to calculate the scaled numeric values. The results from the calculations are rounded and returned as an Integer type.

No actions are performed in the method when Multiplier and Divider have the same value.

ChangeScale can be overridden in descendent classes to perform any additional action needed for the class type.

ChangeScale is called from the ScaleControls and ScaleBy methods in the TWinControl descendant.

MulDiv
Multiplicand used to calculate the scaled numeric values. Divisor used to calculate the scaled numeric values. Determines if auto-sizing is possible, and if so, gets the new width and height when enabled.

Always returns True in TControl. The values in NewWidth and NewHeight are not updated in TControl. Override the method in descendent classes to return values as needed for the class type.

TControl returns True. Suggested width, can be adjusted in an overridden version. Suggested height, can be adjusted in an overridden version. Sets the value for the BiDiMode property. New value for the BiDiMode property. Sets the value for the ParentBiDiMode property. New value for the ParentBiDiMode property. Determines if a parent control is involved in the alignment process for the control.

The return value is True when a control in the Parent hierarchy has been assigned and has wcfAligningControls in its Window control flags. The return value is False if both conditions are not satisfied.

This method is not used in the current LCL implementation.
True if a Parent control is actively aligning its descendent controls. Gets the value for the ClientOrigin property. Value for the ClientOrigin property. Gets the value for the ClientRect property.

Returns the size for the visual client area in the control. For example, the inner size of a TGroupBox. For a TScrollBox it is the visual size, and not the logical size.

The return value is a TRect instance with the Top and Left members set to 0, and the Height and Width members set to the corresponding property values for the control.

TControl.ClientRect
Value for the ClientRect property. Logical client area, can be bigger than the visible client area. A has a logical client area, of which only a portion can be visible. The origin always is (0,0), regardless of an ScrollOffset. TControl returns the ClientRect. Get the visible part of the logical client area.

Includes the ScrollOffset in a TScrollingWinControl Parent.

For TControl: When the Parent is a TScrollingWinControl, the ClientRect is offset by its ScrollOffset. This Rect can be intersected with the visible ClientArea of the Parent, to get the actual visible part of the control.

For TWinControl: The visible ClientRect is offset by ScrollOffset, to reflect the visible part of the logical ClientRect.

The scrolled ClientRect (TopLeft, BottomRight). Returns the offset of the scrolled client area (in a scrolling TWinControl).

The overridden method may fail when the TScrollingWinControl has only one scroll bar.

TScrollingWinControl.GetClientScrollOffset
The X and Y offsets of the visible client area, equal to the scroll bar positions. Gets the value for the ControlOrigin property.

Returns the origin (top, left pixel) for the control, in screen coordinates.

Value for the ControlOrigin property. Implements the storage specifier for the ClientHeight property. True if the value for ClientHeight is stored using LCL component streaming. Implements the storage specifier for the ClientWidth property. True if the property is stored using LCL component streaming. True when both the control's left and right side are anchored. True if the Width varies with the Parent.Width. True when both the control's top and bottom side are anchored. True if the Height varies with the Parent.Height. Contains True while auto-sizing is in progress.

AutoSizing is a read-only Boolean property which indicates if an auto-size operation is currently active for the control. The property value is set to True when the BeginAutoSizing method is called, and set to False in the EndAutoSizing method. These methods raise a catchable exception when AutoSizing does not contain the expected / required value.

Flag to prevent recursive AutoSizing (in DoAllAutoSize). By default Parent.AutoSizingAll is read, because a mere TControl cannot have child controls. Internal counter increased and decreased in the DisableAutoSizing and EnableAutoSizing methods. Handles a LM_CANCELMODE message for the control.

Calls the SetCaptureControl routine to clear the value in the CaptureControl variable.

Message handled in the method. Handles a LM_CONTEXTMENU message for the control.

No actions are performed in the method at design-time, or when the result code in Message has a non-zero value.

Calls DoContextPopup to signal the OnContextPopup event handler (when assigned). No additional actions are performed in the method if the context menu was displayed and executed in the OnContextPopup event handler.

Otherwise, the TPopupMenu instance in the PopupMenu property is displayed and executed by calling its Popup method.

The result code in Message is set to 1 if the context menu was displayed and executed in the method.

TPopupMenu
Message examined and optionally handled in the method. Handles a LM_LBUTTONDOWN (left mouse button down) message for the control.

Sets MouseCapture to True when enabled in the ControlStyle property and the left mouse button is included in CaptureMouseButtons. Includes csClicked in ControlState when click events have been enabled in the ControlStyle property.

Calls the DoMouseDown method to perform the mouse button event for the control, and to signal its OnMouseDown event handler (when assigned). No mouse down actions are performed when standard events are ignored by including csNoStdEvents in the ControlStyle property.

Message handled in the method. Handles a LM_RBUTTONDOWN (right mouse button down) message for the control.

Sets MouseCapture to True when enabled in the ControlStyle property and the right mouse button is included in CaptureMouseButtons.

Calls the DoMouseDown method to perform the mouse button event for the control, and to signal its OnMouseDown event handler (when assigned). No mouse down actions are performed when standard events are ignored by including csNoStdEvents in the ControlStyle property.

Message handled in the method. Handles a LM_MBUTTONDOWN (middle mouse button down) message for the control.

Sets MouseCapture to True when enabled in the ControlStyle property and the middle mouse button is included in CaptureMouseButtons.

Calls the DoMouseDown method to perform the mouse button event for the control, and to signal its OnMouseDown event handler (when assigned). No mouse down actions are performed when standard events are ignored by including csNoStdEvents in the ControlStyle property.

Message handled in the method. Handles a LM_XBUTTONDOWN (extra mouse button down) message for the control.

Checks the Keys member in Message to determine whether the first or second extra mouse button is represented in the structure. No actions are performed in the method if Keys does not represent the mbExtra1 or mbExtra2 mouse button.

Sets MouseCapture to True when enabled in the ControlStyle property and the mouse button is included in CaptureMouseButtons.

Calls the DoMouseDown method to perform the mouse button event for the control, and to signal its OnMouseDown event handler (when assigned). No mouse down actions are performed when standard events are ignored by including csNoStdEvents in the ControlStyle property.

Message examined and optionally handled in the method. Handles a left mouse button double click message for the control.

WMLButtonDblClk is a method used to handle a LM_LBUTTONDBLCLK window message for the control. Values in ControlStyle and CaptureMouseButtons are used to determine if MouseCapture is enabled in the method. The MouseDown method is called to update the mouse pointer position and to signal the OnMouseDown event handler (when assigned). The DblClick method is called to signal the OnDblClick event handler (when assigned).

Window message handled in the method. Message handler for right mouse button double click events. Window message handled in the method. Message handler for middle mouse button double click events. Window message handled in the method. Message handler for extra mouse button double click events. Window message handled in the method. Message handler for left mouse button triple click events. Window message handled in the method. Message handler for right mouse button triple click events. Window message handled in the method. Message handler for middle mouse button triple click events. Window message handled in the method. Message handler for extra mouse button triple click events. Window message handled in the method. Message handler for left mouse button quadruple click events. Window message handled in the method. Message handler for right mouse button quadruple click events. Window message handled in the method. Message handler for middle mouse button quadruple click events. Window message handled in the method. Message handler for extra mouse button quadruple click events. Window message handled in the method. Message handler for extra mouse button up events. Window message handled in the method. Message handler for mouse move events. Window message handled in the method. Message handler for left mouse button up events. Window message handled in the method. Message handler for right mouse button up events. Window message handled in the method. Message handler for middle mouse button up events. Window message handled in the method. Handles mouse wheel messages for the control. Mouse wheel message handled in the method. Handles horizontal mouse wheel messages for the control. Mouse wheel message handled in the method. Message handler for control move events. Window message handled in the method. Message handler for changed control size. Window message handled in the method. Message handler for changed control position events. Window message handled in the method. Handles CM_CHANGED control messages for the control.

Calls the WindowProc method in the Parent control (when assigned) to handle the control message in Message.

TLMessage
Control message handled in the method. Handles a LM_CaptureChanged message for the control.

LMCaptureChanged handles a LM_CAPTURECHANGED control message received when the mouse capture control has been changed. LMCaptureChanged calls the CaptureChanged method which notifies the DragManager singleton of the mouse capture change.

TLMessage
Control message examined and handled in the method. Handles CM_BIDIMODECHANGED messages for the control.

Calls the Invalidate method to redraw the control when the wParam member in Message is 0 (zero).

TLMessage
Message examined and handled in the method. Handles the CM_SYSFONTCHANGED message for the control.

CMSysFontChanged ensures that a control with its DesktopFont property set to True is updated when the system font has been changed. The Font property in the control is set to the value in SystemFont from the Screen singleton.

No actions are performed in the method when DesktopFont is set to False.

Screen TScreen.SystemFont TLMessage
Control message which triggered the method. Not used in the method. Handles a CM_ENABLEDCHANGED message for the control.

Calls the Invalidate method and causes the control to be redrawn when the Enabled state has been changed.

TLMessage
Message which triggered the method. Handles the CM_HITTEST message for the control.

The hit test handler determines if the control was located at the mouse position for the test. Sets the Result member in Message to 1 if it was received by the control.

Descendent control may reimplement the method to check for a specific area on the control, like a border or a dock site.

TLMessage
Message with the result for the hit test. Handles a CM_MOUSEENTER message for the control.

CMMouseEnter ensures that the MouseInClient property is updated when the mouse pointer enters the client area for the control. No actions are performed in the method if MouseInClient is already set to True on entry.

CMMouseEnter calls Perform to broadcast the CM_MOUSEENTER message to the Parent and ancestor controls (when assigned). If the Message is not a child message, the MouseEnter method is called to signal the OnMouseEnter event handler (when assigned).

TLMessage
Control message handled in the method. Handles a CM_MOUSELEAVE message for the control.

CMMouseLeave ensures that the MouseInClient property is updated when the mouse pointer has left the client area for the control. No actions are performed in the method if MouseInClient is already set to False on entry.

CMMouseLeave calls Perform to broadcast the CM_MOUSELEAVE message to the Parent and ancestor controls (when assigned). If the Message is not a child message, the MouseLeave method is called to signal the OnMouseLeave event handler (when assigned).

TLMessage
Control message handled in the method. Handles the CM_HINTSHOW message for the control.

CMHintShow is a method used to handle a CM_HINTSHOW message received by the control.

Message is the TLMessage instance with the control message constant, hint information, and result code used in the method.

CMHintShow calls DoOnShowHint to signal the OnShowHint event handler (when assigned) using the hint information in Message. When ActionLink has been assigned, its DoShowHint is called using the hint information.

The result code is Message is updated prior to exiting from the method.

TCMHintShow TLMessage
Message with the hint information displayed for the control. Handles a CM_PARENTBIDIMODECHANGED message for the control.

CMParentBiDiModeChanged ensures that the BidiMode property from the Parent control is used when the ParentBidiMode property is set to True. No actions are performed in the method when ParentBidiMode is set to False.

TLMessage
Control message handled in the method. Handles a CM_PARENTCOLORCHANGED message for the control.

CMParentColorChanged ensures that the Color property is updated when the message is received for the control. The property value from the Parent control is stored in Color when ParentColor is set to True. No actions are performed in the method when ParentColor is set to False.

TLMessage
Message handled in the method. Handles a CM_PARENTFONTCHANGED message for the control.

CMParentFontChanged ensures that the Font from the Parent control is applied to the class instance when the message is received. It applies the PixelsPerInch setting in the Parent font (which is not included in object persistence) to the Font in the control.

No actions are performed in the method if ParentFont is set to False, or when the Parent property has not been assigned.

The current LCL version calls the ParentFontChanged method prior to exit. It has an empty implementation, and is maintained only for compatibility with older versions of the LCL. The work is actually performed in this method.
TFont.PixelsPerInch
Control message handled in the method. Handles a CM_PARENTSHOWHINTCHANGED message for the control.

CMParentShowHintChanged ensures that the ShowHint property in the control is updated when the corresponding property in the Parent control is changed. When ParentShowHint is set to True, the ShowHint property from the Parent is copied into the control.

Control message handled in the method. Handles a CM_VISIBLECHANGED message for the control.

CMVisibleChanged causes the control to be redrawn using the Visible and ControlStyle properties in the class instance. It allows a parented control to be redrawn using the visibility and opacity settings for the control. It calls the InvalidateControl method to invalidate the bounds rectangle or the control.

No actions are performed in the method at design-time.

TComponent.ComponentState
Control message handled in the method. Handles a CM_TEXTCHANGED message for the control.

Calls the TextChanged method when the message is received by the control.

Control message handled in the method. Handles the CM_CURSORCHANGED message for the control.

At run-time, the SetTempCursor method is called to apply the temporary cursor shape in the Cursor property. No actions are performed in the method at design-time.

Control message handled in the method. Saves the docked and undocked extent of the control.

In the floating state, it sets UndockWidth/Height to the current Width/Height. In docked state, it sets LRDockWidth/TBDockHeight to the current Width/Height.

Should save both in any case, independent from DockOrientation or host Align. Rationale: a DockManager will either ignore these values, or use them according to the new alignment. Without a DockManager both extents are required, because no (valid) alignment information applies.
Create a floating dock site with a client area equal to the given screen coordinates. The new dock site is owned by the control. The dock site, can be Nil for a TWinControl that can float by itself. The bounds of the client area of the floating window. Determines the side to which the dragged control shall be docked. Alignment edge for the docked control. Default value is alNone. Mouse position relative to the Left, Top properties in the control. Get the list of images used when a drag operation is active. Always returns Nil in TControl. Determines whether the control is floating.

Floating state is assumed when the control has a HostDockSite using the FloatingDockSiteClass type, and 0 or 1 docked clients.

True if HostDockSite is a floating dock site with 0 0r 1 docked clients. Returns the class for a floating host dock site.

An instance of this class is created whenever a control shall float, but cannot (or shall not) float by itself.

Only TWinControls can float on the screen (with Parent=Nil), but not ordinary TControls.

Since dockable forms are not supported by every platform, a dockable TWinControl may need a floating host which presents a docking handle to the user (e.g. a dock caption).

The class of a floating host dock site for this control. Performs actions needed before a drag operation is started for the control.

BeforeDragStart has an empty implementation in TControl. The virtual method can be overridden in descendent classes to perform the actions needed. Some common actions include updating control flags or checking for a valid Handle before starting the drag operation.

BeforeDragStart is called from the DragStart method in TDragManager.

For internal use: user has started dragging the control. Handler called when the control starts floating.

Since TControls cannot float for themselves, a FloatHost site is created and the control is docked into it.

When the control already has a Parent (FloatHost site), the Parent's position and extent is adjusted to fit the DockRect as its ClientRect.

The DockObject of the current drag-dock operation. Adjust the DockRect for floating state (no drop target under the mouse). The dragged DockObject, containing the DockRect to adjust. The horizontal mouse position in screen coordinates. The vertical mouse position in screen coordinates. Adjusts the control position and extent for the new docksite.

DoDock is an Internal method, called by Dock, to performs actions needed when a control is docked to a docksite.

If NewDockSite=Nil, Parent is set to Nil (in preparation of floating the control). Otherwise ARect is ignored, and recomputed to fit approximately into the ClientRect of the NewDockSite.

Finally the computed coordinates are stored, in BoundsRectForNewParent when the NewDockSite differs from Parent, else in BoundsRect.

A correct implementation should allow for computations in a derived class, and accept and handle the changed bounds without any further adjustments.
The site where the control will be docked, or Nil when it becomes floating. The control's new Bounds, in screen coordinates when NewDockSite is Nil, else in client coordinates of NewDockSite. Handler for a drag message, sent by the DragManager to the current target control.

These messages can be sent while dragging:

dmFindTarget
Request to determine the possible target control for an drop. A TControl returns itself, a TWinControl finds the child control closest to the mouse position.
dmDragEnter, dmDragLeave, dmDragMove
Notification of mouse moves. Invokes DragOver, or DockOver if docking. Result indicates acceptance of a drop.
dmDragDrop
The dragged object has been dropped onto this control. Invokes DragDrop, or DockDrop if docking.

The Source argument of the invoked methods is the DragDockObject when docking. If the DragObject has been AutoCreated, the dragged control is passed as the Source. Otherwise, the DragObject itself is passed as Source.

Contains the result for the Drag message.

The Result member is polymorphic:

For dmFindTarget, the result is a reference to the the target control. For dmDragDropm the result is zero (0). For other drag messages, the result indicates acceptance of the drop message.

The task to perform. The mouse position in screen coordinates. The drag object. The drop target, Nil if none. Distinguishes between a drag-drop and drag-dock operation. Signals the OnEndDock event handler when the control has been undocked.

No actions are performed in the method if a handler routine has not been assigned to OnEndDock.

DoEndDock is called from the EndDrag method in TDragDockObject.

Object instance with the target control or dock site site. Horizontal mouse coordinate where the mouse button was released. Vertical mouse coordinate where the mouse button was released. Signals the OnEndDrag event handler.

DoEndDrag occurs when a drag operation for the control has been completed. In TControl, it signals the OnEndDrag event handler (when assigned). Arguments to the handler include the target control (or dock site) and the mouse coordinates when the drag operation was completed.

No actions are perform in the method if a handler routine has not been assigned to OnEndDrag.

Descendent classes may override the method to perform additional actions needed in their implementation.

DoEndDrag is called from the EndDrag method in TDragObject.

Object instance with the target control or dock site. Horizontal mouse coordinate where the mouse button was released. Vertical mouse coordinate where the mouse button was released. Signals the OnStartDock event handler. Object instance (TDragObject) for the event notification. Signals the OnStartDrag event handler. Object instance (TDragObject) for the event notification. Notifies the control of a cancelled drag operation.

DragCanceled has an empty implementation in TControl.

Called when an object is dragged over this control; Determines whether a drop is acceptable, using the OnDragOver handler.

An OnDragOver handler is required, or any drop will be rejected (Accept becomes False).

When an OnDragOver handler is installed, Accept is set to True and can be changed by the handler.

Source can be either a TDragObject, or the dragged control.
The dragged object, a control or a DragObject. The horizontal mouse position in client coordinates. The vertical mouse position in client coordinates. State change flag (dsDragEnter, dsDragMove, dsDragLeave). Set to True when a drop is allowed. Get the DockRect for an possible drop.

Calls the DockManager.PositionDockRect in the target site, or DragDockObject.AdjustDockRect after moving the undocked control rectangle to the DragPos. AdjustDockRect takes the hotspot of the DockRect into account.

Object instance (TDragDockObject) with the control positioned and aligned in the method. Sets the value for the DragMode property. New value for the DragMode property. Returns the string for the dock caption, by default the control's Name. Default value for the dock caption. Defaults to the control name. Signals OnClick and/or executes the ActionLink when the control has been clicked.

Performs actions needed when the control has been clicked using the mouse or its keyboard equivalent.

Click uses the value in ActionLink (when assigned) to determine whether OnClick and / or Action are executed for the control.

When ActionLink has been assigned, it is compared to the routine in the OnClick event handler (when assigned). When the routines differ, the OnCLick event handler is signalled. If an ActionLink exists, the Execute method in ActionLink is called as well.

Neither OnClick nor the ActionLink are executed at design-time.

TBasicActionLink.Execute
Signals the OnDblClick event handler (when assigned).

DblCLick is a method used to perform actions needed when a mouse double click event has occurred on the control. In TControl, it signals the OnDblClick event handler (when assigned) using the class instance as the Sender argument in the event type.

Descendent classes may override the method to perform additional actions needed in the their implementations.

DblClick is called from the WMLButtonDBLCLK method when the LM_LBUTTONDBLCLK window message is handled for the control.

TNotifyEvent
Signals the OnTripleClick event handler (when assigned).

TripleClick is a method used to perform actions needed when a mouse triple click event has occurred on the control. In TControl, it signals the OnTripleClick event handler (when assigned) using the class instance as the Sender argument in the event type.

Descendent classes may override the method to perform additional actions needed in the their implementations.

TripleClick is called from the WMLButtonTripleCLK method when the M_LBUTTONTRIPLECLK window message is handled for the control.

TNotifyEvent
Signals the OnQuadClick event handler (when assigned).

QuadClick is a method used to perform actions needed when a mouse quadruple click event has occurred on the control. In TControl, it signals the OnQuadClick event handler (when assigned) using the class instance as the Sender argument in the event type.

Descendent classes may override the method to perform additional actions needed in the their implementations.

QuadClick is called from the WMLButtonQuadCLK method when the M_LBUTTONQUADCLK window message is handled for the control.

TNotifyEvent
Converts the coordinates in the mouse message from SmallInt to LongInt values.

MessageMousePos is a TSmallPoint type with the mouse coordinates as SmallInt values. The return value is a TPoint instance with the LongInt values for the converted mouse coordinates.

If the control has a Width or Height that exceeds the maximum value for the SmallInt type, GetCursorPos is called to get the current mouse pointer position and the values are converted from screen to client coordinates. Otherwise, SmallPointToPoint is called to convert the values in MessageMousePos.

GetMousePosFromMessage provides coordinates using the type needed in MouseDown, MouseUp, MouseMove, and other mouse message handling methods in the control.

TSmallPoint TPoint
TPoint instance with the LongInt values for the mouse cursor position. TSmallPoint instance with the values converted in the method. Performs actions needed to handle a mouse up event for the control.

DoMouseUp is a virtual method used to apply the mouse button up event in the Message and Button arguments. DoMouseUp checks the control style flags in ControlStyle to determine whether the control responds to standard mouse events.

No actions are performed in the method when csNoStdEvents has been included in ControlStyle. This indicates that mouse events are handled by the widgetset class instance for the control.

Otherwise, values in Message and Button are applied in the method. When DragManager is active for a drag and drop operation, the mouse coordinates in Message are converted to screen coordinates and applied using the DragManager. The Result member in Message is set to 1 to show that is has been handled.

The MouseUp method is called to signal the OnMouseUp event handler (when assigned).

DoMouseUp is called from methods like WMLButtonUp, WMRButtonUp, WMMButtonUp, and WMXButtonUp.

Mouse message examined and handled in the method. Mouse button for the message. Performs actions needed to handle a mouse down event for the control.

DoMouseDown is a virtual method used to apply the mouse button down event in the Message and Button arguments. DoMouseDown checks the control style flags in ControlStyle to determine whether the control responds to standard mouse events.

No actions are performed in the method when csNoStdEvents has been included in ControlStyle. This indicates that mouse events are handled by the widgetset class instance for the control.

Otherwise, values in Message and Button are applied in the method. The mouse coordinates in Message are converted to screen coordinates, and the message is applied by calling the MouseDown method.

DoMouseDown is called from methods like: WMLButtonDown, WMRButtonDown, WMMButtonDown, and WMXButtonDown.

Mouse message examined and handled in the method. Mouse button for the message. Ctrl, Shift, or Alt modifier for the mouse button event. Handles a mouse down event for the control.

Called by the MouseDown message handler. Handles Focus changes, and notifies the DragManager while dragging. Finally, it calls the handler.

Which buttons are down. Which of Ctrl, Shift or Alt keys are also pressed. Horizontal Mouse position in client coordinates. Vertical Mouse position in client coordinates. Handler for MouseMove events.

Called by the MouseMove message handler. The DragManager is notified while the control is being dragged. Finally the OnMouseMove handler is invoked.

The currently pressed mouse buttons and modifier keys. Horizontal Mouse position in client coordinates. Vertical Mouse position in client coordinates. Signals the OnMouseUp handler. The currently pressed modifier keys. The currently pressed mouse buttons. Horizontal Mouse position in client coordinates. Vertical Mouse position in client coordinates. Signals the OnMouseEnter event handler (when assigned).

MouseEnter is a method used to perform actions when the mouse pointer enters the client rectangle for the control. In TControl, it signals the OnMouseEnter event handler using the class instance as the Sender argument.

Descendent classes may override the method to perform actions needed for their implementations.

MouseEnter is called from the CMMouseEnter method when a CM_MOUSEENTER message is handled for the control.

Signals the OnMouseLeave event handler (when assigned).

MouseLeave is a method used to perform actions when the mouse pointer leaves the client rectangle for the control. In TControl, it signals the OnMouseLeave event handler using the class instance as the Sender argument.

Descendent classes may override the method to perform actions needed for their implementations.

MouseLeave is called from the CMMouseLeave method when a CM_MOUSELEAVE message is handled for the control.

Performs actions needed to handle an accelerator key for the control.

Always return False in TControl. The method is overridden in descendent classes to perform actions needed to handle an accelerator character in the Message argument.

This method is called even if the control is disabled or hidden. Provided for Delphi VCL compatibility.

True if the accelerator key in Message is handled by the control. TLMKey instance with the character code examined in the method. Changes the cursor shape to the value in the Cursor property.

UpdateMouseCursor is a method used to change the cursor shape displayed when the mouse is hovered over the control. No actions are performed in the method at design-time, or when the screen cursor already has a shape other than crDefault.

UpdateMouseCursor calls SetTempCursor to apply the value in the Cursor property to the Parent control.

UpdateMouseCursor is called from WMMouseMove after the mouse position has been captured, and before the OnMouseMove event handler is signalled.

Not used in the method. Not used in the method. Performs actions needed when the value for the control has been changed.

In TControl, Changed calls Perform to post a CM_CHANGED control message to the message processing loop. The Parent control, which provides the window handle, receives the message in its CMChanged method and calls its WindowProc processing loop.

Changed may be overridden or reimplemented in descendent classes to perform actions needed in the implementations for the controls. For instance, triggering OnChange or other notification events.

Changed is called when properties for the control, especially its value, have been modified.

Override GetPalette to return the handle of a color palette.

Always returns 0 (zero) in TControl.

The Palette handle, zero (no Palette) by default. Gets the value for the ParentBackground property. Value for the ParentBackground property. Returns True if the specified class is allowed for children of this control.

Always returns False in TControl. It is overridden in descendent classes to check whether the class reference in ChildClass is allowed for the control.

True when the class is allowed as a child control. The class type for the child control. Updates control flags and reads the data for the component. TComponent TReader instance used to read the component data. Performs actions needed when LCL component streaming has been completed.

Calls the inherited method on entry.

Ensures that values for Width and Height are available in the Bounds rectangle for the control. Explicit values for Width and Height are not always available in the values loaded using LCL component streaming. When this condition is indicated in the control flags, the ClientWidth and ClientHeight loaded from the resource stream are used in the Bounds for the control.

Ensures that values for Color, Font, BiDiMode, and ShowHint are set to values in the Parent control when enabled in the ParentColor, ParentFont, ParentBiDiMode, and ParentShowHint properties. The values from Parent are omitted when Parent has not been assigned.

Calls UpdateBaseBounds to store the bounds rectangle and client size using the loaded values.

If an Action has been assigned in the control, the ActionChange method is called to ensure that default values from the Action are applied to the control.

If an ancestor control is still loading its child controls, resize and align operations are deferred for the control. Otherwise, the LoadedAll method is called to adjust the sizes and layout for the control.

TComponent
Called when the control and its child controls have been loaded, and their control state is changed.

LoadedAll is a procedure called when the control (and its child controls) have been loaded using the LCL component streaming mechanism, and csLoading is removed from their control state. LoadedAll is called from the Loaded method.

Defines which non-published properties should be streamed (none here). Object used to read or write values using the LCL resource stream. Implements assignment of the control to an Action object, or calls the inherited method.

Properties copied in the method include:

  • Enabled
  • Hint
  • Caption
  • Visible
  • OnExecute (copied to OnClick in the destination object)
  • HelpContext
  • HelpKeyword
  • HelpType
TPersistent.Assign
Destination object which receives values copied in the method. Called for each control on a form where the update count has reached 0 (zero).

FormEndUpdated is overridden in descendent classes, like TWinControl, which provides a container for its child controls.

Requests a repaint of the control.

InvalidateControl is an overloaded method used to redraw the bounds rectangle for control. No actions are performed in the method if the Parent control or its Handle are not assigned, during LCL component streaming, or when the control is being freed.

When CtrlIsVisible is set to True or the control has a visible design surface, the InvalidateRect routine is called. The BoundsRect for the control is erased and redrawn when the control uses an opaque drawing style, or when it occludes a sibling control in its Parent.

InvalidateControl is called from methods like Invalidate and ChangeBounds, and when a new value is assigned to the Visible property.

True if the control is visible. True if the control use an opaque drawing style. True if TWinControl descendants are ignored in the method. Handles changes to the Font property.

FontChanged is a procedure used to perform actions needed when the value in the Font property has been changed for the control. FontChanged ensures that values in ParentFont and DesktopFont are set to False to reflect the font assignment.

FontChanged calls the Invalidate method to force the control to be redrawn when it is Visible. The CM_FONTCHANGED control change message is performed to reflect the change in the control state. When AutoSize contains True, the InvalidatePreferredSize and AdjustSize methods are called to update the control dimensions using the new font.

FontChanged is assigned to the OnChange event handler for the Font property in the constructor for the class instance.

Class instance generating the change notification. [Delphi compatible] Does nothing here, all work is done in CMParentFontChanged. Gets the value for the Action property.

The property value is retrieved from ActionLink (when assigned). Otherwise, the property value is Nil.

Value for the Action property. Returns the Caption property.

This method is called by GetText, when GetTextBuf has not been overridden.

Value for the Caption property. Sets the value for the Caption property.

RealSetText is a method used to apply the TCaption value in AValue to the text or caption for the control. RealSetText is called by the private SetText method, when SetTextBuf has not been overridden.

Notes on TControl.Caption, TControl.Text, et. al.

The Delphi VCL implementation relies on the virtual GetTextBuf and SetTextBuf methods to exchange text for controls.. This requires a lot of (unnecessary) copies to move values between Text and Caption.

The LCL uses strings to exchange text values because it is more efficient. To maintain VCL compatibility, the virtual RealGetText and RealSetText methods were introduced. These functions use the LCLInterface. The default GetTextBuf and SetTextBuf implementations calls the RealGetText and RealSetText methods as needed. As long as the GetTextBuf and/or SetTextBuf aren't overridden, GetText and SetText call RealGetText and RealSetText to avoid copying PChar values.

To keep things optimal, LCL implementations should always override RealGetText and RealSetText. GetTextBuf and SetTextBuf are only kept for compatibility with Delphi code.

The string value to store in the Text / Caption properties. Performs actions needed when the value for the Text property has been changed.

TextChanged has an empty implementation in TControl, and is overridden in descendent classes to perform any actions needed for the control type. Called from the CMTextChanged message handler.

Returns the cached Text property (FCaption). True if successful. Here: FCaption (can be overridden). Sets the value for the Action property.

Ensures that ActionLink is updated when the value for the property is updated.

When Value is unassigned (Nil), ActionLink is freed and set to Nil. The control style flags are also updated to remove the value csActionClient. Otherwise, a new ActionLink class instance is created for ActionLink and Value is assigned to its Action property. Its OnChange handler is assigned, and the ActionChange method is called to apply values from the action to the control.

New value for the Action property. Sets the value for the Color property.

SetColor is a method used to set the value for the Color property to the specified TColor value. Assigning a value to Color causes the ParentColor property to be set to False.

SetColor calls Perform to send a CM_COLORCHANGED control message to the widgetset class. Invalidate is called to force the control to be redrawn.

New value for the Color property. Sets the value for the Enabled property.

Calls EnabledChanging to notify handlers for the chtOnEnabledChanged type. Stores the new value for the property, and performs a CM_ENABLEDCHANGED control message. Calls EnabledChanged to notify handlers for the chtOnEnabledChanged type.

New value for the Enabled property. Sets the value for the Hint property.

Value is a TTranslateString type which allows it be recognized and processed in the LCL translation facilities.

New value for the Hint property. Sets the value for the Name property. TComponent.Name New value for the Name property. Sets the value for the Parent property. New value for the the Parent property. Sets the value for the ParentBackground property. New value for the ParentBackground property. Sets the value in the Parent property when the new parent component is a TWinControl instance.

Implements the dynamic method inherited from TComponent. When NewParentComponent is derived from TWinControl, the SetParent method is called to re-parent, position, and resize the control.

TComponent.GetParentComponent
New TWinControl instance used as the Parent for the control. Internal handler for activities after a form widget has been created.

Called by ChildHandlesCreated of parent form.

Functions like GetTextWidth require a valid widget and a device context. That is why AutoSizing is delayed until the handle in a parent Form is allocated.

Gets the value for the MouseCapture property.

Indicates if the class instance is the current CaptureControl for the LCL framework. The property value is True when the following condition are satisfied:

  • Parent is assigned (not Nil).
  • Parent has an allocated window handle.
  • The value in the LCL CaptureContol variable is the current class instance.
True when the current class instance is the LCL CaptureControl. Handler for mouse capture moved to a different control.

Notifies the DragManager of a change to the capture control, and to stop dragging this control. A very dangerous implementation; it can cause an immediate abort of dragging before dragging really starts.

Notification handler for insertion or deletion of components in the control.

First, the inherited TComponent.Notification is called to notify all attached notification handlers.

If Operation is opRemove, additional actions are performed in the method. If AComponent is the component used in PopupMenu, Action, or HostDockSite the property value is set to Nil. If AComponent is an alignment control in anchor docking, the reference is also set to Nil for the AnchorSide where it is used.

TComponent.Notification TOperation
The component being inserted or removed. The action (opInsert or opRemove). Determines whether the Tab key can be used for navigation in the control.

Always returns False in TControl. Overridden in TWinControl.

Always returns False in TControl. Returns a device context handle for the control, from Parent.

Initializes the device context position to the control origin, and shrinks its clipping rectangle to the bounds for the control.

The device context. Returns the window handle of the device context. Gets the value for the Enabled property. Value for the Enabled property. Gets the value for the PopupMenu property. Value for the PopupMenu property. Signals the OnShowHint event handler.

Called when the CM_HINTSHOW message is handled for the control.

Pointer to the structure with the position, width, color, and hint text for the event handler. Signals the OnMouseWheel handlers, when the mouse wheel has been turned.

Multiple wheel handlers can be implemented. First the general OnMouseWheel handler is tried, and if it doesn't report the event handled, then OnMouseWheelUp or OnMouseWheelDown are tried.

The actual WheelDelta is available only to the OnMouseWheel handler, not to the up and down handlers [Delphi compatible].

Set Result to True if handled. State of the modifier keys and mouse buttons. How many notches the wheel has been turned. The mouse coordinates. Signals the OnMouseWheelDown handler. True if the mouse wheel message is handled. Shift, Ctrl or Alt modifier for the mouse wheel event notification. Location for the mouse pointer when the wheel event was generated. Signals the OnMouseWheelUp handler. True if handled. Performs actions needed to handle horizontal mouse wheel events. True when the mouse wheel event has been handled for the control. Shift state for the mouse wheel event. Number of units (or clicks) the mouse wheel was moved. TPoint with the mouse coordinates for the event. Signals the OnMouseWheelLeft event handler (when assigned).

DoMouseWheelLeft is a Boolean function used to perform actions when a horizontal mouse wheel movement towards the left has occurred in the control. It is called, via DoMouseWheelHorz, when a LM_MOUSEHWHEEL message is received and handled in the WMMouseHWheel method.

DoMouseWheelLeft signals the OnMouseWheelLeft event handler when it has been assigned in the control. Shift and MousePos contain the shift modifier and the coordinates where the mouse event occurred. They are passed as arguments to the event handler.

The return value indicates whether the event handler accepted and processed the mouse wheel event at the specified position. The default value is False, but it can be updated in the handler routine. The return value is False if OnMouseWheelLeft has not been assigned.

True if the mouse wheel event was handled in the OnMouseWheelLeft event handler. Shift, Ctrl, or Alt modifier for the mouse wheel event. TPoint instance with the coordinates where the mouse wheel event was detected. Signals the OnMouseWheelRight event handler.

DoMouseWheelRight is a Boolean function used to perform actions when a horizontal mouse wheel movement towards the right has occurred in the control. It is called, via DoMouseWheelHorz, when a LM_MOUSEHWHEEL message is received and handled in the WMMouseHWheel method.

DoMouseWheelRight signals the OnMouseWheelRight event handler when it has been assigned in the control. Shift and MousePos contain the shift modifier and the coordinates where the mouse event occurred. They are passed as arguments to the event handler.

The return value indicates whether the event handler accepted and processed the mouse wheel event at the specified position. The default value is False, but it can be updated in the handler routine. The return value is False if OnMouseWheelRight has not been assigned.

True if the mouse wheel event was handled in the OnMouseWheelRight event handler. Shift, Ctrl, or Alt modifier for the mouse wheel event. TPoint instance with the coordinates where the mouse wheel event was detected. Notifies all chtOnVisibleChanging handlers for the control.

VisibleChanging is called when a new value is assigned to the Visible property. It occurs before the new property value is stored to its member in the class instance. It allows all of the TNotifyEvent routines registered for the chtOnVisibleChanging control handler type to be signalled prior to the change in the property value.

VisibleChanging calls the DoCallNotifyHandler method to signal each of the handler routines using the chtOnVisibleChanging control handler type. The class instance is used as the Sender argument for the event notification.

Use AddHandlerOnVisibleChanging and RemoveHandlerOnVisibleChanging to manage the TNotifyEvent handler routines for the chtOnVisibleChanging handler type used in the control.

See VisibleChanged for the actions performed after the value in Visible has been updated.

TNotifyEvent
Notifies all chtOnVisibleChanged handlers for the control.

VisibleChanged is called when a new value has been assigned to the Visible property. It occurs after the new property value is stored to its member in the class instance. It allows all of the TNotifyEvent routines registered for the chtOnVisibleChanged control handler type to be signalled for the new property value.

VisibleChanged calls the DoCallNotifyHandler method to signal each of the handler routines using the chtOnVisibleChanged control handler type. The class instance is used as the Sender argument for the event notification.

Use AddHandlerOnVisibleChanged and RemoveHandlerOnVisibleChanged to manage the TNotifyEvent handler routines for the chtOnVisibleChanged handler type used in the control.

See VisibleChanging for the actions performed before the value in Visible is updated.

TNotifyEvent
Notifies all chtOnEnabledChanging handlers for the control.

EnabledChanging is called when a new value has been assigned to the Enabled property. It occurs after the new property value is stored to its member, and before a CM_ENABLEDCHANGED control message is posted for the control. It allows all of the TNotifyEvent routines registered for the chtOnEnabledChanging control handler type to be signalled for the new property value.

EnabledChanging calls the DoCallNotifyHandler method to signal each of the handler routines using the chtOnEnabledChanging control handler type. The class instance is used as the Sender argument for the event notification.

Use RemoveHandlerOnEnabledChanging to manage the TNotifyEvent handler routines for the handler type used in the control. AddHandler and RemoveHandler can be used if the control handler type is passed as an argument.

See EnabledChanged for the actions performed after the value in Enabled is updated.

TNotifyEvent
Notifies all chtOnEnabledChanged handlers for the control.

EnabledChanged is called when a new value has been assigned to the Enabled property. It occurs after the EnabledChanging method has been called, and the CM_ENABLEDCHANGED control message has been sent for the control. It allows all of the TNotifyEvent routines registered for the chtOnEnabledChanged control handler type to be signalled for the new property value.

EnabledChanged calls the DoCallNotifyHandler method to signal each of the handler routines using the chtOnEnabledChanged control handler type. The class instance is used as the Sender argument for the event notification.

Use AddHandlerOnEnabledChanged and RemoveHandlerOnEnabledChanged to manage the TNotifyEvent handler routines for the handler type used in the control. AddHandler and RemoveHandler can be used if the control handler type is passed as an argument.

See EnabledChanging for the actions performed before the value in Enabled is updated in its widgetset class instance.

TNotifyEvent
Adds a notification handler for the specified control handler type.

AddHandler is a method used to include the handler routine specified in AMethod in the list of notification handlers for the type in HandlerType.

HandlerType is a TControlHandlerType enumeration value, and indicates both the subject for the notification and the method list where the handler routine is stored.

AMethod is the TMethod instance with the handler routine signalled when a notification is needed. It is an object procedure which implements the TNotifyEvent signature and cast to the TMethod type.

AddHandler ensures that a TMethodList instance has been allocated for handler routines using the specified type; if it does not exist, it is created and stored in the internal array of handler types.

AddHandler calls the Add method in the method list to store the routine in AMethod.

AsFirst indicates whether the routine is inserted as the first item in the list. When set to False, the routine is appended as the last entry in the method list.

Use RemoveHandler to remove a handler routine from the method list for a specific handler type.

Convenience methods which act upon a specific control handler type using TNotifyEvent arguments are also available. For example:

  • AddHandlerOnResize
  • AddHandlerOnChangeBounds
  • AddHandlerOnVisibleChanged
  • and others
TMethodList TMethod TNotifyEvent
Control handler type of the handler routine. The handler routine added in the method. True if the handler routine is signalled first in the notification order. Removes a notification handler from the list for the specified handler type.

RemoveHandler is a method used to remove the specified handler routine from the method list for a given control handler type. It removes an entry in the method list created using the AddHandler method.

HandlerType is a value from the TControlHandlerType enumeration that identifies the method list updated in the method. It is an index into the internal array of TMethodList instances used to store handler routines.

AMethod is the TMethod instance to locate and remove from the method list for the handler type. It is a reference to a TNotifyEvent implementation cast to the TMethod type used in the method list.

RemoveHandler calls the Remove method in the TMethodList instance using AMethod as an argument.

Convenience methods are provided that manage a method list for a single control type handler. For example:

  • RemoveHandlerOnResize
  • RemoveHandlerOnChangeBounds
  • RemoveHandlerOnVisibleChanging
  • and others
TMethodList TMethod
Control handler type for the routine removed in the method. The handler routine removed from the list of handlers for the specified type. Signals handler routines for the specified control handler type.

DoCallNotifyHandler is a method used to signal control handler routines which were added for the specified HandlerType.

HandlerType is a value form the TControlHandlerType enumeration which identifies the list with the routines signalled in the method.

A control handler routine is a reference to a TNotifyEvent implementation. In TControl, multiple handler routines can be added for a given handler type. DoCallNotifyHandler ensures that each of the routines is signalled using the control instance as the Sender or origin for the notification.

DoCallNotifyHandler uses the value in HandlerType to select the TMethodList with the handler routines. The CallNotifyEvents method in the TMethodList instance is called to perform the event notification.

DoCallNotifyHandler is called from methods which perform event notifications using both a published event handler property and a list of control handlers. For example: DoOnResize and DoOnChangeBounds. These methods signal the event handlers represented by the OnResize and OnChangeBounds properties. They also use DoCallNotifyHandler for their control handler types (chtOnResize and chtOnChangeBounds) to signal the additional handlers added to the control.

DoCallNotifyHandler is also called from methods which do not have a published event handler property, but may have control handlers added at run-time. For example: VisibleChanging and EnabledChanged.

Identifies the handler type for the routines signalled in the method. Passes key events for the specified type to the handlers added to the control.

DoCallKeyEventHandler iterates over the handler routines using the type specified in HandlerType. The routines are cast to the TKeyEvent type used to implement the handler and receives the arguments specified in Key and Shift. The current class instance is used as the Sender for the event notification.

DoCallKeyEventHandler is called from the KeyDown method in descendent classes like TWinControl.

TShiftState
Type for the handler, like OnKeyDown. Key code for the key event notification. Shift, Ctrl, or Alt modifier for the key event notification. Executes assigned mouse wheel events until a handler is found for the event notifications.

DoCallMouseWheelEventHandler iterates over the handler routines using the type specified in HandlerType. The routines are cast to the TMouseWheelEvent type used to implement the handler and receives the arguments specified in Shift, WheelDelta, MousePos, and Handled. Iteration is halted when an event handler returns True in the Handled argument, or when all handlers for the type have been signalled.

The current class instance is used as the Sender for each of the event notifications.

DoCallMouseWheelEventHandler is called from methods like DoMouseWheel and DoMouseWheelHorz.

Type for the handlers signalled in the method. Shift, Ctrl, or Alt modifier for the mouse wheel event notification. Number of relative units that the mouse wheel was moved. Negative values indicate a move wheel up or left direction. Position of the mouse pointer when the wheel event occurred. Set to True in a handler routine if the control handles the event notification. Signals the OnContextPopup handler.

DoContextPopup is a method used to signal the OnContextPopup event handler (when assigned). The control instance is used as the Sender argument. Values in MousePos and Handled are also passed as parameters to the event handler. Handled should be set to True in the handler routine if the context pop-up was displayed and a menu item was executed.

TPoint instance with the Mouse position, used to place the menu. Set to True in the event handler if the menu display and selection was handled for the control. Moves the control in front of or behind all sibling controls.

SetZOrder calls the SetChildZPosition method in the Parent control to change the Z-Order for the control instance. TopMost indicates whether the control is moved to the top or bottom of the Z-Order.

No actions are performed in the method when Parent has not been assigned.

SetZOrder is used to implement the BringToFront and SendToBack methods. It may be overridden is descendent classes to perform actions needed for the derived controls. See TCustomForm.SetZOrder.

TCustomForm.SetZOrder
True to move the control in front of other sibling controls. False to move the control behind other siblings. Returns the default dimensions for new instances of the class.

The CX member is set to 75 (pixels). The CY member is set to 50 (pixels).

TSize instance with the Width and Height for a new instance of the control class. Implements the storage specifier for the Color property. True when ParentColor is not enabled for the control. Applies layout changes using the specified policy and scaling proportions to the control.

DoAutoAdjustLayout is a method which implements changes to control sizes for the AutoAdjustLayout method. These methods are called when High-DPI and scaling have been enabled in the project options for an application.

AMode indicates the automatic layout policy applied in the method. It is a value from the TLayoutAdjustmentPolicy enumeration, and determines whether horizontal / vertical / or both sizes are adjusted in the method. It generally reflects the constraints for the device type where the application is running.

AXProportion and AYProportion contain the scaling factors applied to the horizontal and/or vertical sizes.

DoAutoAdjustLayout ensures that new values for Height and Width in the control are calculated (when allowed and needed) using the scaling factors, Constraints, BorderSpacing and Anchors for the control. The SetBoundsKeepBase method is called to apply the newly calculated values to the control.

Font scaling is performed in AutoAdjustLayout (when needed) and occurs prior to calling DoAutoAdjustLayout.

DoAutoAdjustLayout, ScaleFontsPPI, and FixDesignFontsPPI are often overridden in descendent classes to perform additional actions needed for a control or its children.

Identifies the auto-layout policy applied in the method. Scaling factor for horizontal dimensions. Scaling factor for vertical dimensions. Applies the design-time PPI and resizes the specified control font.

Implements the FixDesignFontsPPI method for the control.

Performs actions needed to restore the design-time PPI (Pixels Per Inch) for controls when they are loaded using the LCL component streaming mechanism. The design-time PPI for fonts is not stored in .LFM files, and could result in invalid scaling operations when loaded on a machine with a different display density. DoFixDesignFontPPI ensures that the font is resized to the specified design-time PPI.

TFont instance updated in the method. Design-time display density to which the font height is adjusted. Implements the ScaleFontsPPI method for the control.

Adjusts the height for a given Font to the specified pixels per inch (PPI).

Font examined and updated in the method. Pixels per inch setting adjusted in the method. Scaling factor a applied to the font. The default ActionLink class (TControlActionLink). Used when the control is linked to an Action. Returns the TControlActionLink type. Handler for a changed Action. Several properties are copied from the new Action. The changed Action. When True, forces update of all properties. Otherwise only properties in default state are overwritten. Link to the default Action associated with this control. Indicates if the desktop (system) font is used for the text displayed on this control.

DesktopFont is a Boolean property which indicates whether the default desktop (or system) font is used to display the text on the control. The default value for the property is set to True in the Create constructor, and indicates that an explicit assignment has not been made to the Font property. When set to True, the System font in Screen is loaded into the Font property.

Changing the property value causes a CM_SYSFONTCHANGED message to be performed for the control. DesktopFont is set to False when an explicit TFont value is assigned to the Font property.

TScreen.SystemFont Screen
The cursor shape shown during a drag operation.

The default value is crDrag. If the control cannot be dropped on a target, the cursor changes temporarily to crNoDrop.

Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock.

Set to dkDrag for a drag-drop operation, or to dkDock for a drag-dock operation.

Determines how a drag operation is started for the control.

DragMode is a TDragMode property which determines how a drag operation is started for the control.

dmManual is the default value, and indicates that drag operation must be started in code by calling the BeginDrag method.

dmAutomatic allows a drag operation to start when the mouse pointer is dragged over the control.

Use DragKind to specify whether the drag operation is a drag-and-drop or a drag-and-dock operation.

True when mouse messages are currently captured by this control.

In normal operation, all mouse messages are sent to the control under the mouse pointer. Mouse messages also can be sent to a capturing control, e.g. when a control is dragged.

Applications should capture mouse events only for special purposes, and release the capture as soon as a the target position has been determined. Limited user feedback is possible while the mouse is captured, not all application controls will work properly so long.

Indicates if the control uses the background color from its Parent control.

ParentBackground is a Boolean property which indicates if the background color from the Parent control is used as the background color for the current control instance.

ParentBackground is True when csParentBackground is included in the ControlStyle property. Setting the value in ParentBackground causes ControlStyle to be updated to include or exclude the csParentBackground enumeration value; it is included when the property is set to True.

ParentBackground and ParentColor are updated when a new value is assigned to the Color property. The properties are set to False when an explicit color is assigned to the Color property.

Use the Color from the Parent control, when enabled.

ParentColor determines if the control should use the Color from the Parent control, when enabled. The default value is True.

When this property is True, all changes to the Color of the parent will also be applied to the Color of the control, ensuring that they both contain same value. If the Color of the control is changed by the application, then ParentColor will be automatically set to False.

Using ParentColor when the Color value is clDefault can cause problems in resolving the actual color value. To obtain the Color property of a control while taking into account clDefault and ParentColor, use the GetColorResolvingParent method. This method might return a non-RGB color, but will never return clDefault. To obtain a purely RGB result use the GetRGBColorResolvingParent method.

Indicates if the Font from the Parent control is used in the control.

While ParentFont is True, changes to the font in the Parent are also applied to the Font for the control. This synchronizes them, keeping them set to the same value. If the value in Font is changed by the application, then ParentFont will automatically be set to False.

The default value for ParentFont is True.

If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.

While ParentShowHint is True, all changes to the ShowHint property of the parent will also be applied to the ShowHint property for the control. This synchronizes them, keeping them with the same value. If the ShowHint property for the control is changed by the application, then ParentShowHint will automatically be set to False.

Delimited list of property or sub-component property names saved to and restored from an external storage mechanism.

SessionProperties is a String property with the names of properties, in the class instance or its child Components. SessionProperties allows published property values to be saved to and restored from an external storage mechanism like: TIniPropStorage, TXMLPropStorage, or TJSONPropStorage.

Values in the property are delimited using the ';' (SemiColon) character. Component properties require both the component and property names using dotted notation like 'Image1.Visible'. In the TForm descendent class, the values can be assigned at design-time using a dialog in the Lazarus IDE, or by setting the property value at run-time.

In TControl, SessionProperties has protected visibility; it is elevated to published visibility in the TForm descendant.

TForm.SessionProperties
String with the text or caption for the control.

This is the character string, shown in controls with visible text content (TEdit...).

BEWARE: In other controls it can be the Name or Caption of the control, quite tricky to use.

The Delphi VCL implementation stores Text mostly in the widgets, using the virtual Get/SetTextBuf methods to exchange text between widgets and VCL. This means a lot of text copies and message handling in WM_GETTEXT and WM_SETTEXT.

The LCL instead (typically) stores Text in a field of the control, and transfers it from/to the widgets only when required.

To maintain VCL compatibility, the virtual RealGet/SetText methods have been introduced, which read or write the Caption string directly.

The default Get/SetTextBuf implementation calls the RealGet/SetText methods, resulting in a string-to-PCHAR and another PCHAR-to-string conversion. But as long as Get/SetTextBuf is not overridden, Get/SetText can (and does) safely call RealGet/SetText immediately, to avoid the mentioned conversions.

To keep things optimal, LCL components should always override RealGet/SetText; Get/SetTextBuf is only kept for compatibility.

This handler can supply specific Constraints (size limits), when the control is resized. Invoked when a context-sensitive pop-up menu is requested.

The handler can show and handle the menu selection itself. If so, it should set Handled to True. Otherwise the installed PopupMenu is shown.

Event handler signalled when a mouse double click occurs in the control.

OnDblClick is a TNotifyEvent property with the event handler signalled when the mouse is double-clicked on the control. OnDblClick is signalled from the DblClick method, and occurs when the LM_LBUTTONDBLCLK message is handled in the WMLButtonDBLCLK method.

Click events are not generated if csClickEvents has been omitted from the ControlStyle flags for the control.

Double-clicking is much more common in a Windows environment than in Unix or Linux, where single-clicking is the default method for selecting an object. However, in all environments there could be valid use for a double-click, and a method should be supplied if appropriate.

Use OnClick to perform actions needed when a single mouse click occurs in the control.

TNotifyEvent
Event handler signalled when a mouse triple click occurs in the control.

OnTripleClick is a TNotifyEvent property with the event handler signalled when the mouse is triple-clicked on the control. OnTripleClick is signalled (when assigned) from the TripleClick method, and occurs when the LM_LBUTTONTRIPLECLK message is handled in the WMLButtonTRIPLECLK method.

Click events are not generated if csClickEvents has been omitted from the ControlStyle flags for the control.

Use OnClick or OnDblClick to perform actions needed when a single or double mouse click occurs in the control.

TNotifyEvent
Event handler signalled when a mouse quadruple mouse occurs in the control.

OnQuadClick is a TNotifyEvent property with the event handler signalled when the mouse is quadruple-clicked on the control. OnQuadClick is signalled (when assigned) from the QuadClick method, and occurs when the LM_LBUTTONQUADCLK message is handled in the WMLButtonQUADCLK method.

Click events are not generated if csClickEvents has been omitted from the ControlStyle flags for the control.

Use OnClick, OnDblClick, or OnTripleClick to perform actions needed when a single, double, or triple mouse click occurs in the control.

TNotifyEvent
Event handler signalled when an object is dropped onto the control.

OnDragDrop is a TDragDropEvent property with the event handler signalled when another control is dropped onto the control instance. Unlike with drag-dock, a default action is not associated with the drag-drop operation. The OnDragDrop handler is the only way to do something meaningful for the drag-drop operation.

The Sender argument contains the current control instance (Self) for for the event.

The Source argument is the object (TControl) which is droppped onto the current control instance.

X and Y contains the control-relative coordinates for the mouse pointer when the event occurred.

OnDragDrop is signalled from the DragDrop method, and occurs when dmDragDrop messages (TDragMessage) are handled for the control.

Event handler signalled when a control is dragged over the control instance.

OnDragOver is a TDragOverEvent property with the event handler signalled when another control is dragged over the current control. It is signalled from the DragOver method, and occurs when drag messages are handled for the control.

The Sender argument is the current TControl instance.

The Source argument contains the control instance which is being dragged over the control.

The X and Y arguments contain the control-relative coordinates for the mouse pointer when the event was triggered.

State indicates whether the event has occurred when the mouse pointer entered the control, was repositioned, or exited the control.

The Accept argument indicates whether the drag operation is handled in the routine or rejected. Set Accept to False to reject a drop on the control.

Event handler signalled for the end of a drag-dock operation.

OnEndDock is a TEndDragEvent property with the event handler signalled when a drag-dock operation is ended. It occurs when the EndDrag method is called for the active drag object in the DragManager.

Use OnEndDrag to perform actions needed when a drag-drop operation is ended.

Event handler signalled for the end of a drag-drop operation.

OnEndDrag is a TEndDragEvent property with the event handler signalled when a drag-drop operation is ended. It occurs when the EndDrag method is called for the active drag object in the DragManager.

Use OnEndDrag to perform actions needed when a drag-drop operation is ended.

Event handler signalled when a mouse down event is handled for the control.

OnMouseDown is signalled (when assigned) from the MouseDown method. It occurs after the parent form has been focused, and an active edit control has been cancelled. If the DragManager is active, it has already been updated with the mouse position prior to the event.

An application must implement and assign a TMouseEvent handler routine to the property which responds to the event notification.

Use OnMouseUp to perform actions needed when a mouse up event is handled for the control.

Use OnMouseMove to perform actions needed when the mouse pointer position has changed for the control.

Use OnMouseWheel, OnMouseWheelDown, and OnMouseWheelUp to preforms actions needed when mouse scroll wheel messages are handled for the control.

Event handler signalled when the mouse pointer is moved in the control.

OnMouseMove is a TMouseMoveEvent property with the event handler signalled when the LM_MOUSEMOVE message is handled for the control. It is signalled (when assigned) from the MouseMove method, and occurs after the mouse position has been updated and the DragManager has been notified of the new pointer position.

An application can implement and assign an object procedure to the event handler to perform actions needed when the mouse position is changed within the control. The control for the notification event is passed as the Sender argument.

Use OnMouseDown and OnMouseUp to respond to mouse button events in the control.

Use OnMouseEnter and OnMouseLeave to respond to mouse movements where the pointer enters or exits the control.

Use OnMouseWheel to perform actions needed when a mouse wheel event occurs in the control.

Event handler signalled when a mouse up event is handled for the control.

OnMouseUp is signalled (when assigned) from the MouseUp method. It is signalled when standard mouse events are enabled using the ControlStyle property. The event is signalled after the mouse position has been updated and the event is applied to an active DragManager.

An application must implement and assign a TMouseEvent handler routine to the property which responds to the event notification.

Use OnMouseDown to perform actions needed when a mouse down event is handled for the control.

Use OnMouseMove to perform actions needed when the mouse pointer position has changed for the control.

Use OnMouseWheel, OnMouseWheelDown, and OnMouseWheelUp to preforms actions needed when mouse scroll wheel messages are handled for the control.

Event handler signalled when the mouse pointer has entered the control.

OnMouseEnter is a TNotifyEvent property with the event handler signalled when the mouse pointer has entered the bounds for the control. OnMouseEnter is signalled from the MouseEnter method (when assigned), and occurs after the Parent control has been notified of the event. The Sender argument contains the control for the notification, and must be cast to a TControl type to access the properties or values specific to the class type.

Use OnMouseLeave to perform actions needed when the mouse pointer has left the bounds for the control.

TNotifyEvent
Event handler signalled when the mouse pointer has left the control.

OnMouseLeave is a TNotifyEvent property with the event handler signalled when the mouse pointer has left the bounds for the control. OnMouseLeave is signalled from the MouseLeave method (when assigned), and occurs after the Parent control has been notified of the event. The Sender argument contains the control for the notification, and must be cast to a TControl type to access the properties or values specific to the class type.

Use OnMouseEnter to perform actions needed when the mouse pointer has entered the bounds for the control.

TNotifyEvent
Event handler for mouse wheel turned.

OnMouseWheel is a TMouseWheelEvent property with the event handler signalled when a mouse wheel movement occurs in for the control. By default all mouse wheel actions are translated into scroll events. Write an OnMouseWheel handler to react when the mouse wheel is rotated.

Arguments for the event handler routine include:

Sender
The control for the event notification.
Shift
The shift modifier in effect when the action occurred.
WheelDelta
The relative number of units and direction the mouse wheel was rotated.
MousePos
The location for the mouse pointer when the event occurred.
Handled
A variable argument which indicates if the mouse wheel movement is handled in the event handler.

OnMouseWheel is signalled (when assigned) from the DoMouseWheel method, and occurs when the LM_MOUSEWHEEL message is handled in the WMMouseWheel method. If the event handler does not set the Handled argument to True, other assigned handler routines are signalled. These include control handlers added using the AddHandler method, as well as OnMouseWheelDown and OnMouseWheelUp.

The value in WheelDelta argument is used to determine the handler signalled. OnMouseWheelUp is used when the delta value (or the relative number of units of movement) is 0 (zero) or a positive number. OnMouseWheelDown is used when the delta value is a negative number.

Neither OnMouseWheelUp nor OnMouseWheelDown include the wheel delta value; they are simple notifications that the event has occurred at a given position.

Event handler signalled for a downward movement of the mouse wheel.

OnMouseWheelDown is a TMouseWheelUpDownEvent property with the event handler signalled when a downward movement of the mouse wheel has occurred in the control.

OnMouseWheelDown is signalled (when assigned) from the DoMouseWheelDown method using the control instance as the Sender for the event notification. It occurs when the OnMouseWheel event handler has not been assigned, or does not handle the mouse wheel event.

Use OnMouseWheelUp to perform actions needed when an upward movement of the mouse wheel has occurred.

Use OnMouseWheel when a delta value with the direction for the mouse wheel movement is needed.

Event handler signalled for an upward movement of the mouse wheel.

OnMouseWheelUp is a TMouseWheelUpDownEvent property with the event handler signalled when the mouse wheel has been rotated in the upward direction. It is signalled (when assigned) in the DoMouseWheelUp method.

OnMouseWheelUp occurs when a mouse wheel event is handled in the WMMouseWheel method, and an OnMouseWheel event handler has not been assigned or does not handle the mouse wheel event in the DoMouseWheel method.

The arguments for the TMouseWheelUpDownEvent event handler include:

Sender
The control for the event notification.
Shift
The Ctrl, Alt, or Shift modifier in effect when the wheel event occurred.
MousePos
The location of the mouse pointer when the event occurred.
Handled
An variable Boolean argument which indicates if the event is handled in the routine.

OnMouseWheelUp is used when the delta value (or the relative number of units of movement) is 0 (zero) or a positive number.

OnMouseWheelDown is used when the delta value is a negative number.

Neither OnMouseWheelUp nor OnMouseWheelDown include the delta value; they are simple notifications that the event has occurred at a given position.

Use OnMouseWheel when the delta value (or the relative number of units of movement) are important.

Event handler signalled for a horizontal movement of the mouse wheel.

OnMouseWheelHorz is a TMouseWheelEvent property with the event handler signalled when a mouse wheel tilt event occurs in the control. It is signalled (when assigned) from the DoMouseWheelHorz method, and occurs when the LM_MOUSEHWHEEL message is handled in the WMMouseHWheel method.

An application can implement and assign a TMouseWheelEvent routine to the event handler to perform actions needed when the event occurs in the control. Other control handlers, created using AddHandler and the chtOnMouseWheelHorz handler type, may be signalled if OnMouseWheelHorz has not been assigned or does not handle the mouse wheel event.

OnMouseWheelLeft or OnMouseWheelRight may be signalled (when assigned) if OnMouseWheelHorz or other control handlers have not been assigned or do not handle the mouse wheel event. The value in the WheelDelta argument determines which handler is used; OnMouseWheelLeft when the delta is a negative number and OnMouseWheelRight when the delta is 0 or a positive number.

OnMouseWheelHorz, and the other horizontal mouse wheel event handlers, require a mouse with a tilting scroll wheel to generate the event notification.

Event handler signalled for a leftward movement of the mouse wheel.

OnMouseWheelLeft is a TMouseWheelUpDownEvent property with the event handler signalled when the mouse wheel is "tilted" towards the left. It is signalled (when assigned) from the DoMouseWheelLeft method, and occurs when the LM_MOUSEHWHEEL message is handled in the WMMouseHWheel method.

Applications can implement and assign a TMouseWheelUpDownEvent to perform actions needed when the event has occurred in the control. The arguments to the event handler include:

Sender
The control for the event notification.
Shift
The shift modifier in effect when the event occurred.
MousePos
The coordinates for the mouse pointer when the event occurred.
Handled
A variable argument which indicates if the wheel event is handled in the routine.

There are several horizontal mouse wheel event handlers, and they are signalled in order until a handler is found that responds to the event notification. These include:

  • OnMouseWheelHorz
  • Controls handlers added using AddHandler and the chtOnMouseWheelHorz handler type.
  • OnMouseWheelLeft or OnMouseWheelRight depending on the WheelDelta - or relative units of movement for the mouse wheel.

OnMouseWheelLeft, and the other horizontal mouse wheel event handlers, require a mouse with a tilting scroll wheel to generate the event notification.

Event handler signalled for a rightward movement of the mouse wheel.

OnMouseWheelRight is a TMouseWheelUpDownEvent property with the event handler signalled when the mouse wheel is "tilted" towards the right. It is signalled (when assigned) from the DoMouseWheelRight method, and occurs when the LM_MOUSEHWHEEL message is handled in the WMMouseHWheel method.

Applications can implement and assign a TMouseWheelUpDownEvent to perform actions needed when the event has occurred in the control. The arguments to the event handler include:

Sender
The control for the event notification.
Shift
The shift modifier in effect when the event occurred.
MousePos
The coordinates for the mouse pointer when the event occurred.
Handled
A variable argument which indicates if the wheel event is handled in the routine.

There are several horizontal mouse wheel event handlers, and they are signalled in order until a handler is found that responds to the event notification. These include:

  • OnMouseWheelHorz
  • Controls handlers added using AddHandler and the chtOnMouseWheelHorz handler type.
  • OnMouseWheelLeft or OnMouseWheelRight depending on the WheelDelta - or relative units of movement for the mouse wheel.

OnMouseWheelRight, and the other horizontal mouse wheel event handlers, require a mouse with a tilting scroll wheel to generate the event notification.

Event handler for the start of a docking operation.

The handler can provide a special DragDock object, otherwise a default object is created.

Event handler signalled for the start of a dragging operation.

OnStartDrag is a TStartDragEvent property with the event handler signalled when a drag operation is started for the control. Use the event handler to perform actions needed when the drag operation is started, such customizing the drag cursor or initializing related drag event handlers.

The Sender argument is the TControl instance for the event notification.

The DragObject argument returns the TDragControlObject allocated by the drag manager when the drag operation was started.

Event handler signalled when editing is completed for the control.

The user has finished editing the value for the control, and the resulting text can be validated. It is called (when assigned) from the EditingDone method, which occurs when focus changes to another control.

Deprecated. DEPRECATED. Enables valid use of the 'IN' operator (this is a hack for speed). It will be replaced by the use of the widgetset classes. So, don't use it anymore. Signals the OnDragDrop handler when a dragged object is dropped onto this control. The dropped object (control or DragDrop object). The drop position in client coordinates. The drop position in client coordinates. Moves the control into a new docksite.

Calls DoDock to prepare for the new position of the control, when docked into an unmanaged or floating docksite.

When the old and new docksites are different, the control is removed from the DockClients of the old docksite, and added to the DockClients of the new docksite; afterwards the docksites are notified by calling their DoAddDockClient and DoRemoveDockClient methods, to adjust the control's Parent.

An exception is raised if there is already a docking process in progress for this control.
The host site into which which the control is to be docked, Nil for floating. The new Bounds for the control. Expressed in screen coordinates when NewDockSite is Nil. Otherwise, client coordinates for NewDockSite. Docks a control programmatically.

Docks this control into NewDockSite, relative to DropControl. When NewDockSite is Nil, the control becomes floating.

When the new docksite uses an DockManager, and DropControl is not Nil, the control will be docked relative to DropControl, as specified by ControlSide.

The interpretation of ControlSide depends on the DockManager of NewDockSite, or on the OnDockDrop handler in an unmanaged docksite.

A tree docking manager (TDockTree) should interpret alCustom as NoteBook docking, i.e. a tabbed notebook is created in place of DropControl, and both DropControl and this control are docked into pages of this notebook.

True if successfully docked. The site into which the control is docked; Nil to make it float. The sibling control where the control is inserted; can be Nil. The side or edge of the DropControl to which the control is docked. Undocks the control into a floating dock site.

ManualFloat is a Boolean function used to undock the control. It undocks the control from the HostDockSite (when assigned) found in the control or in its Parent.

For TControl, which does not have a handle, a floating host dock site where the control can be docked is created. TWinControl has a handle and can float without any assistance.

The Dock method is called to dock the control to the new floating dock site.

The return value is True if the control was successfully undocked and re-docked to a floating dock site.

True if successfully floated. The screen area where the floating control is moved; or the client area for a floating host site. True if the undocked control keeps its docked dimensions. The default value is True. Replaces a previously docked control.

This method exists for use by the DockManager for NoteBook docking. It should not be used in application code.

Delphi introduced a different method, DockReplaceDockClient, which is used when the replaced Control is in an unmanaged docksite.

True if the docked control has been successfully replaced. The control to be replaced, will be docked into NewDockSite. The new dock site for Control, typically a docking Notebook. The control to which Control is docked. The side of DropControl, to which Control is docked. Indicates if the control has a host dock site.

Docked is a Boolean function which indicates if the control instance is docked to a host docking site. The return value is True when all of the following conditions are met:

  • Parent is assigned (not Nil).
  • Parent has the same value as the HostDockSite property.
  • Parent has a parent form with a value different than the one in Parent.
GetParentForm
True if the Parent control is also the HostDockSite for the control. Returns True if the control is being dragged. Returns True if the control is being dragged. Returns True if the control is being dragged. Creates a TLazAccessibleObject instance for this control.

CreateAccessibleObject should just create and return the object instance. It is useful for classes derived from a descendant of TLazAccessibleObject (instead of the base class).

Returns the currently selected child accessibility object.

GetSelectedChildAccessibleObject is provided for controls which wish to override this behavior without sub-classing TLazAccessibleObject.

Returns the child accessibility object at the given position for the control.

GetChildAccessibleObjectAtPos returns the accessibility object at the position expressed in client coordinates. This method is provided for controls which wish to override this behavior without sub-classing TLazAccessibleObject.

Scales a size value from the design-time PPI to the run-time PPI for the parent form. Scaled sized value. Original size value scaled in the method. Scales a size value from the run-time PPI for the parent form to the design-time PPI. Scaled sized value. Original size value scaled in the method. Scales a size value from 96 PPI to the run-time PPI for the Screen. Scaled size value. Original size value scaled in the method. Scales a size value from the PPI for the Parent form (or designer control) to 96 PPI. Scaled size value. Original size value scaled in the method. Scales a size value from 96 PPI to the PPI setting for the Font in the control. Scaled sized value. Original size value scaled in the method. Scales a size value from the PPI setting in the Font for the control to 96 PPI. Scaled size value. Original size value scaled in the method. Scales a size value from the PPI setting for the Screen to the PPI setting for the Font in the control. Scaled size value. Original size value scaled in the method. Scales a size value from the PPI setting for the Font to the PPI setting for the Screen. Scaled size value. Size value scaled in the method. Scales a size value from 96 PPI to the PPI setting for the Screen. Scaled size value. Size value scaled in the method. Scales a size value from the PPI setting for the Screen to 96 PPI. Scaled size value. Size value scaled in the method. Smart way to DoAutoSize.

AdjustSize is the same as Delphi the TWinControl.DoAutoSize method. But since DoAutoSize is commonly overridden in descendent components, it is not useful to perform all tests, which can result in too much overhead. To reduce this the LCL calls AdjustSize instead.

During loading and handle creation the calls are delayed.

Auto-sizing phases enabled for the control.

AutoSizePhases is a TControlAutoSizePhases function used to get the Autosizing phases enabled for the control. In general, the values in AutoSizePhases depend on the TWinControlFlag values enabled for the control.

For TControl, the values from the Parent control are used. If the Parent control is unassigned, the value is an empty set ([]).

For TWinControl, the value from the Parent control are used (when a Parent has been assigned). Otherwise, the windows control flags are used to get the return value. For example:

wcfCreatingHandle,wcfCreatingChildHandles
Includes caspCreatingHandles in the set
wcfRealizingBounds
Includes caspRealizingBounds in the set
wcfUpdateShowing
Includes caspShowing in the set

In addition, AutoSizingAll forces caspComputingBounds to be included in the set. caspChangingProperties is included when the internal auto-sizing lock count has a value greater than zero (0).

Set with the TControlAutoSizePhase values. Returns True if auto-sizing has been delayed until some other process is complete. True if auto-sizing has been delayed. Returns a string with a debugging message for delayed auto-size requests. Formatted message with flag, counter, or property values related to delayed auto-sizing in the control. Returns True if AutoSize should be skipped or delayed because of its handle.

A TControl instance does not have a handle, so it needs a parent control.

True if AutoSize should be skipped or delayed because of its handle. Anchor to Sibling at Side.

Setup AnchorSide to anchor a side to a neighboring sibling control. For example: Right side to Left side, or Top side to Bottom.

The side to be anchored to Sibling. The minimum space to Sibling. The sibling control to which we should anchor. Anchor parallel to Sibling, at Side. The side to anchor to the sibling. The minimum space to Sibling. The sibling control to which we should anchor. Anchors the horizontal center of the control to the center of the specified sibling. The sibling control to which we should anchor. Anchors the vertical center of the control to the center of the specified Sibling. The sibling control to which we should anchor. Anchor to Sibling at Side, with the same extent.

Table or tree style anchoring, into a neighbor cell of Sibling. Obtain the row height (or column width) from Sibling.

The side to anchor to the sibling. The minimum space to Sibling. The sibling control to which we should anchor. Copy Sibling's anchoring for Side. The side to anchor like the sibling does. The sibling control from which to inherit anchoring. Anchor to the Parent using the Align value for the control.

The anchor control used in the TAnchorSide instances is always the Parent control.

Indicates the position in AnchorAlign with the anchored edges for the alignment value. Border spacing between the control and its anchored edges. Anchor to Parent's full client area. The around space. The number of controls anchored to the current control. Number of controls anchored to the current control. Provides indexed access to controls which are anchored to the current control by their ordinal position.

AnchoredControls is a read-only indexed TControl property which allows access to controls which which are anchored to the control instance. Anchored controls are indexed by their ordinal position in the list used to store the values.

Ordinal position for the anchored control in the property value. Sets the bounds (Left, Top, Width, Height) of the control.

SetBounds can be used to change the Left, Top, Width, and Height properties as a single action. This reduces the overhead required for the common operation. Use DisableAutoSize and EnableAutoSize to reduce the overhead for recomputing/moving/resizing even further.

SetBounds is also called when any one of these properties, or the BoundsRect property is set. SetBounds updates BaseBounds and BaseParentClientSize, which are used by the anchoring mechanism to keep the spacing between controls. For example loading a Form with TMemo and the .lfm contains TMemo's Left and Width, then SetBounds is called two times for the memo.

When the user maximizes a window, SetBounds is called for the form, but not for the Memo, keeping the BaseBounds of the Memo. If the Memo is anchored to the right, the Width of the Memo is changed based on the BaseBounds and BaseParentClientSize.

Keep in mind that the given aLeft, aTop, aWidth, aHeight might not be valid and will be changed by the LCL before applied.

Delphi calls SetBounds more often. SetBounds calls ChangeBounds with the KeepBase argument set to False.

The X coordinate of the left side of the control. The Y coordinate of the top of the control. The width of the control. The height of the control. Sets the bounds of the control initially, when it is created. Does nothing while the control is loaded. X coordinate for the top, left pixel. Y coordinate for the top, left pixel. Width of control. Height of control. Set the bounds, keeping the base values.

SetBoundsKeepBase is a procedure used to set the bounds for a Control to the specified values without affecting the bounds in a Parent control.

SetBoundsKeepBase calls the ChangeBounds method to update the sized and position for the control to the specified values. If you use this in a custom control, disable LCL auto-sizing for this control prior to calling the method.

SetBoundsKeepBase is used in the implementation for several methods, including:

  • WMSize
  • WMMove
  • WMWindowPosChanged
  • DoAutoSize
  • DoAutoAdjustLayout
  • DoUndock
  • Loaded
New Left coordinate for the control. New Right coordinate for the control. New Width for the control. New Height for the control. Returns default/preferred height and width, for use in auto-sizing.

Called during AutoSize calculations. Only positive values are valid. Negative or 0 are treated as undefined and the LCL uses other sizes instead.

WithThemeSpace: If True, adds space for stacking.

For example: TRadioButton has a minimum size. But for stacking multiple TRadioButtons there should be some space around. This space is theme dependent, so the parameter is passed to the widgetset

TWinControl overrides this and asks the interface for theme dependent values. See for more information.

Default width for a new instance of the control. Default height for a new instance of the control. When False, the values will be adjusted by the constraints, and undefined values will be replaced by GetDefaultWidth/GetDefaultHeight. If True, adds space for stacking. Gets the scaling factor for the canvas used to render the control.

GetCanvasScaleFactor is a Double function used to get the scaling factor for the Canvas in the control.

GetCanvasScaleFactor calls the corresponding method in the widgetset class to get the return value. For TControl and TWSControl, the return value is always 1.0. It may be overridden in descendent classes to use a value appropriate to the implementation.

GetCanvasScaleFactor is used in descendent classes when selecting a scalable image resolution for images and glyphs associated with a control.

Scaling factor applied to images drawn on the control Canvas. The default width for the control independent of any calculated values like Width and GetPreferredSize. Default width for the control when preferred size is not defined and it is anchored or auto-sized. The default height for the control independent of any calculated values like Height and GetPreferredSize. Default width for the control when preferred size is not defined and it is anchored or auto-sized. Gets the default color for the control.

GetDefaultColor is a TColor function used to resolve the default color (clDefault) to a TColor value for the control. GetDefaultColor can return a color value for either the control background or its text. The DefaultColorType argument identifies which value is needed in the return value. In TControl, the following color types and values are used:

dctBrush
Background or fill color for the control (Color). Returns the clWindow system color.
dctFont
Text color for the control (Font.Color). Returns the clWindowText system color.

GetDefaultColor uses the value provided by the corresponding method in the widgetset class instance when a value other than clDefault is returned. When not resolved in the widgetset class, the return value is retrieved using the Parent color or the local values in the class instance. If ParentColor is True (and Parent is assigned), the GetDefaultColor method in the Parent control is called to get the specified color type. Otherwise, one of the values from the preceding list is used for the color type.

GetDefaultColor is a virtual method and can be overridden in descendent classes to use the colors needed for a specific control.

GetDefaultColor is used in the implementation of the GetColorResolvingParent and GetRGBColorResolvingParent methods. It is also called from the SetColor and CreateBrush methods in the TWinControl descendant.

TColor TDefaultColorType
TColor value for the specified color type. Identifies the color type needed in the return value (brush or font). Returns the color of the control while resolving clDefault and ParentColor.

GetColorResolvingParent is a convenience routine used to obtain the Color for the control while resolving clDefault. It will never return clDefault, but it might return a non-RGB color. To obtain a purely RGB result use GetRGBColorResolvingParent.

Returns a RGB value for the color used on the control.

GetRGBColorResolvingParent is a convenience routine used to get an RGB color value for the background on the control. It calls GetColorResolvingParent to translate the clDefault color value to the Brush color in a Parent control. It calls ColorToRGB to convert a color constant to its numeric equivalent and to remove any alpha channel information in the color value.

ColorToRGB
Gets the client coordinate for the specified side.

The return value contains the coordinate for the anchor side indicated in the Side argument. For example:

akLeft
Returns the value in the Left property.
akTop
Returns the value in the Top property.
akRight
Returns the value in the Right property.
akBottom
Returns the value in the Bottom property.
Value for the specified anchor side. TAnchorSide value which coordinate value is returned. Message handler for preferred size changed.

Called by the LCL interface, when something changed that effects the interface values for GetPreferredSize.

Marks the preferred size as invalid for this control and all parents (implies that we will look for another). Returns the sides which are anchored to the Parent. Disables automatic sizing; implies that the default size is accepted, or sizing is done manually. Enables automatic sizing for the control.

EnableAutoSizing is used along with DisableAutoSizing to suspend and restore auto-sizing when the Parent, alignment, layout, visibility, or state for the control is updated. An exception is raised if EnableAutoSizing is called when DisableAutoSizing has not been called.

EnableAutoSizing decrements the internal counter used to track auto-sizing locks. When the counter reaches 0 (zero), the EnableAutoSizing method in the Parent control is called (when assigned). Otherwise, the DoAllAutoSize method is called to trigger the OnResize event handlers for the control.

It is not generally used in application code, but is needed by component developers.

Updates the base bounds for the control; essential if there has been a lot of resizing. True if the BoundsRect is retrieved and used as the value in BaseBounds. False if the existing value in BaseBounds is used. True if the ClientWidth and ClientHeight in the Parent control is retrieved and used. False if the existing value in BaseParentClientSize is used. True if the client size retrieved during LCL component streaming is used in the BaseParentClientSize. False if the calculated value is used. The rectangle with the designed bounds for the control.

The current Bounds can change, due to scaling, anchoring or auto-sizing.

Reflects the Bounds for the Control read during LCL component streaming.

ReadBounds is a read-only TRect property used when the values for the Top, Left, Height and Width properties are set during LCL component streaming. When ComponentState contains csLoading, changes to these properties cause the new values to be applied to ReadBounds prior to calling the SetBounds method. The internal ControlFlags are also updated to indicate that the property value has been loaded using LCL component streaming.

The client size for the Parent, for which the BaseBounds are valid.

BaseBounds and BaseParentClientSize determine the distance to keep from Parent's sides, when a side is anchored to the Parent (akLeft...), and the Parent is resized.

Used for debugging.

Formats and outputs bounds, alignment, and anchor information for the debugger.

Prefix value inserted at the start of the first line in the debug report. Applies an automatic adjustment layout policy to the control.

AutoAdjustLayout can be used to alter PPI settings, scale the control, or apply changes to height or width without scaling.

AMode indicates the layout policy applied in the method, and the actions performed to achieve the task.

Scaling factors are calculated (when needed) for both horizontal (X-axis) and vertical (Y-axis ) adjustments. The factors may represent changes to the PPI settings, or changes in the width for the control.

AutoAdjustLayout temporarily disables auto-sizing, and calls DoAutoAdjustLayout to apply the scaling factors or size changes.

Layout policy applied in the method. Controls the actions performed to scale and / or position the control. Design-time Pixels per Inch setting. Used to derive scaling factors applied in the method. Run-time Pixels per Inch setting for the current monitor. Used to derive scaling factors applied in the method. Form width prior to applying the auto-adjustment policy. Used to calculate an x-axis scaling factor applied in the method. Form width after the auto-adjustment policy is applied. Used to calculate an x-axis scaling factor applied in the method. Indicates whether the height and/or width for a control can be automatically adjusted.

In TControl, both AWidth and AHeight are set to True when the AutoSize property has not been enabled.

True if the width can be auto-adjusted. True if the height can be auto-adjusted. Corrects the font size for High-DPI-aware applications.

FixDesignFontsPPI is a method used to adjust the font size when the design-time PPI (Pixels per Inch) setting differs from the run-time PPI setting for the font in the control. It calls DoFixDesignFontPPI to restore the value in ADesignTimePPI to the Font reference passed as an argument to to the method. The font height is scaled using the factor represented by TFont.PixelsPerInch/ADesignTimePPI.

This method does not trigger a CM_PARENTFONTCHANGED message in the Parent control.

In TControl, this action is performed for the Font property. In descendent class, additional properties with a font reference may also be adjusted using the method.

FixDesignFontsPPI is called when scaling is enabled, and the Form which hosts the control calls its Loaded method when LCL streaming is completed.

Design-time PPI setting applied for the font size adjustment. Resizes a font to the specified Pixels per Inch setting.

ScaleFontsPPI is a method used to resize a font in the control to the specified display density (Pixels per Inch) using the scaling factor in AProportion (when needed).

A font may need to be scaled when the run-time PPI setting for the screen differs from the design-time value applied to the font. If the font height is not assigned at run-time, its height is set to the value in TFont.PixelsPerInch / Screen.PixelsPerInch.

When AToPPI has a positive non-zero value, it is stored in the TFont.PixelsPerInch property for the font. Otherwise, the existing TFont.PixelsPerInch value is adjusted using the scaling factor in AProportion.

ScaleFontsPPI may be overridden in descendent controls to call the method for its child controls.

ScaleFontsPPI is called form the AutoAdjustLayout method.

PPI setting to apply to the font. Scaling factor applied to the font height. Constructor for the class instance.

Create is the overridden constructor for the class instance. Create calls the inherited constructor using TheOwner as the owner for the class instance. Resources are allocated in the method for members in the class instance, and the default values are set for the following properties:

  • Align
  • Anchors
  • BaseBounds
  • CaptureMouseButtons
  • Color
  • ControlStyle
  • Cursor
  • DesktopFont
  • DragCursor
  • Enabled
  • FloatingDockSiteClass
  • Font
  • HelpType
  • IsControl
  • ParentBidiMode
  • ParentColor
  • ParentFont
  • ParentShowHint
  • Visible
  • WindowProc
Create ensures that auto-sizing is disabled until the class instance is fully realized. Auto-sizing is re-enabled on exit from the method.
The owning component. Removes the control from its Parent.

Detaches the control from Parent, removes graphics, frees memory and Operating System handles, pointers etc.

TLCLComponent.Destroy TComponent.Destroy
Performs notifications before the control is destroyed.

BeforeDestruction is a method which performs notifications when an object instance is about to be freed. It allows tasks to be performed which maintain a persistent object instance and its observers before it is destroyed.

BeforeDestruction is an overridden method in TControl, and calls the inherited method on entry to ensure that csDestroying is included in the ComponentState property for the control and any of its child components. It extends the inherited method by calling DoCallNotifyHandler for any handler routines using the chtOnBeforeDestruction type.

TComponent.BeforeDestruction TComponent.Destroying
Signals the OnEditingDone event handler.

Called when user has finished editing using the control. This procedure can be used by data links to commit the changes.

For example:

  • When focus switches to another control (default).
  • When user selected another item.

Each control class can determine which events cause the value(s) to be committed.

Called when the Return key is pressed, signifying the default action.

ExecuteDefaultAction has an empty implementation in TControl. It can be overridden in descendent classes to perform any actions needed for the class type.

Called when the Escape key is pressed or the Cancel button is clicked.

ExecuteCancelAction has an empty implementation in TControl. It can be overridden in descendent classes to perform any actions needed for the class type.

Starts a drag operation for the control (programmatically). If False, start dragging only after the mouse has moved. Minimum mouse movement before delayed dragging starts (in pixels); -1 causes the DragManager default to be used. Ignored when Immediate is set to True. Ends a drag operation by notifying the drag manager. True when a drag and drop operation is being completed. False if a drag and dock operation is ending. Brings the control in front of other sibling controls.

BringToFront is a method used to move the control to the top of the Z-Order for its sibling controls. BringToFront calls SetZOrder to change the display order for controls which share a common Parent. BringToFront has no effect when Parent has not been assigned.

Returns True if there is a Parent component responsible for streaming.

HasParent is called during streaming to decide if a component has to be streamed by its owner or Parent.

TComponent.HasParent
True if there is a Parent. Returns the value in the Parent property.

GetParentComponent gets the component / control which has the current class instance in its Components property. GetParentComponent is an overridden method in TControl, and re-implements the inherited method. It uses the value in the Parent property as the return value for the method. The inherited method always returns Nil.

TComponent.Components
Value in the Parent property. Determines whether this control is a parent of AControl.

IsParentOf is a Boolean function used to determine if the current control instance is ultimately a parent of the control specified in AControl. No actions are performed in the method when AControl has not been assigned (Nil), and the return value is set to False.

IsParentOf visits each control in the Parent control hierarchy, and returns True if the current class instance (Self) is found in the tree. The return value is False if the current control instance is not found in the Parent control tree.

True if this control is a parent of AControl. The initial control examined in the parent control hierarchy. Finds the control that is the top-most Parent in the control hierarchy.

GetTopParent is a TControl function used to get the control which is the top-most or initial Parent in the control hierarchy.

GetTopParent visits each of the control instances in the Parent property. The return value is set to control where Parent is unassigned (Nil). The return value is the current control instance (Self) if Parent has not been assigned.

GetTopParent is used in methods like ChangeBounds where the parent handles layout or sizing for its child controls. The method is also used in descendent classes, like TWinControl, when messages are handled which resized, move, or otherwise reposition the windowed control.

TControl instance which is the top-most Parent in the control hierarchy, or Self. Finds the sub-component with the specified name in the Components property.

FindSubComponent is a TComponent function used to get the sub-component with the name specified in AName. FindSubComponent is similar to TComponent.FindComponent, but accepts a prefixed component name in AName. For example: 'LabeledEdit1.EditLabel'.

FindSubComponent separates the value in AName into the owner and sub-component names. When a prefix is used, the FindComponent method is called to locate the TComponent instance with the owner name. Its FindComponent method is called to get the component with the sub-component name that is used in the return value. If a prefix is not used, the initial component is used as the return value.

The return value is Nil if a component is not found with the specified name.

TComponent.FindComponent TComponent.Components
The component with the specified name, or Nil when not found. Parentage/path for the sub-component to retrieve in the method. Gets the effective visibility for the control and all of its Parent controls.

IsVisible calls IsControlVisible to determine if the control has its Visible property set to True. At design-time, ControlStyle is also checked to ensure that csNoDesignVisible is not used in the style flags. Each of the Parent controls in the hierarchy call their IsVisible method to determine the return value for the method.

Use IsEnabled to get the effective enabled state for the control and all of its Parent controls.

True when the control and and all Parent controls are Visible. True if the control is Visible, or is in design mode.

The return value is True when the Visible property is set to True. The value is False at design-time if the ControlStyle property includes the value csNoDesignVisible. IsControlVisible does not check the visibility for parent controls in the control hierarchy.

Use IsVisible to consider the visibility for any Parent controls.

True if the Visible property is set and the control is not disabled on the design surface at design-time. Returns True if both the control and all of its Parent controls are Enabled.

Returns True when both the control instance and its parent control hierarchy are enabled. Used internally by TGraphicControls for painting and various states during run-time.

True when the control and all Parent controls are enabled. Provides access to the value in the protected ParentColor property.

Returns the value for the protected ParentColor property. Used in places where we need to check ParentColor property from within the TControl. Needed for widgetset classes.

True when ParentColor is set to True. Provides access to the value in the protected ParentFont property.

Checks the value for the protected ParentFont property. Used in places where we need to check ParentFont from within TControl. Needed for widgetset classes.

True when ParentFont is set to True. True if the form is being updated.

The return value is True when a value has been assigned to Parent, and its FormIsUpdating method returns True. This causes all assigned Parent controls in the hierarchy to be examined to determine the return value.

Eventually, one of the Parent controls will be the TCustomForm instance which hosts all of the controls. It sets the return value to True when its internal update counter has a non-zero value. This occurs when the form has called BeginFormUpdate, but has not called EndFormUpdate to complete an update.

TCustomForm.FormIsUpdating TCustomForm.BeginFormUpdate TCustomForm.EndFormUpdate
True if the form is being updated. True while painting the control.

As the name implies, the cfProcessingWMPaint flag in FControlFlags is set while a LM_PAINT message is processed, and IsProcessingPaintMsg checks this flag.

True when the control flags contain a value for paint methods. Hides the control by setting the Visible property to False. Causes the control to be redrawn.

Calls the Repaint method to either draw the clipping rectangle for the control to the handle in the Parent, or invalidate the control area for the next paint operation that occurs when the Parent controls are Visible.

Immediately redraws the control when visible, bypassing the message queue.

Repaint is a method called redraw the control when it is visible. No actions are performed in the method when:

  • Parent has not been assigned.
  • Parent does not have a valid handle.
  • ComponentState contains the value csDestroying.
  • The effective visibility from IsVisible is False.

When the control is Parented, it is redrawn using the style indicated in ControlStyle. When csOpaque is included, a device context is retrieved and the PaintControl method is called for the clipping rectangle in the Parent control. When csOpaque is omitted, the Invalidate and Update methods are called to request the control to redrawn.

TComponent.ComponentState
Causes a delayed Repaint of the control by marking its visible area of the control as invalid.

Calls the InvalidateControl method to invalidate the bounds rectangle for the control using the clipping rectangle for the Parent. The control is redrawn when there are no pending messages in the message queue.

Returns True if the class is allowed for child controls.

Only few controls restrict the class of acceptable child controls. E.g. a PageControl only accepts TTabSheet descendants as children.

An EInvalidOperation can be generated (see ExceptionOnInvalid).
True if the class is allowed for child controls. The class of the intended child control. When True, raise an exception when the class is not allowed. Checks if this control can become a child of AParent.

This check is performed during SetParent. It calls CheckChildClassAllowed and whether AParent is the current class instance (Self).

An EInvalidOperation occurs when any test fails.
The new Parent for this control. Moves all sibling controls in front of this control.

Use SendToBack to move the control beneath all other sibling controls on the Parent. Only those portions of the control not covered by other controls will be visible.

Calls SetZOrder to move the position for the control on the z-axis (depth) to the maximum Integer value for the platform.

Use BringToFront to move a control to the top of the Z-axis on the Parent control.

Use SetChildZPosition in TWinControl to move a child control to a specific position on the Z-axis where 0 is the top and MaxInt is the bottom of the Z-order.

Changes the cursor shape temporarily, preserving the original

SetTempCursor is a method used to temporarily change the cursor shape to the TCursor value specified in Value. SetTempCursor calls the overridden method in the Parent control to apply the cursor shape in Value.

No actions are performed in the method when Parent has not been assigned.

The temporary cursor shape for the control. Internal method called by a Form when its DefaultControl or CancelControl has changed.

This method is overridden in TCustomButton, where it updates the Cancel and Default properties for the control.

Notification of a changed active DefaultControl of a form.

When the user pressed ENTER in a form, its DefaultControl will receive a Click event.

Currently NewControl can be Nil, even if it should not be.
The new DefaultControl. Copy the Text property into Buffer.

This method only exists for Delphi compatibility.

Don't use or override it, unless really necessary.

Length of the copied text. Pointer to the buffer receiving the string. Length of the buffer. The length of the Text for the control.

In TControl, the value indicates the size for the Caption property. Descendent classes may use a different a different property as the basis for the return value.

Length of the text for the control. Updates the Text property from a PChar buffer.

This method only exists for Delphi compatibility.

Don't use or override it, unless really necessary.

Pointer to the buffer containing the zero-terminated text. Calls a message handler directly, bypassing the message queue.

Perform is a method used to pass a message to the processing loop for the control.

Values in the Msg, WParam, and LParam arguments are stored in a TLMessage instance and passed as an argument to the routine in the WindowProc property. The return value is the LRESULT returned from the WindowProc routine.

TLMessage LRESULT
Result value from the WindowProc routine. Control message constant for the message executed in the method. Parameter with a handle or Integer value (not necessarily 16-bits any more). Parameter with a Pointer to its value (not necessarily 32-bits any more). Converts absolute screen coordinates into client-relative coordinates.

The APoint argument contains the screen coordinates which are converted to client-relative coordinates in the method. The X member has the horizontal coordinate, and the Y member has the vertical coordinate.

The return value is a TPoint type which contains the coordinates from APoint with the X and Y members decremented by the corresponding values found in the ClientOrigin for the control.

Accessing the ClientOrigin property raises an EInvalidOperation exception if Parent has not been assigned for the control.

ScreenToClient is used in the implementation of methods like ClientToParent, ParentToClient, and GetMousePosFromMessage. It is also used to convert mouse coordinates during drag and drop, docking, and context menu operations.

Use ScreenToControl to convert absolute screen coordinate to control-relative values.

Use ClientToScreen to convert client-relative coordinates to absolute screen coordinates. Use ControlToScreen to convert the coordinates in the control to absolute screen coordinates.

TPoint
TPoint instance with the client-relative coordinates for the specified screen coordinates. TPoint instance with the screen coordinates converted in the method. Converts client-relative coordinates to absolute screen coordinates. TPoint instance with the screen coordinates for the specified client coordinates. TPoint instance with the client-relative coordinates converted in the method. Converts absolute screen coordinates to control-relative coordinates. TPoint instance with the client coordinates relative to its Parent control. Screen coordinates converted to client coordinates in the method. Converts control-relative coordinates to absolute screen coordinates.

Screen coordinates in the return value are determined by adding the values in APoint and the ClientOrigin for the control.

TPoint instance with the Screen coordinates for the specified control coordinates. TPoint instance with the control-relative coordinates converted in the method. Converts the specified client coordinates to the screen coordinates for the specified parent control.

ClientToParent is a TPoint function used to convert the client-relative coordinates specified in Point to the screen coordinates for the parent control in AParent. If AParent is unassigned (Nil), the Parent property for the control is used in the method.

ClientToParent calls the IsParentOf method in AParent to determine if the control is a child control for AParent. An EInvalidOperation exception is raised if the return value from IsParentOf is False.

ClientToParent calls ClientToScreen to get the absolute screen coordinates for the values in Point. The return value is the TPoint instance returned by converting the client coordinates to screen coordinates, and asking the parent control to convert the values back to client-relative coordinates for the parent control.

ClientToParent is used, for instance, in the TScrollingWinControl.ScrollInView method.

TPoint instance with the client coordinates adjusted to the parent control. TPoint instance with the client coordinates for the control. Parent control with the bounds for the adjusted coordinates. Converts the specified client coordinates on a parent control to the client coordinates for the control instance.

Point contains the client coordinates relative the parent control AParent. If AParent is not assigned (Nil), the value in the Parent property is used as the value for the argument.

ParentToClient calls the IsParentOf method in AParent to determine if the current control is hosted on AParent. An EInvalidOperation exception is raised if the IsParentOf method returns False.

The return value is a TPoint instance with client coordinates for the control relative to the client coordinates on AParent.

TPoint instance with the client coordinates relative the client origin in a parent control. TPoint instance with the coordinates examined and adjusted in the method. Parent control with the origin used to adjust the client coordinates. Get the visible part of a possibly scrolled client area.

If Scrolled is False, the ScrollOffset is ignored, so that the ClientRect is returned. Returns the Client rectangle relative to the left and top for the control. If Scrolled is True, the rectangle is moved by the current scrolling values (for an example see TScrollingWincontrol).

The visible part of the client area. True forces scrolling taken into account. Makes the control visible by setting Visible to True.

Show calls the ShowControl method in the Parent control (when assigned) to ensure that the control instance is visible on the Parent control. Show sets the value in the Visible property to True. The value in the Visible property is not changed at design-time or when csNoDesignVisible has not been included in the ControlStyle property.

Use the Hide method to hide the control on its Parent.

Use ShowControl to display a specific sibling control on the Parent.

Redraws invalidated parts of the control immediately.

Update calls the Update method in the Parent control to refresh the window where the control is hosted. No actions are performed in the method when Parent has not been assigned.

True if the control should be visible, unless it's being destroyed.

HandleObjectShouldBeVisible is a Boolean function which indicates if the control requires a valid handle in its widgetset class instance and should be visible. The return value is set to True when the following conditions are satisfied:

  • Neither the control nor its Handle is being destroyed.
  • IsControlVisible returns True indicating the control is both Visible and not disabled on the form designer at design-time.
  • Parent has been assigned and its HandleObjectShouldBeVisible method returns True.

HandleObjectShouldBeVisible is used frequently in widgetset class methods, and indicates that actions like allocating or freeing a handle should be performed. It determined the value for the Visible property in the widget. It also indicates whether the actions in the class method can be performed, or should be ignored.

TComponent.ComponentState
True if the control is visible and needs a handle object. Returns True if any parent control is destroying its Handle (or handles for its children). Returns True if any parent control is destroying its Handle (or handles for its children). Returns True if all Parents have allocated handles, and are not being destroyed. Returns True if all Parents have allocated handles, and are not being destroyed. Updates the action associated with the control using its action link.

Calls the Update method in ActionLink to signal the OnUpdate event handler for the linked TBasicAction instance. No actions are performed in the method when ActionLink has not been assigned.

TBasicActionLink.Update TBasicActionLink.OnUpdate
Displays the help associated with the control.

ShowHelp is a method used to display help for the control. Values in HelpType, HelpContext, and HelpKeyword are used to determine which method is called in the Application singleton to display the help content.

HelpType
When set to htContext, the HelpContext method is called for the value in the HelpContext property.
HelpKeyword
A non-empty value causes the HelpKeyword method to be called using the value in the HelpKeyword property.
Default Action
Calls the ShowHelp method in the Parent control when none of the other conditions are satisfied.

ShowHelp is called from methods in the the TApplication instance. It occurs when the F1 key is pressed when the control has focus, or when its ShowHelpForObject method is called for a specific control instance.

Use the HelpFile property, found on the parent form or in a TApplicationProperties instance, to set the help file with the content displayed in the method.

TApplication.HelpContext TApplication.HelpKeyword TApplication.ShowHelpForObject TApplicationProperties.HelpFile TCustomForm.HelpFile
Indicates whether a HelpKeyword or HelpContext identifier is assigned for the control. True when a HelpKeyword or HelpContext has been assigned. Removes all control handler types for the specified object.

RemoveAllHandlersOfObject is an overridden method in TControl used to remove all handler routines for the specified object instance found in the internal storage for the control handler types.

AnObject is the control associated with handler routines located and removed in the method. It allows handler routines added at run-time to be removed prior to destroying the object instance in AnObject.

RemoveAllHandlersOfObject visits each of the TMethodList instances used for each of the TControlHandlerType values. It calls the RemoveAllMethodsOfObject method in the TMethodList instance to remove associations where AnObject is the target.

The method can be overridden in descendent classes to provide additional functionality needed for derived controls.

TMethodList TLCLComponent.RemoveAllHandlersOfObject
Object (TControl) associated with the handler routine removed in the method. Adds or inserts the specified OnResize event handler. Handler routine added or inserted in the method. True if the routine is inserted as the first handler in the list. False to append the handler to the end of the list. Removes the specified OnResize event handler. Handler routine to locate and remove in the method. Adds or inserts the specified OnChangeBounds event handler. Handler routine added or inserted in the method. True if the routine is inserted as the first handler in the list. False to append the handler to the end of the list. Removes the specified OnChangeBounds event handler. Handler routine to locate and remove from the list of handlers. Adds or inserts the specified OnVisibleChanging event handler. TNotifyEvent handler routine added in the method. True if the routine is inserted as the first handler in the list of handlers for the chtOnVisibleChanging type. False if the routine is appended to the list. Removes the specified OnVisibleChanging event handler. TNotifyEvent handler routine removed from the chtOnVisibleChanging handler type. Adds or inserts the specified OnVisibleChanged event handler. TNotifyEvent handler routine added in the method. True if the routine is inserted as the first handler in the list of handlers for the chtOnVisibleChanged type. False if the routine is appended to the list. Removes the specified OnVisibleChanged event handler. TNotifyEvent handler routine removed from the chtOnVisibleChanged handler type. Adds the specified OnEnabledChanging handler. TNotifyEvent handler routine added in the method. True if the routine is inserted as the first handler in the list of handlers for the chtOnVisibleChanging type. False if the routine is appended to the list. Removes the specified OnEnabledChanging event handler. TNotifyEvent handler routine removed from the chtOnEnabledChanging handler type. Adds an OnEnabledChanged handler. TNotifyEvent handler routine added in the method. True if the routine is inserted as the first handler in the list of handlers for the chtOnEnabledChanged type. False if the routine is appended to the list. Removes the specified OnEnabledChanged event handler. TNotifyEvent handler routine removed from the chtOnEnabledChanged handler type. Adds the specified OnKeyDown event handler. TKeyEvent handler routine added to the chtOnKeyDown handler type. True if the routine is inserted as the first handler in the list of handlers for the chtOnKeyDown type. False if the routine is appended to the list. Removes the specified OnKeyDown event handler. TKeyEvent handler routine removed from the list of handlers for the chtOnKeyDown handler type. Adds or inserts the specified OnBeforeDestruction event handler. TNotifyEvent handler routine added to the list of handlers for the chtOnBeforeDestruction handler type. True if the routine is inserted as the first handler in the list of handlers. False if the routine is appended to the list. Removes the specified OnBeforeDestruction event handler. TNotifyEvent handler routine removed from the list for the chtOnBeforeDestruction handler type. Adds or inserts the specified OnMouseWheel event handler. TMouseWheelEvent handler routine added to the list for the chtOnMouseWheel handler type. True if the routine is inserted as the first handler in the list of handlers. False if the routine is appended to the list. Removes the specified OnMouseWheel event handler. TMouseWheelEvent handler routine removed from the list for the chtOnMouseWheel handler type. Contains the accessible name for the control, like the value for its Caption or Name property. Provides the accessibility description for the control, like "a text caption", etc. The accessible description of the control. This should describe the role of the control, for example for TLabel it could be "a text caption". The accessibility value for the control.

The accessible value of the control. For example, for TLabel it would be the same as the Caption property.

The accessibility role for the control which classifies what kind of object in the class instance.

See TLazAccessibilityRole for a list of possible values.

The Action associated with the control.

Action is a TBasicAction property with the action assigned to the control. The value for the property is read from the Action property in ActionLink (when assigned). If ActionLink has not been assigned, the property value is Nil.

Assigning an action to the property causes ActionLink to be updated. If the new property value is Nil, the TControlActionLink instance in ActionLink is freed and control style flags are updated to remove the value csActionClient.

Conversely, a TControlActionLink instance is created for a non-empty action assignment. Its OnChange event handler is set to the private DoActionChange method in the class instance. Control style flags are updated to include the value csActionClient.

Action is used in the Click method to signal its OnExecute event handler when assigned and enabled. Preference is given to the OnClick in the control (when assigned).

Values in the Caption, Enabled, HelpType, and Hint properties can be linked to the Action through the property values in the ActionLink.

Use AssignTo to copy property values in the control to a TCustomAction instance.

TBasicAction
Specifies the placement of the control on its Parent control.

Align is a TAlign property which specifies how the control is aligned to its parent control. The default value for the property is alNone.

alNone
The control is not aligned. It uses it Top, Left, Height, and Width to place the control in the Parent.
alTop
Aligns the control to the top of the parent control, and adjusts it Width to fill the Parent control.
alBottom
Aligns the control to the bottom of the Parent control, and adjusts its Width to fill the Parent control.
alLeft
Aligns the control to the left edge of the Parent control, and adjusts its Height to fill the Parent control.
alRight
Aligns the control to the right edge of the Parent control, and adjusts its Height to fill the Parent control.
alClient
Aligns the control to fill the unused Height and Width for the Parent control.
alCustom
Aligns the control by calling the OnAlignInsertBefore or OnAlignPosition event handlers in the Parent control.
The set of anchor definitions for this control.

Anchors is a TAnchors property which contains the edges used to align the position of the control relative to its Parent. Anchors allow the control to be repositioned and/or resized when the parent control is resized. Coordinate values in the control - like Left, Top, Bottom, and Right properties - are updated when the corresponding edge is anchored to its Parent.

The default value for the property is [akLeft, akTop], and indicates that only the Top and Left coordinates are anchored in the parent control.

For example:

[akLeft, akRight]
Causes the relative width for the control to be adjusted when the width of the parent control is changed.
[akTop, akBottom]
Causes the relative height for the control to be adjusted when the height of the parent control is changed.
[akTop, akLeft, akRight]
Causes the relative width (but not the height) for the control to be adjusted when the parent is resized. Like using the Align property.
[akTop, akLeft, akBottom, akRight]
Causes both the height and width to be adjusted when the parent control is resized. Like using alCustom in Align.

Setting a new value for the property causes the UpdateAnchorRules and AdjustSize methods to be called.

Values in Anchors are used (along with Align) in the DoAutoAdjustLayout method. They control whether values in Left, Top, Bottom, and Right are calculated using the ClientWidth and ClientHeight for the Parent control. The values in Anchors also used in the HeightIsAnchored and WidthIsAnchored methods.

Values in Anchors may be updated when a new value is assigned to the Align property which conflicts with the existing values in the property. They may also be updated when values are assigned to AnchorSide which cause vertical or horizontal centering to a sibling control (AnchorVerticalCenterTo, AnchorHorizontalCenterTo) or alignment to a companion control (AnchorToCompanion).

Array of anchor definitions, indexed by the control sides.

Valid anchor definitions are flagged in Anchors.

AnchorSide specifies how a side is anchored to other controls (siblings or Parent).

Various AnchorAs and AnchorTo methods simplify the establishment of anchors.

The anchored side of the control. Allows automatic adjustment of the size for the control, according to its content.

The action performed depends on the concrete control type. For example, a label or button can become bigger or smaller to accommodate a longer or shorter caption.

Default value for the property is False, and disables auto-sizing for the control instance.

Using AutoSize
Determines the inner and outer border spacing for this control.

The outer border determines the minimum distance to sibling controls. The inner border is the space between the BoundsRect and ClientRect for the control.

When a control sits in a cell of a table (Grid) control, its horizontal and vertical alignment inside the cell can be specified, too.

The Top, Left and Bottom, Right for the control, in client coordinates.

The BoundsRect rectangle describes the Top, Left and Bottom, Right coordinates for the control, relative to its parent.

The values are based on the Top, Left, Width and Height properties of the control.

Set BoundsRect to move and/or resize the control. This can reduce flicker, occurring otherwise when Top, Width etc. are set individually.

Temporary BoundsRect, used when the control e.g. is docked into a different Parent.

The rectangle describes the placement of the control when its Parent is changed later.

Setting the rectangle also sets a flag, that indicates the values are available.

The text displayed for the control.

Caption is a TCaption property with the text displayed for the control. By default, Caption has the same value as the Name property used for the control. An explicit value can be assigned at design-time using the Object Inspector, or by the developer in program code.

Controls normally use the Caption or Text properties (they are equivalent in TControl) to read or write their textual value. The property value is retrieved using either the RealGetText method, or the GetTextBuf method when it has been overridden in a descendent class. Conversely, the property value is stored using either RealSetText, or an overridden SetTextBuf method in a descendent class.

When the value in Caption is changed, a CM_TEXTCHANGED message is performed for the control. Changing the value for the property causes the caption for the HostDockSite to be updated (when assigned).

Caption can be used to display an accelerator (or shortcut) key which allows the control (or an associate) to be given focus or executed. The shortcut key is identified by placing an Ampersand (&) character in front of the character used as the accelerator key. Use two Ampersand characters to display a single Ampersand which is not a shortcut key. For example:

{ var ALabel: TLabel; Form1: TForm; Memo1: TMemo; ... } ALabel := TLabel.Create(Form1); ALabel.ShowAccelerator := True; ALabel.FocusControl := Memo1; ALabel.Caption := '&Notes && Comments';

Displays the 'N' character with an underline indicating the accelerator key. Pressing Alt+N activates the shortcut key and causes the associated TMemo control to be given focus.

Set values in Font to specify the typeface, size, color, and style used to display the Caption text.

Indicates the mouse button(s) which are captured for the control.

CaptureMouseButtons is a TCaptureMouseButtons property with the set of mouse buttons which capture events for the control. It contains zero or more values from the TMouseButton enumeration. Up, down, click, double click, triple click, and quad click messages are handled for a mouse button when its value is included in the property.

The default value for the property is [mbLeft] and causes events to be handled for the Left mouse button.

Mouse capture is enabled for the button(s) when csCaptureMouse is included in the ControlStyle property.

ControlStyle and CaptureMouseButtons are used in message handlers which respond to mouse events, like: WMLButtonDDown, WMLButtonUp, WMLButtonDblClk, WMLButtonTripleClk, WMLButtonQuadClk, et. al.

The height for the client area on the control.

ClientHeight is an Integer property with the number of pixels needed for client area on the control. The property contains the value from the Bottom member in ClientRect. Changing the value for ClientHeight causes SetClientSize to be called to apply the existing ClientWidth and the new value for the property.

The value for ClientHeight is not stored or used to set the Height for the control during LCL component streaming. It is used, however, when AutoSizing is restored and when auto-layout policies using Anchors are applied to the control. For example, when Anchors is set to [akBottom] the value in ClientHeight is needed / used.

Screen coordinates of the Top, Left pixel (in the client area) of the control.

Only TWinControl has a client area. For other controls, ClientOrigin is the same as ControlOrigin. Uses the corresponding property in the Parent control to get the property value, and includes the values in Left and Top to get the effective origin for the control.

An EInvalidOperation exception is raised if Parent has not been assigned when reading the value for the property.

Note that this value is the position as stored in the object, not always in sync with the widget.

Raises an EInvalidOperation exception with the message in sParentRequired if Parent has not been assigned when reading the value for the property.
Size of the client area for the control.

Contains the size for the visual client area in the control. For example, the inner size of a TGroupBox. For a TScrollBox it is the visual size, and not the logical size.

The property value is a TRect instance with the Top and Left members set to 0, and the Height and Width members set to the corresponding property values for the control.

TRect
The width of the client area for the control.

ClientWidth is an Integer property with the number of pixels need for the width of the client area on the control. The property contains the value from the Right member in ClientRect. Changing the value for ClientWidth causes SetClientSize to be called to apply the new property value and the existing ClientHeight for the control.

The value for ClientWidth is not stored or used to set the Width for the control during LCL component streaming. It is used, however, when AutoSizing is restored and when auto-layout policies using Anchors are applied to the control. For example, when Anchors is set to [akRight] the value in ClientWidth is needed / used.

The background color for the control.

The default value in Color is the same as the value in the parent window Color. If the color is clDefault, the result will need to be passed through GetDefaultColor to resolve clDefault. Convenience routines which obtain the color by resolving clDefault and ParentColor are also provided as TControl.GetColorResolvingParent and TControl.GetRGBColorResolvingParent.

For the macOS Carbon widgetset, setting Color to clBtnFace causes the background for the control to become transparent.
TColor
Contains the minimum and maximum Width and Height for the control.

Constraints is a TSizeConstraints property with the sizing constraints used for the control. Constraints contains properties like MinHeight, MaxHeight, MinWidth, and MaxWidth. They are applied (when assigned) to the corresponding control properties when its bounds or preferred size is changed, and during scaling operations.

The top, left pixel for the control in screen coordinates.

ControlOrigin is a read-only TPoint property with the screen-relative coordinates where the control is located.

The X and Y members in the property represent the Left and Top coordinates for the control after they are converted to screen coordinates. The values are derived by adding the TPoint values for the Left and Top coordinates to the ClientOrigin property for the Parent control. The return value contains the unmodified values in Left and Top when a Parent control has not been assigned.

ControlOrigin is used to implement the ScreenToControl and ControlToScreen methods.

Contains state flags which indicate whether the control has been clicked, data is being read, or the control is being re-drawn, etc.

ControlState is a TControlState property which contains flags that indicate when actions are detected or handled for the control. It is a set type which contains zero or more values from the TControlStateType enumeration.

Values are added to the property when an event is detected. Values are removed from the property in methods which handle the event by performing some action on the control.

For more information about the values in the enumeration and their uses and meanings, please refer to TControlStateType.

Contains style flags which control the features or behaviors enabled for the control.

ControlStyle is a TControlStyle property used to enable features or behaviors for a control. Values from the TControlStyleType enumeration are added to the property to enable the corresponding feature supported in the control.

Values in ControlStyle are normally assigned in the constructor for a given control class.

Some controls implement properties which cause the values in the set to be changed when a new value is assigned to the property. For example, TToolBar.Transparent includes or excludes csOpaque in ControlStyle as needed to reflect the value for the property. Values in the property may also be read and/or updated when methods in the control are called.

The visibility for the ControlStyle property is public, so it does not appear in the Lazarus Object Inspector. But it can be updated in program code as needed.

See TControlStyleType for more information about values in the enumeration and their intended usage.

Determines whether the control responds to mouse or keyboard input.

Enabled is a Boolean property which indicates whether the control can respond to focus, input, or mouse events. The default value for the property is True. When Enabled is set to False, the control is displayed with a "grayed-out" appearance. It is unable to receive input focus, handle keyboard navigation or input, respond to mouse click events, or execute its Action.

Changing the value for the property causes additional actions to be performed. EnabledChanging is called to signal any chtOnEnabledChanging control handlers assigned for the control. The property value is updated, and a CM_ENABLEDCHANGED control message is dispatched for the control. The EnabledChanged method is called to signal any chtOnEnabledChanged control handlers for the control.

Use IsEnabled to check the effective enabled state for both the control and its Parent control (when assigned).

The font to be used for text display in this control.

Font is a TFont property with the typeface and display attributes used for textual values on the control. Use properties in the TFont instance to change attributes like Name (for the typeface), Charset, Color, Height, Orientation (rotation degrees), Pitch, Quality, Size, and Style. Assigning a new TFont instance to the property causes the control to be redrawn.

Some Font attributes may be ignored in TControl descendants. It depends on the drawing style for the specific control, and whether theme services are enabled for text on the control. For the macOS Carbon widgetset, Font does not support use of the fsStrikeOut attribute in its Style property.

The PixelsPerInch property in Font is used to perform font size scaling in methods like Scale96ToFont, ScaleFontTo96, ScaleScreenToFont, and ScaleFontToScreen.

TFont
Not used in the current LCL implementation.

IsControl is provided for Delphi code compatibility. It is not used in the current LCL implementation.

True when the mouse has entered the control. (Deprecated) Deprecated. Use MouseInClient instead. True when the mouse is in the client area for the control.

MouseInClient is a read-only Boolean property which indicates if the mouse pointer has entered the client area for the control. The value for the property is updated when CM_MOUSEENTER or CM_MOUSELEAVE messages are handled for the control. The property value is set to True in CMMouseEnter, and set to False in CMMouseLeave.

Use the OnMouseEnter or OnMouseLeave event handlers to perform actions needed when the mouse control messages are handled for the control.

Event handler signalled when the Bounds for the control have been changed.

OnChangeBounds is signalled from the DoOnChangeBounds method (when assigned). It occurs after the internal control flags have been updated to exclude cfOnChangeBoundsNeeded, and before DoCallNotifyHandler is called to notify handlers for the chtOnChangeBounds type.

TNotifyEvent
Notification handler for mouse clicks.

A mouse click is associated with the default action for a control, and is often the only event handled in user code.

The action performed for a click can be specified by a user supplied method, or by selecting an Action from a supplied ActionList.

OnClick is signalled (when assigned) from the Click method. It occurs when an Action has not been assigned using the ActionLink for the control. When Action is assigned, the Execute method in the ActionLink is called.

TBasicAction TNotifyEvent
Notification handler for a resize of the control.

This event is triggered after the Width, Height, ClientWidth or ClientHeight of the control has changed, and before the LCL sends the new size to the widgetset. The size of the underlying widget (e.g. unit LCLIntf function GetWindowSize and GetClientRect) may differ from the control's Width/Height/ClientRect during OnResize. During auto-size the size can change multiple times, but only the last change triggers the OnResize.

Use OnResize to react on size changes. To also react on moves, use the OnChangeBounds event.

If you want to customize the resize behavior, use OnConstrainedResize instead.

Common mistake: Keep in mind that ClientWidth and ClientHeight can change even when Width and Height stay the same. For example when the theme changes, the Width and Height remain the same, but the changed frame reduces the ClientWidth and ClientHeight. This does not happen that often under Windows, but it happens quite often on other platforms.

Especially it is not sufficient to write only a TForm.OnResize handler to resize all controls on the form. This is a common bug in Delphi applications.

TNotifyEvent
Event handler signalled when a hint window is displayed for the control.

OnShowHint is a TControlShowHintEvent property with the event handler signalled when a hint window is displayed for the control. Arguments to the event handler include the control instance for the event notification, and a pointer to the structure with the Hint details for the control.

OnShowHint has public visibility in TControl, but may be redeclared in descendent classes to make it visible in the object inspector. An application must implement and assign a handler routine to respond to the event notification.

OnShowHint is signalled from the DoOnShowHint method (when assigned), and occurs when the CM_HINTSHOW control message is handled for the control.

Set ShowHint to True to enable hint window display using the value(s) in the Hint property.

The control within which the control is shown.

When the Parent moves or hides, all its children move or hide together with it.

Every TControl must have a Parent, else it is never shown.

The Parent of a floating form is Nil.

Set the parent last to reduce updates. For example:

Button1 := TButton.Create(Self); Button1.Name := 'Button1'; Button1.Caption := 'Click me'; // parent is not set, so it does not update the whole form Button1.Parent := Form1; // set parent as last, the LCL now applies all properties

Delphi/VCL: Parent must be set first under Delphi, because many properties work differently if they are set before or after Handle creation. The LCL applies the properties when the Handle is created.

A context-sensitive menu that pops up when the right mouse button is clicked over this control. TPopupMenu Enables Hint display for the control.

ShowHint is a Boolean property used to enable or disable display of pop-up Hint text for the control. When set to True, the Hint text is shown when the mouse is hovered over the control. The default value for the property is False and disables Hint text in a pop-up window.

Changing the value in ShowHint causes the ParentShowHint property to be set to False. A CM_SHOWHINTCHANGED is performed to apply the new value for the property.

Use the Hint property to set the text displayed in the pop-up hint window when ShowHint is enabled. Use the OnShowHint event handler to provide custom text uses in the Hint display.

Use the ShowHint property in a TForm instance to enable or disable pop-up hint display for all controls on a given form. Use the ShowHint property in TApplication to enable or disable pop-up hint display for all forms and controls in an application.

TForm.ShowHint TApplication.ShowHint
Allows the control, and all of its children, to be displayed or hidden.

Visible is set to True by Show, or to False by Hide. Calling these methods is equivalent to setting the Visible property.

Reading the Visible property does not take into account control's parent visibility. Use the IsVisible method to get the real visibility.
The general message handler for this control.

Preprocesses several messages, then calls Dispatch to invoke the applicable message handler.

The message to handle. The handler for all messages.

WindowProc is set to by default.

When you ever change WindowProc, then remember the previous setting and delegate all unhandled messages to that method.

TLMessage
How the control is currently docked. (horizontally, vertically, in a notebook, or not at all).

The property value is assigned when the control is inserted into a docking tree during a drag and dock operation. Its value is used when CalculateDockSizes is called to adjust the height or width for the host dock site.

TLazDockTree.InsertControl
Determines whether the control is floating (not part of a form). The class for a floating host dock site for this control. The host site (TWinControl) into which this control is docked. Nil if not docked. The Width when last docked with siblings to the left or right. The Height when last docked with siblings above or below. Height for the control when undocked. Width for the control when undocked. True when BiDiMode is bdRightToLeft. True when BiDiMode is bdRightToLeft. True when BiDiMode is not bdLeftToRight. True when BiDiMode is not bdLeftToRight. True when BiDiMode indicates right-to-left reading is in use. True when BiDiMode indicates right-to-left reading is in use. True when BiDiMode is not bdLeftToRight. True when BiDiMode is not bdLeftToRight. Indicates whether text controls use in bi-directional reading.

In "normal" reading mode (left-to-right, LTR) text entry starts at the left, text is almost left justified, and vertical scrollbars sit at the right side of the control.

In right-to-left mode text entry starts at the right, text is almost right justified, and vertical scrollbars sit at the left side of the control.

In a bidirectional environment these different placements and adjustments can be configured (swapped) in various (but not all) ways.

(Allows RTL languages such as Arabic and Hebrew to be used)

Wild guess: The default mode is established by the platform, RTL reading is not supported on all (Windows) platforms.

Indicates whether the BiDiMode settings in the Parent control are used.

When set to True, the BidiMode property from the Parent control is copied into the BiDiMode property for the control. The default value for ParentBiDiMode is True.

Changing the value for the property causes a CM_PARENTBIDIMODECHANGED message to be performed to update the control.

See BiDiMode or UseRightToLeftAlignment for more information about the use of bidrectional text on the control.

Contains anchor alignment information used to position the control with its left edge anchored to another control.

AnchorSideLeft is a TAnchorSide property with information about the side, type, alignment, and control used to anchor align the class instance. AnchorSideLeft provides access to the array element in AnchorSide stored at the position in akLeft.

Contains anchor alignment information used to position the control with its top edge anchored to another control.

AnchorSideTop is a TAnchorSide property with information about the side, type, alignment, and control used to anchor align the class instance. AnchorSideTop provides access to the array element in AnchorSide stored at the position in akTop.

Contains anchor alignment information used to position the control with its right edge anchored to another control.

AnchorSideRight is a TAnchorSide property with information about the side, type, alignment, and control used to anchor align the class instance. AnchorSideRight provides access to the array element in AnchorSide stored at the position in akRight.

Contains anchor alignment information used to position the control with its bottom edge anchored to another control.

AnchorSideTop is a TAnchorSide property with information about the side, type, alignment, and control used to anchor align the class instance. AnchorSideTop provides access to the array element in AnchorSide stored at the position in akTop.

Contains the shape for the mouse pointer when the mouse is over the control.

Cursor is a TCursor property with the cursor shape displayed when the mouse pointer is hovered over the control. The default value for the property is crDefault.

Changing the value for the property causes a CM_CURSORCHANGED message to be performed to update the control. The value is applied at run-time when the CMCursorChanged method handles the control message.

Use SetTempCursor to display a temporary cursor shape when an action is in progress for the control.

TScreen.Cursors TScreen.RealCursor
The client coordinate with the left edge for the control.

Left is an Integer property with the coordinate for the left edge of the control relative to its Parent. Changing the value for the property causes SetBounds to be called to apply the new value for the property along with the existing values in Top, Width, and Height.

The vertical size for the control.

Height is an Integer property with the vertical size for the control in pixels.

Setting a negative value in Height is not allowed, and the property defaults to 0 (zero). At design-time, setting Height to a value not in the range 0..9999 causes an ELayoutException to be raised (and handled in the IDE).

Setting a new value for the property causes SetBounds and ChangeBounds to be called. This ensures that the new value is is the range allowed in Constraints, and that the control is aligned on its Parent using the Anchors for the control.

A value assigned to Height is ignored when AutoSize is set to True; the control is automatically adjusted to the size needed for its aligned content.

Values in Top, Left, Width, and Height are used to calculate the display area for the control in GetClientRect. They determine the clipping rectangle used when the control is drawn on its Parent.

The text to show in the Hint window for the control.

Hint is a TTranslateString property with hint text displayed in a pop-up window when the mouse is hovered over the control. The pop-up window is displayed when the ShowHint property is set to True.

Assign a value to Hint to describe the usage or formatting conventions used for the value entered in the control. For example:

Edit1.Hint := 'Start Date in MM/DD/YYYY format';

Hint can be given a value that includes both short and long variants of the hint text. The values are separated by a '|' (Vertical Bar) character in the property. For example:

Edit1.Hint := 'Start Date | Start Date in MM/DD/YYYY format';

The short variant is used in the pop-up hint window for the control. The long variant is assigned to the Application.Hint property, or displayed on a form status bar when its AutoHint property is set to True.

As a TTranslateString type, Hint can be localized using the translation facilities built into the LCL and the Lazarus IDE. The property value is written using LCL component streaming when the hint text for the control is not linked to an assigned Action.

Hint is not the same value as the placeholder introduced as the TextHint property in descendent controls.
The client coordinate for the top edge of the control.

Top is an Integer property with the coordinate for the top edge of the control relative to its Parent. Changing the value for the property causes SetBounds to be called to apply the new value for the property along with the existing values in Left, Width, and Height.

The horizontal size for the control.

Width is an Integer property with the horizontal size for the control in pixels.

Setting a negative value in Width is not allowed, and the property defaults to 0 (zero). At design-time, setting Width to a value not in the range 0..9999 causes an ELayoutException to be raised (and handled in the IDE).

Setting a new value for the property causes SetBounds and ChangeBounds to be called. This ensures that the new value is is the range allowed in Constraints, and that the control is aligned on its Parent using the Anchors for the control.

A value assigned to Width is ignored when AutoSize is set to True; the control is automatically adjusted to the size needed for its aligned content.

Values in Top, Left, Width, and Height are used to calculate the display area for the control in GetClientRect. They determine the clipping rectangle used when the control is drawn on its Parent.

Indicates whether context-sensitive Help is selected by numeric ID or keyword.

HelpType is a THelpType property which indicates the mechanism used to locate and display a help topic for the control.

htKeyword
Uses the value in HelpKeyword to locate help content for the control.
htContext
Uses the numeric identifier in the HelpContext property to locate help content for the control.

The default value for the property is htContext.

The value in HelpType is updated when an explicit value is assigned to the HelpKeyword or HelpContext properties.

HelpType is used in the ShowHelp method to select the TApplication method called to display the help content. When set to htContext, the HelpContext method in Application is called. When set to htKeyword, the HelpKeyword method in Application is called. If the help request cannot be handled using the values assigned to the control, the ShowHelp method in Parent is called (when assigned).

TApplication.HelpContext TApplication.HelpKeyword TApplicationProperties.HelpFile TCustomForm.HelpFile THelpType
The context-sensitive Help keyword for the control.

HelpKeyword is a String type with the context-sensitive keyword used to locate and display a help topic for the control. When an value is assigned to the property, the HelpType property is set to htKeyword.

HelpKeyword is used in the ShowHelp method, and passed as an argument to the HelpKeyword method in the Application singleton.

Use HelpContext to specify a numeric context identifier for the help topic displayed for the control.

Use the HelpFile property, found on the parent form or in a TApplicationProperties instance, to set the help file with the content for the help topic.

TApplication.HelpKeyword TApplicationProperties.HelpFile TCustomForm.HelpFile
The numeric context-sensitive Help identifier for the control.

HelpContext is an Integer property with the numeric identifier used to locate and display a context-sensitive help topic for the control. The default value for the property is 0 (zero).

Setting a new value for the property causes HelpType to be changed to htContext.

HelpContext is used in the ShowHelp method, and passed as an argument to the HelpContext method in the Application singleton.

Use HelpKeyword to specify a string value with the help topic displayed for the control.

Use the HelpFile property, found on the parent form or in a TApplicationProperties instance, to set the help file with the content for the help topic.

TApplication.HelpKeyword TApplicationProperties.HelpFile TCustomForm.HelpFile
Integer type used for .

TBorderWidth is an Integer type with the range of values that can be used as the width for a border on a control. TBorderWidth is the type used to implement the BorderWidth property in TWinControl and descendent classes.

Type used for a callback method, to be called for all children of a control. The child control. Defines how child controls are resized / aligned. Using (Delphi compatible).

Anchors and Align work like Delphi. For example if Anchors property of the control is [akLeft], it means fixed distance between left border of parent's client area. [akRight] means fixed distance between right border of the control and the right border of the parent's client area. When the parent is resized the child is moved to keep the distance. [akLeft,akRight] means fixed distance to left border and fixed distance to right border. When the parent is resized, the controls width is changed (resized) to keep the left and right distance. Same for akTop,akBottom.

Align=alLeft for a control means set Left leftmost, Top topmost and maximize Height. The width is kept, if akRight is not set. If akRight is set in the Anchors property, then the right distance is kept and the control's width is resized. If there several controls with Align=alLeft, they will not overlap and be put side by side. Same for alRight, alTop, alBottom. (Always expand 3 sides).

Align=alClient. The control will fill the whole remaining space. Setting two children to Align=alClient does only make sense, if you set maximum Constraints.

Order: First all alTop children are resized, then alBottom, then alLeft, then alRight and finally alClient.

Scale children, keep space between children fixed.

Scale children, keep space between them fixed. Children are resized to their normal / advised size. If there is some space left in the client area of the parent, then the children are scaled to fill the space. You can set maximum Constraints. Then the other children are scaled more.

For example: 3 child controls A, B, C with A.Width=10, B.Width=20 and C.Width=30 (total=60). If the Parent's client area has a ClientWidth of 120, then the children are scaled with Factor 2.

If B has a maximum constraint width of 30, then first the children will be scaled with 1.5 (A.Width=15, B.Width=30, C.Width=45). Then A and C (15+45=60 and 30 pixel space left) will be scaled by 1.5 again, to a final result of: A.Width=23, B.Width=30, C.Width=67 (23+30+67=120).

Enlarge children equally, i.e. by the same amount of pixels.

Enlarge children equally. Children are resized to their normal/advised size. If there is space left in the client area of the parent, the remaining space is distributed equally to each child.

For example: 3 child controls A, B, C with A.Width=10, B.Width=20 and C.Width=30 (total=60). If the Parent's client area has a ClientWidth of 120, then 60/3=20 is added to each Child.

If B has a maximum constraint width of 30, then first 10 is added to all children (A.Width=20, B.Width=30, C.Width=40). Then A and C (20+40=60 and 30 pixel space left) will get 30/2=15 additional, resulting in: A.Width=35, B.Width=30, C.Width=55 (35+30+55=120).

Enlarge space between children equally.

Enlarge space between children equally. Children are resized to their normal/advised size. If there is some space left in the client area of the parent, then the space between the children is expanded.

For example: 3 child controls A, B, C with A.Width=10, B.Width=20 and C.Width=30 (total=60). If the Parent's client area has a ClientWidth of 120, then there will be 60/2=30 space between A and B and between B and C.

Each child gets the same size (maybe one pixel difference). Not implemented in the current LCL version.

Set each child to the same size (maybe one pixel difference). The client area is divided by the number of controls and each control gets the same size. The remainder is distributed to the first children.

Defines the logic used to wrap child controls. No wrapping. Arranges controls in a row filled from left to right, and then top to bottom. Uses the value in BiDiMode; when it contains bdRightToLeft the horizontal direction is reversed (Right to Left). Arranges controls in columns, from top to bottom and then left to right. How child controls are sized relative to their parent.

TControlChildSizing is a TPersistent descendant which provides properties and methods used to layout, align, and resize child controls relative to their parent. Properties are provided which define the horizontal and vertical spacing between controls, the preferred direction controls are aligned, and whether controls are scaled to fit in the parent control.

See and for details about the enumeration values used in the properties.

Additional information about child sizing and layout can be found on the Lazarus Wiki at:

Autosize / Layout (https://wiki.lazarus.freepascal.org/Autosize_/_Layout)

LCL AutoSizing (https://wiki.lazarus.freepascal.org/LCL_AutoSizing)

Notifies the Control of the child sizing changes and signals the OnChange event handler.

The DoChildSizingChange method in Control is called to recalculate the size for its child controls and to realign them. The OnChange event handler is signalled (when assigned) to resize and realign the parent Control.

Constructor for the class instance.

Create is the constructor for the class instance. Create calls the inherited constructor, and sets the default values for properties including:

Control
Set to the value in the OwnerControl argument
Layout
Set to cclNone
EnlargeHorizontal, EnlargeVertical, ShrinkHorizontal, ShrinkVertical
Set to crsAnchorAligning
Control which owns the class instance. Copies property values from the specified persistent object into the current class instance.

Assign is an overridden method in TControlChildSizing used to copy property values from the persistent object in Source to the corresponding properties in the current class instance.

When Source is derived from TControlChildSizing, the properties specific to the class type are examined and copied. The Change method is called prior to exiting from the procedure.

The following property values are copied from Source:

  • EnlargeHorizontal
  • EnlargeVertical
  • ShrinkHorizontal
  • ShrinkVertical
  • ControlsPerLine
  • Layout
  • LeftRightSpacing
  • TopBottomSpacing
  • HorizontalSpacing
  • VerticalSpacing

No actions are performed in the method if the property values from Source have the same values as the properties in the class instance.

If Source is not derived from TControlChildSizing, the inherited Assign method is called to copy the values in Source.

Persistent object with the property values copied in the method. Copies property values from the current class instance to the specified persistent object.

AssignTo calls the Assign method for the object instance in Dest using the current class instance as the source of the values copied in the method.

TPersistent.Assign
Persistent object where the property values are stored. Determines whether the specified sizing contains the same values as the current class instance.

IsEqual is a Boolean function used to determine whether the TControlChildSizing instance in Sizing contains the same values as the current class instance. IsEqual compares the following properties to determine the return value:

  • EnlargeHorizontal
  • EnlargeVertical
  • ShrinkHorizontal
  • EnlargeHorizontal
  • ShrinkVertical
  • EnlargeVertical
  • ShrinkHorizontal
  • ShrinkVertical
  • ControlsPerLine
  • Layout
  • LeftRightSpacing
  • TopBottomSpacing
  • HorizontalSpacing
  • VerticalSpacing

The return value is True when the properties contain equivalent values in both class instances.

True when the specified sizing contains the same values as the current class instance. TControlChildSizing class instance compared in the method. Sets spacing properties in the class instance to the specified value.

SetGridSpacing is a convenience method used to set the values for the spacing properties to a uniform value. The properties are used when child controls are arranged into rows and columns when the Layout property has a value other than cclNone.

The value in the Spacing argument is stored to the following properties:

  • LeftRightSpacing
  • TopBottomSpacing
  • HorizontalSpacing
  • VerticalSpacing
Integer value applied to each of the spacing properties. The Control where the class instance is used.

Control is a read-only TWinControl property which contains a reference to the control where the TControlChildSizing is used. Its value is passed as the OwnerControl argument in the Create constructor. Control provides access to properties and methods in the parent control used to resize and/or realign its child controls. This occurs in the Change method when property value(s) in the class instance have been changed.

Control can also be used in the OnChange event handler as needed, but will likely need to be cast to a descendant class type to access it implementation-specific properties and methods.

The number of controls displayed per column or row for the orientation specified in Layout.

ControlsPerLine is an Integer property which indicates the number of child controls displayed in a column or row using the Layout for the Control. It is relevant when Layout is set to a value other than cclNone.

When Layout is set to cclLeftToRightThenTopToBottomm it indicates the child controls displayed per row. When Layout contains clTopToBottomThenLeftToRight, it indicates the child controls displayed per column. The default value is 0 (zero), and indicates that an explicit value has not been assigned to the property and causes the grid Layout to act as if 1 was specified in the property value.

Changing the value in ControlsPerLine causes the Change method to be called to resize the child controls on the parent Control and signal the OnChange event handler (when assigned).

ControlsPerLine is used in controls like TRadioGroup and TCheckGroup to arrange the radio buttons or check boxes on the control into columns and rows.

Indicates how child controls are expanded and/or aligned horizontally on the parent Control.

EnlargeHorizontal is a TChildControlResizeStyle property which indicates how child controls are expanded or aligned horizontally on the parent Control. The default value for the property is crsAnchorAligning, and indicates that the Anchors, Align, and BorderSpacing properties in the child controls are used - and work like Delphi.

crsAnchorAligning
The Layout and spacing values in the class instance are not used. Instead, properties in the child controls like Align, Anchors, and BorderSpacing are used to resize and align the controls horizontally. Child controls which use the Align property are processed in a specific order: alTop, alBottom, alLeft, and finally alRight.
crsHomogenousChildResize
Applies a homogeneous width to child controls when Layout is set to a value other than cclNone. The realized width is adjusted for the number of pixels specified in LeftRightSpacing, and the number of rows or columns needed for the setting in ControlsPerLine.
crsHomogenousSpaceResize
Applies a uniform number of pixels as horizontal space between child controls on the same row. The number of available pixels is determined by the unused space on the Control and the settings in Layout and ControlsPerLine. An equal number of pixels is applied before, between, and after each column on a given row - including on the left and right edges of the Control. The width of the child controls is not affected.
crsScaleChilds
Scales child controls so they all have a uniform width. The width for each control is determined by the unused client area for the Control and the Layout and ControlsPerLine properties.

The value in EnlargeHorizontal is not used or applied when Layout is set to cclNone.

Indicates how child controls are expanded or aligned vertically on the parent Control.

EnlargeVertical is a TChildControlResizeStyle property which indicates how child controls are expanded or aligned vertically on the parent Control. The default value for the property is crsAnchorAligning, and indicates that the Anchors, Align, and BorderSpacing properties in the child controls are used - and work like Delphi.

crsAnchorAligning
The Layout and spacing values in the class instance are not used. Instead, properties in the child controls like Align, Anchors, and BorderSpacing are used to resize and align the controls vertically. Child controls which use the Align property are processed in a specific order: alTop, alBottom, alLeft, and finally alRight.
crsScaleChilds
Scales child controls so they all have a uniform height. The height for each control is determined by the unused client area for the Control and the Layout and ControlsPerLine properties.
crsHomogenousChildResize
Applies a homogeneous height to child controls when Layout is set to a value other than cclNone. The realized height is adjusted for the number of pixels specified in TopBottomSpacing, and the number of rows or columns needed for the setting in ControlsPerLine.
crsHomogenousSpaceResize
Applies a uniform number of pixels as vertical space between child controls in the same column. The number of pixels is determined by the unused space on the Control and the settings in Layout and ControlsPerLine. An equal number of pixels is applied before, between, and after each child control in a given column - including on the top and bottom edges of the Control. The height of the child controls is not affected.

The value in EnlargeVertical is not used or applied when Layout is set to cclNone.

Minimum space between child controls which are horizontally adjacent.

HorizontalSpacing is the number of pixels reserved as space between horizontally adjacent child controls. It is used when Layout contains a value other than cclNone.

Use VerticalSpacing to set the space reserved between vertically adjacent child control.

Use TopBottomSpacing to set the space reserved at the top or bottom edge for the Control.

Use LeftRightSpacing to set the space reserved at the left or right edge for the Control.

Indicates the layout direction used when child controls are resized and arranged into rows and / or columns.

Layout is a TControlChildrenLayout property which indicates the layout behavior for adjacent controls in the parent Control. Layout is used when methods in TControl (and descendent classes) need to arrange their child controls into columns or rows.

The default value for the property is cclNone, and indicates that a layout direction has not been specified. This causes the design-time positioning in the Anchors, Align, and BorderSpacing properties for the child controls to be used.

Use cclLeftToRightThenTopToBottom or cclTopToBottomThenLeftToRight to layout child controls in column / row order using the BiDiMode settings for the Control. These values also enable use of the spacing and alignment settings in the class including: ControlsPerLine, HorizontalSpacing, VerticalSpacing, TopBottomSpacing, LeftRightSpacing, EnlargeHorizontal, and EnlargeVertical.

Changing the value for the property causes the Change method to be called to resize / realign child controls and to signal the OnChange event handler (when assigned).

Layout is used in TControl methods like WidthIsAnchored and HeightIsAnchored, and in the AlignControls method in TWinControl.

Minimum distance between the left or right edge for the Control and the left or right edge for a child control.

LeftRightSpacing is an Integer property used to specify the number of pixels reserved at the left and right edges of the Control where the class instance is used. For example: When LeftRightSpacing is set to 5 for the Control, the Left property for a child control cannot be smaller than 5.

LeftRightSpacing (and the other spacing properties) are used when Layout contains a value other than cclNone.

Use TopBottomSpacing to reserve space on the corresponding edges for the Control.

Use HorizontalSpacing and VerticalSpacing to specify the space between child controls when a grid Layout is used.

Event handler signalled when the size or layout for child controls has been changed.

OnChange is a TNotifyEvent property with the event handler signalled (when assigned) from the Change method. It occurs after child controls have been resized and/or realigned.

The Sender argument is the TControlChildSizing instance for the event notification.

In a TWinControl instance, its DoChildSizingChange method is assigned as the default handler routine used in OnChange. It invalidates the preferred sizes for the child controls, and calls their Realign method.

Various ways to fit controls into the available Width.

ShrinkHorizontal is a TChildControlResizeStyle property which indicates if and how child controls are resized and aligned horizontally on the parent control. It can contain one of the values from the TChildControlResizeStyle enumeration.

The default value for the property is crsAnchorAligning, and causes the width of child control to be determined using the Anchor and Align properties (like Delphi). For example if Anchors property of the control is [akLeft], it means fixed distance between left border of parent's client area. [akRight] means fixed distance between right border for the control and the right border for the client area on the Parent.

When the parent is resized, the child is moved to keep the defined distances. [akLeft,akRight] means fixed distance to left border and fixed distance to right border. When the parent is resized, the controls width is changed (resized) to keep the left and right distance. Same for akTop, akBottom.

When Align is set to alLeft, the means the control Left and Top are adjusted to fill the available space with the Height at its maximum value. The Width is retained if akRight is not set. If akRight is set in the Anchors property, then the right distance is kept and the control width is resized. If there are several child controls with Align set to alLeft, they will not overlap and be placed side by side. Same for alRight, alTop, alBottom. (Always expand 3 sides).

When Align is alClient. The control will fill the available space in the client area on the parent control. Setting Align in two child controls to alClient can be used if there are maximum value (for width and/or height) in the Constraints property.

Order: First all alTop children are resized, then alBottom, then alLeft, then alRight and finally alClient.

Changing the value for the ShrinkHorizontal property causes the Change method to be called. This causes child controls to recalculate their preferred size and to be realigned on the Control. The OnChange event handler is also signalled (when assigned).

Various ways to fit controls into the available Height.

ShrinkVertical is a TChildControlResizeStyle property which indicates if and how child controls are resized and aligned vertically on the parent control. It can contain one of the values from the TChildControlResizeStyle enumeration.

The default value for the property is crsAnchorAligning, and causes the height of child control to be determined using the Anchor and Align properties (like Delphi). For example if Anchors property of the control is [akTop], it means the distance is fixed between top border of the control and the child control. [akBottom] means the distance is fixed between the bottom border for the control and the bottom border for the child control.

When the parent is resized, the child is moved to keep the defined distances. [akLeft,akRight] means fixed distance to left border and fixed distance to right border. When the parent is resized, the controls width is changed (resized) to keep the left and right distance. Same for akTop, akBottom.

When Align is set to alLeft, the means the control Left and Top are adjusted to fill the available space with the Height at its maximum value. The Width is retained if akRight is not set. If akRight is set in the Anchors property, then the right distance is kept and the control width is resized. If there are several child controls with Align set to alLeft, they will not overlap and be placed side by side. Same for alRight, alTop, alBottom. (Always expand 3 sides).

When Align is alClient. The control will fill the available space in the client area on the parent control. Setting Align in two child controls to alClient can be used if there are maximum value (for width and/or height) in the Constraints property.

Order: alTop children are resized first, then alBottom, then alLeft, then alRight, and finally alClient.

Changing the value for the ShrinkVertical property causes the Change method to be called. This causes child controls to recalculate their preferred size and to be realigned on the Control. The OnChange event handler is also signalled (when assigned).

Minimum distance between the top or bottom edge of a Control and the top or bottom edge for a child control.

TopBottomSpacing is an Integer property with number of pixels reserved as spacing between child controls and the top and bottom edges of the Control. For example: When TopBottomSpacing is set to 5 for a Control, the Top property for a child control starts at 5.

The default value for the property is 0 (zero) and indicates that no additional space is reserved on the corresponding edges of the Control. Changing the value for the property causes the Change method to be called to resize/realign child controls. The OnChange event handler is also signalled (when assigned).

Use LeftRightSpacing to reserved space on the left and right edges of the Control.

Minimum space between child controls which are vertically adjacent.

VerticalSpacing is an Integer property with the number of pixels reserved as spacing between vertically adjacent child controls. The default value for the property is 0 (zero) and indicates that no additional space is reserved on the corresponding edges of the Control. Changing the value for the property causes the Change method to be called to resize/realign child controls. The OnChange event handler is also signalled (when assigned).

Use HorizontalSpacing to set the space reserved between horizontally adjacent child control.

Use TopBottomSpacing to set the space reserved at the top or bottom edge for the Control.

Use TopBottomSpacing to set the space reserved at the top or bottom edge for the Control.

Alias for the TControlActionLink type.

Since HelpContext and HelpKeyword are properties of TControl, this class is obsolete. To maintain compatibility with existing code, its declaration is aliased to TControlActionLink.

Class type used to create new instances of TWinControlActionLink. State flags of TWinControl. Client rectangle has been invalidated and needs to be updated. The Color property in s control has been changed. Set when the font was changed before handle creation. Set during DoAllAutosize. Set when the AlignControls method is called. Set in the method Paint before the LM_ERASEBKGND message is performed. Set while constructing the handle of this control. Set while initializing during handle creation. Set while constructing the handles of the children. Set inside RealizeBoundsRecursive. Set before bounds are sent to the widget; used to suppress subsequent size messages sent by the widget. Set before a visible control and its children are updated during auto-sizing. Set when a control is visible and not obscured on its parent. Set when the adjusted ClientRect is valid. Set when the LCL interface has already called SetBounds during size and move operations. Prevents a loop. Only used for TCustomPairSplitter / TPairSplitter. Only used for TCustomPairSplitter / TPairSplitter. Set type used to store TWinControlFlag enumeration values.

TWinControlFlags is a set type used to store zero (0) or more values from the TWinControlFlag enumeration. TWinControlFlags is the type used to implement an internal member in TWinControl. Values are added to and removed from the set as needed in TWinControl methods.

Flags for finding a control at a given (client) position.

TControlAtPosFlag is an enumeration type with values that indicate the mechanism used to locate a control at a given client position.

Values from the enumeration are stored in the TControlAtPosFlags type.

TControlAtPosFlag enumeration values are used in the implementation of the ControlAtPos method in TWinControl, and in the FindControlAtPosition function.

Include disabled controls when set. Include both TWinControls and TControl instances when set. Checks for hits are limited to the client area when set. Recurse into grand-children controls when set. Scroll offset is already included in the coordinates when set. Include only TWinControls (and ignore TControls) when set. Set type used to store values from the TControlAtPosFlag enumeration.

Passed as an argument to the ControlAtPos method in TWinControl. Used internally in the implementation of the FindControlAtPosition routine.

Used in custom alignment (alCustom).

This record was added for compatibility with Delphi releases after Version 7. It is used in CustomInsertBefore and CustomAlignPosition methods and handlers.

The list of controls currently being aligned. Index of current control. The kind of alignment currently processed (always alCustom). For internal use. Type of an OnAlignInsertBefore handler. The handler determines the order used to align both controls. True if Control2 shall be placed before Control1 is placed. The Parent control. Type of an OnAlignPosition handler.

Specified an event handler which positions the Control using the specified coordinates and alignment information.

TWinControl generating the event notification. The control to position. New Left coordinate for the control. New Top coordinate for the control. New Width for the control. New Height for the control. The remaining ClientRect. Information about the current align process. Implements an enumerator for TWinControl instances.

TWinControlEnumerator is a class used to implement an enumerator for TWinControl class instances. TWinControlEnumerator provides support the enumerator interface through its GetCurrent and MoveNext methods.

TWinControlEnumerator is the type returned by the GetEnumeratorControls and GetEnumeratorControlsReverse functions in TWinControl.

Member with the current position for the enumerator. Member which indicates the order for the enumerator. Member with the Parent for the enumerated values. Gets the current enumerator value. The enumerator instance. Constructor for the class instance. Control which is the Parent for the enumerator. The enumerator uses ascending order when True (default). Returns the enumerator in the class instance (Self). Returns the enumerator in the class instance (Self). Moves to the next value using the ordering in effect for the enumerator. Next value for the enumerator. Contains the TControl instance which is the current value in the enumerator.

Current is a read-only TControl property with the current value in the enumerator. It represents one of the child controls in the TWinControl instance passed as an argument to the Create constructor.

Use MoveNext to move the enumerator to the next control in the order used for the enumerator.

Implements a windowed control which can contain other child controls.

TWinControl is a TControl descendant which implements a base class for controls that can contain child controls. The name reflects the fact that (on Windows platforms) the controls are based on OS-provided widgets, which have window Handles.

TWinControl extends the ancestor class with new properties, methods, and events which are specific to the windowed control. It also provides overridden methods which re-implement the functionality for some inherited methods. The properties, methods, and event fall into categories like:

  • Hi-DPI Awareness and Scaling
  • Control, Window, and Notification Message Handlers
  • Keyboard and Mouse Message Handlers
  • Drag and Drop, Drag and Dock
  • Sizing, Positioning, and Alignment
  • Alternate Constructors and Class Functions used to create TWinControl Instances
  • Forward and Reverse Enumerators for Child Controls

TWinControl is often used as the ancestor for control classes defined in the LCL. For example: TButtonControl, TCustomCalendar, TCustomComboBox, TCustomControl, TCustomEdit, TCustomGroupBox, TCustomListBox, TCustomListView, TCustomPage, TCustomPairSplitter, TCustomProgressBar, TCustomRubberBand, TCustomScrollBar, TCustomStaticText, TCustomTabControl, TCustomTrackBar, TPreviewFileControl, and TStatusBar.

The bounds as sent to the widget. Used to suppress feedback messages from the widget. Aligns the control and its child controls.

AlignControl is a procedure used to align the control (and its child controls) relative to the control specified in AControl. AControl can contain the value Nil to indicate a containing control is not used to align the control instance.

AlignControl calls DisableAlign on entry, and EnableAlign prior to exiting from the method.

No actions are performed in the method when the control is being freed (the value csDestroying is in ComponentState).

AlignControl gets the client rectangle used to display the control, and calls AdjustClientRect to allocate border spacing when needed. AlignControls is called to align child controls relative to the control in AControl using the calculated client rectangle. Some widgetsets update their client rectangle when the first child is positioned; a second call to AlignControls is made if the client rectangle is altered in the initial call to the method.

AlignControl is used in the implementation of the DoAllAutoSize method in TControl.

Control which provides the relative position for the control and its children. Implements the storage specifier for the DoubleBuffered property.

Contains True when the Parent control has not enabled its DoubleBuffered property.

True when the Parent control has not enabled its DoubleBuffered property. Gets the value for the IsSpecialSubControl property. Value for the property. Sets the value for the DesignerDeleting property. New value for the DesignerDeleting property. Places a control at the specified position in the tab order for Controls.

UpdateTabOrder is a procedure used to place the current control at the position in NewTabOrder in its Parent control. Causes the TabOrder for child controls in Parent to be re-sequenced as needed.

No actions are performed in the method when Parent is unassigned (contains Nil).

New tab order for the current control. Inserts or appends the specified control to the list of child controls.

Insert is an overloaded procedure used to insert or append the control specified in AControl to the list of child controls in the class instance. An overloaded variant has an Index argument which specifies the position in the list.

No actions are performed in the method when AControl has not been assigned (contains Nil).

Insert raises an exception if AControl already has an assigned Parent, or when AControl is the same as the current class instance.

The ListInsert routine is called to store AControl in the Controls property at the position contained in Index. If AControl is a TWinControl instance, it is added to the internal list which maintains the tab order for child controls. At design-time, the TabStop property in AControl is automatically set to True when its CanTab property is enabled.

Insert sets the Parent property in AControl to the current control instance.

Inserts checks to see whether auto-sizing has been disabled in the AControl argument. When disabled in the child control, it is also disabled in the current class instance.

Insert is used in the implementation for the InsertControl method.

Raises an EInvalidOperation exception when the inserted control already has a Parent.

Raises an EInvalidOperation exception when the inserted control is the same as the current class instance. Uses the exception message in rsAControlCanNotHaveItselfAsParent.

Control to insert or append as a child control. Position where the new control is stored in the Controls property. Removes the specified control from the list of child Controls for the class instance.

Remove is a procedure used to remove the control in AControl from the list of child Controls for the class instance. No actions are performed in the method when AControl has not been assigned (contains Nil).

Remove ensures that the value in AControl is removed from the Controls property, and the internal list used to determine alignment order of the child controls. When AControl is a TWinControl instance, it is removed from the internal tab order list for child controls.

Remove sets the Parent property in AControl to Nil.

Remove checks to see whether auto-sizing has been disabled in the AControl argument. When disabled in the child control, it is re-enabled for the current class instance.

Remove is used in the implementation of the RemoveControl method.

Control removed from the list of child Controls in the class instance. Fills the list with the child controls which must be realigned.

The list is initialized with all child controls which have the given alignment and are visible.

List all controls with this alignment. TFPList instance populated in the method. TControl instance that is added as the first control in the align list. Member used to store the value for the DoubleBuffered property. Contains various window control state flags. Registers the class instance for use in the widgetset.

No actions are performed in the method when the class type has already been registered in the widgetset.

Calls the inherited method on entry to ensure that the TControl class type has been registered in the widgetset. Calls the widgetset routine used to register the TWinControl class type.

Registers properties in TWinControl which are ignored during LCL component streaming. These are Delphi / VCL compatibility properties like ParentDoubleBuffered, ImeMode, and ImeName. They are not used in the LCL.

TLCLComponent.WSRegisterClass
Override this method when the ClientRect for a control differs from the default value.

In TWinControl, the virtual method has an empty implementation. It can be overridden in descendent classes to perform actions needed for the class type. Such as:

  • Shrink or grow the client rectangle to account for added or removed borders or bezels.
  • Reserve space for companion controls or user interface elements.
  • Set state or configuration flags which affect the client rectangle for the class.

AdjustClientRect can be called often, especially during auto-sizing and anchoring operations. Do not use expensive code here, or cache the resulting client rectangle for subsequent access.

The client rectangle examined and updated in the method. Returns the adjusted logical ClientRect, using the cached value when available.

GetAdjustedLogicalClientRect is a method used to get the client rectangle for the control, and adjust the values for any additional space needed for the control. It calls the AdjustClientRectangle method to apply any additional spacing required for borders, bevels, edges, indentation, etc. In TWinControl, no additional space is required. Descendent classes may have different requirements.

GetAdjustedLogicalClientRect is used to implement the CheckSidePosition method in TAnchorSide.

Output variable with the client bounds adjusted for borders, bevels, edges, or indentation used on the control. Repositions and resizes the control and child controls.

AlignControls is a method used to reposition and resize the specified control and the children in its Controls property. This includes using the DockManager (when assigned and enabled) to reserve space for docked controls in the client rectangle. It uses settings in the Align, Anchor, BorderSpacing, ChildSizing, and Constraints properties to determine the actions needed in the method for each of the controls.

AlignControls checks and updates the windowed control flags prior to starting the operation. No actions are performed in the method when wcfAligningControls is already included in the control flags.

The ControlsAligned method is called when the method is completed, and the control flags are updated to remove the value wcfAligningControls.

AlignControls is called from the private AlignControl method after the client rectangle has been adjusted and the logical display area for the control has been determined. AlignControl is the boss; AlignControls performs the heavy lifting.

Control examined and updated in the method. The available space, becomes remaining space on exit. Indicates whether the specified controls were custom-aligned using the OnAlignInsertBefore handler.

CustomAlignInsertBefore is a Boolean function which indicates whether the specified controls need to be custom-aligned using the OnAlignInsertBefore handler. CustomAlignInsertBefore is called (circuitously) when auto-sizing is performed in the DoAutoSize method, and the Align property in the control is alCustom.

AControl1 and AControl2 are child controls examined to determine the alignment order in the parent control.

The return value is False if OnAlignInsertBefore has not been assigned in the control, or when the controls do not require custom alignment. True indicates that the controls are swapped in the alignment order.

True if Control2 should be placed before Control1. Child control examined in the event handler for its aligment order. Child control examined in the event handler for its aligment order. Returns the aligned position for a custom-aligned child control, using the OnAlignPosition event handler.

The derived coordinates take into account the anchoring for AControl.

The OnAlignPosition handler can update the coordinates as required.

The control to be repositioned / resized. The remaining client area, within which the control can be placed. Information about the current align process. Override this method to position / align all child controls for the specified control.

DoAlignChildControls always returns False in TWinControl. It can be overridden in descendent classes to perform any actions needed, and to set the return value to True to avoid the default handling performed in AlignControls.

True when all controls have been placed. The alignment of all given controls. Control with child controls and client rectangle used in the method. The controls to be placed. The unused client rectangle available for the child controls. Called after a change in ChildSizing information to trigger further processing. Flags the preferred sizes of all child controls as invalid (recursively). Indicates whether the Tab key can be used for keyboard navigation in the control.

CanTab is an overridden method in TWinControl. The return value is True if the control is eligible to receive input focus. It must have a parent form and be both visible and enabled.

Set TabStop to indicate the control is omitted in the tab order for the parent form.

True if the control is eligible to receive input focus. Implements the storage specifier for the ClientHeight property.

Re-implements the method inherited from TControl.

TControl.ClientHeight
True if ControlCount has a non-zero value. Implements the storage specifier for the ClientWidth property.

Re-implements the method inherited from TControl.

TControl.ClientWidth
True if ControlCount has a non-zero value. Sends the new Visible state to the widgetset class instance.

Called from the CMShowingChanged method.

Called from AlignControls when alignment for the control is completed.

ControlsAligned has an empty implementation in the current LCL version.

Sends the new bounds for the control to the widgetset class instance. Called from RealizeBounds. Checks for changes in BoundsRect, and sends the new bounds to the widget.

Calls DoSendBoundsToInterface to update the widget.

Sends changed BoundsRects to the widget, for both the control and all child controls. Resets the realized bounds rectangle for the control.

Creates a new, empty TRect instance for the internal member passed to the widgetset class. Used in widgetset methods which apply changes to the Font for the control.

An empty implementation in the current LCL version.

An empty implementation in the current LCL version.

Creation parameters for the subclass. Class name for the control added as a subclass. Notifies the widgetset class instance when Constraints are changed.

DoConstraintsChange is an overridden method in TWinControl, and calls the inherited method on entry to size and position child controls to Constraints. Calls the ConstraintsChange method in the widgetset class instance when its Handle has been allocated.

DoConstraintsChange is called from the TSizeConstraints.Change method before it signals the OnChange event handler in the constraints class instance.

TControl.DoConstraintsChange
Object (TWinControl) instance for the change notification. Updates the size and extent of the control as well as its ClientRect.

DoSetBounds is an overridden method in TWinControl. It keeps a copy of the current Width and Height prior to calling the inherited method to apply the argument values to the Left, Top, Width and Height properties.

It performs actions to adjust the CachedClientWidth and CachedClientHeight if the control flags do not indicate they are being loading or have already been loaded for the control. Changing the ClientRect here, to the most probable size, reduces unnecessary resize messages.

Normally, the ClientWidth / ClientHeight are adjusted automatically by the widget. But it is up to the widget when this will be done. GTK, for example, just puts resize requests in a queue. The LCL would resize the child components immediately after the GTK procedure to adjust the ClientRect. On complex forms with lots of nested controls, this would result in thousands of resize messages.

New value for the Left property in the control. New value for the Top property in the control. New value for the Width property in the control. New value for the Height property in the control. Shrinks or enlarges the control to accommodate its children.

Because this method is frequently overridden, the LCL calls the method instead; it checks whether DoAutoSize really should be called right now.

DoAutoSize performs the following:

  • Checks whether Autosize is permitted
  • Checks for unaligned child components and aligns them as best it can
  • Moves the constrained (aligned) child components to the correct position
  • Adjusts the size of the client rectangle
  • Adjusts the bounds of the whole control
Performs actions to resize and align the control and all of its children.

DoAllAutoSize is an overridden method in TWinControl.

No actions are performed in the method when wcfAllAutoSizing has already been included in the window control flags; in other words, the method has already been called. No actions are performed when AutoSizeDelayed returns True.

DoAllAutoSize checks to ensure that a Handle has been allocated for the control, and that it and its Parent are Visible. If AutoSizing is not possible, the flag is removed from the control and its children and the method is exited.

DoAllAutoSize calls the inherited method to change the bounds, invalidate the preferred size, and update flags for the control. RealizeBoundsRecursive is called to update the bounds for the all child controls. The child controls are made visible first, and then the current control instance.

DoAllAutoSize is called from the AdjustSize and EnableAutoSizing methods.

The inherited method raises an EInvalidOperation exception if Parent has not been assigned for the control.

Raises a catchable exception when cfAutoSizeNeeded is already included in the control flags when the method is called.

Called from DoAllAutoSize after all bounds have been computed for the control. TCustomForm.AllAutoSized Override this method to return a different preferred height and/or width for auto-sizing.

Calls the inherited method to calculate the default / preferred width and height for a TWinControl instance. It is used by the LCL auto-sizing algorithms as the default size. Only positive values are valid. Negative or 0 (Zero) values are treated as undefined, and the LCL uses other values to perform auto-sizing.

TWinControl overrides this:

  • If there are child components, their total preferred size is calculated
  • If this value cannot be computed (e.g. the children depend too much on their parent clientrect), then the interface is asked for the preferred size

For example the preferred size of a TButton is the size, where the label fits exactly. This relies on the current theme and widgetset.

This value is independent of constraints and siblings, only the inner parts are relevant for the calculates values.

WithThemeSpace adds space for stacking when set to True. For example: TRadioButton has a minimum size. But for stacking multiple TRadioButtons there should be space around each control. This space is theme-dependent, so it is passed as a parameter to the widgetset.

Width used for new instances of the control. Height used for new instances of the control. Indicates if additional space is reserved for theme services. Calculates the width and height for the frame area around the control.

Calculated as follows:

  • AWidth is the difference between Width and ClientWidth.
  • AHeight is the difference between Height and ClientHeight.
Width used for the frame around the control. Height used for the frame around the control. Calls the specified procedure for each child control with Root as the Owner.

Iterates the values in Controls to locate any controls where Root is the Owner of the control instance. Calls the procedure in Proc using the control instance as an argument. An application must implement an object procedure using the signature in TGetChildProc, and pass the procedure in the Proc argument.

The callback procedure. Owner of the controls passed to the procedure. Checks whether the specified class type is allowed as a child control.

ChildClassAllowed is an overridden method in TWinControl used to determine if instances of the class type in ClassType are allowed as child controls. Returns True if the specified class type is allowed as a child control in the Controls property.

In TWinControl, the return value is True when ChildClass has been assigned (not Nil) and the class type is derived from TControl.

ChildClassAllowed does not call the inherited method which always returns False.

ChildClassAllowed is called from the CheckChildClassAllowed method in TControl.

True when ChildClass is allowed in Controls. Class type examined in the method. Paints all child controls which do not have a Handle as part of their Parent.

Controls which do not descend from TWinControl have no handle of their own; they are repainted when the parent control is redrawn.

No actions are performed in the method when the device context in DC is unassigned (0), the Handle has not been allocated for the control, or an internal TFPList has not been created to store the child controls in the Controls property.

PaintControls tries to locate and paint controls (starting with the control in First) not derived from TWinControl. When First is omitted (Nil) or not found in the internal list, all child controls in the list are examined. The control must be Visible and within the visible client area on the Parent to be painted.

Each eligible control is positioned on the device context using the Left and Top properties for the control. Its clipping rectangle is copied to the device context, and an LM_PAINT message is performed on the DC to redraw the parent control.

The ControlState property is updated prior to and following the paint operation for each child control to include or exclude the csPaintCopy value.

PaintControls is called from the PaintHandler method, and occurs when the WMPaint method handles an LM_PAINT message for a control.

The device context usable for painting child controls. First of the controls in Controls[], which remain to paint. Handler for TLMPaint, manages the painting of child controls.

PaintHandler is a method used to apply the LM_PAINT window message in TheMessage to the client rectangle for the control. The device context in TheMessage is used as the target for the paint operation. If the device context is unassigned on entry, the BeginPaint routine in the LCL interface is called to get a device context for the Handle in the control.

PaintHandler checks the list of child controls if any of the items are visible, opaque TControl class instances which need to be drawn using the Handle for the control. When found, a clipping rectangle for the child control is calculated on the device context.

PaintHandler calls the PaintSite method in the DockManager (when assigned and enabled) to paint the DockSite to the device context. The PaintControls method is called to force the all child controls to be painted to the device context.

PaintHandler calls the EndPaint routine in the LCL interface to free the device context prior to exiting from the method.

PaintHandler is called when the WMPaint method receives an LM_PAINT message for the control.

LM_PAINT window message handled in the method. Paints a clipping region for the control on the specified device context.

PaintWindow is a method used to paint a clipping region for the control (or a child control) to the device context in DC.

PaintWindow creates a TLMessage instance using the LM_PAINT window message and the specified device context. The DefaultHandler method is called to pass the message to the widgetset class instance (and ultimately its message processing loop).

No actions are performed in the method when DC is unassigned (0), the Handle for the control has not been allocated, or the control is being freed.

PaintWindow is called from the PaintHandler method.

Device context with the requested clipping region. Creates the Brush, if not already created.

Creates and assigns a TBrush instance used in the Brush property. The brush Color is updated using the resolved value in the Color property. clDefault in Color causes the default brush color value from the widgetset to be used.

CreateBrush is called when the value for the Brush property is read, and the member has not yet been assigned.

TBrush
Scales values for all child controls.

ScaleControls is a method used to scale the child controls in the Controls property using the specified multiplier and divisor. ScaleControls visits each of the class instances in Controls and calls its ChangeScale method using Multiplier and Divider as arguments.

ScaleControls is called from the overridden ChangeScale method. This causes all controls in the hierarchy to apply the scaling factor to values in their Constraints, Font, Left, Top, Right and Bottom properties. For top-level Forms, the values in Left and Top are not scaled.

Multiplier applied to a value to achieve a scaling factor. Divisor applied to a value to achieve a scaling factor. Scales (resizes) the control and all of its child controls.

ChangeScale is an overridden method in TWinControl used to ensure that child controls are scaled using the values in the Multiplier and Divider arguments.

ChangeScale extends the inherited method by calling DisableAlign before applying the scaling factor. It calls the ScaleControls method to apply Multiplier and Divider to the child controls. It calls the inherited method to apply scaling to the Bounds, Constraints, and Font in the control.

ChangeScale visits each of the control instances in Controls, and calls their UpdateAnchorRules method to update the BaseBounds in the control as needed.

EnableAlign is called prior to exiting from the method.

Multiplier applied to a value to achieve a scaling factor. Divisor applied to a value to achieve a scaling factor. Handles a CM_BIDIMODECHANGED control message for the control.

CMBiDiModeChanged is an overridden method in TWinControl used to handle a CM_BIDIMODECHANGED control message received for the control. It calls the inherited method on entry to invalidate the control when needed. It extends the inherited method to notify child controls of the change using a CM_PARENTBIDIMODECHANGED message.

If a handle has been allocated in the widgetset class instance, its SetBiDiMode method is called to reflect the values from UseRightToLeftAlignment, UseRightToLeftReading, and UseRightToLeftScrollBar.

AdjustSize is called to update the sizes for parent and child controls after the property value has been changed.

Control message examined and handled in the method. Handles a CM_BORDERCHANGED message received for the control.

CMBorderChanged ensures that the size and client rectangle are adjusted when a border is added to or removed from the control. It calls DoAdjustClientRectChange and AdjustSize to update values in the control. It calls Invalidate to force the control to be redrawn with the new size and client rectangle.

Control message examined and applied in the method. Handler for changes to the DoubleBuffered property.

CMDoubleBufferedChanged is the handler used to process CM_PARENTDOUBLEBUFFEREDCHANGED messages when the value in DoubleBuffered has been been changed.

CMDoubleBufferedChanged calls NotifyControls to apply the message in the widgetset class; the value in the Message argument is ignored.

CMDoubleBufferedChanged calls Invalidate to cause the control to be redrawn.

Message examined in the method. Handler signalled when the Enabled property has been changed.

If the control is not Enabled and has a Parent control, the RemoveFocus method is called to defocus the control on its Parent form. If the window Handle has been allocated for the control, the EnableWindow routine in the LCL interface is called to set the enabled state for the handle.

CMEnabledChanged calls the inherited method prior to exit to Invalidate the control.

CM_ENABLEDCHANGED control message which triggered the handler. Handles the CM_PARENTDOUBLEBUFFEREDCHANGED control message for the control (when enabled).

Sets the value in ParentDoubleBuffered to True. When Parent is assigned, the value in DoubleBufferred is set to the corresponding value from the Parent control.

No actions are performed in the method if ParentDoubleBuffered is already set to False.

Message handled in the method. Handler for changed Showing message; notifies the widgetset. Control message handled in the method. Handler for changed ShowHint message; notifies all child controls. Control message handled in the method. Handles Focus changes, and forces UpdateControlState. Handler for changed Visible message. Control message handled in the method. Handles the CM_ENTER control message for the control.

CM_ENTER and CM_EXIT messages occur when the active control is changed on a form.

Calls DoEnter to signal the OnEnter event handler (when assigned).

Control message handled in the method. Handles the CM_EXIT control message for the control.

CM_ENTER and CM_EXIT messages occur when the active control is changed on a form.

Calls DoExit to signal the OnExit event handler (when assigned).

Control message handled in the method. Handler for an ContextMenu event; eventually delegates handling to the affected child control. Window message handled in the method. Erases the background, when required. Window message handled in the method. Handles (dispatches) notification messages. Window message handled in the method. Handler for receiving Focus event. Window message handled in the method. Handles the LM_KILLFOCUS message for the control.

WMKillFocus is a method used to handle the LM_KILLFOCUS control message received when a control loses focus. WMKillFocus ensures that the EditingDone method is called for the control when the parent form has been assigned and is Active.

No actions are performed in the method at design-time, or when the control is being freed.

GetParentForm
Window message examined in the method. Handler for changed visibility notification. Window message handled in the method. Handles the LM_ENTER message for the control. Window message handled in the method. Handles the LM_EXIT message for the control. Window message handled in the method. Event handler for a key press not handled by the widget; Tries . Window message handled in the method. Event handler for system key presses not handled by the widget; tries . Window message handled in the method. Event handler for key released, not handled by the widget. Tries . Window message handled in the method. Event handler for system key releases not handled by the widget; tries Window message handled in the method. Handler for messages sent by the widget, after it has handled the key press itself. Window message handled in the method. Handler for messages sent by the widget, after it has handled the key press itself. Window message handled in the method. Manages paint requests, and handles double buffering. This topic needs more detail. BUFFERED_WMPAINT is defined for the Windows platform only. Ensures that a valid device context is selected before calling the Windows API routines like: CreateCompatibleBitmap and BitBlt. Ensures the device context is freed after use. LM_PAINT window message examined and handled in the method. Handler for widget destroyed message; clears the Handle.

Sets Handle to the unassigned value (0) when the windowed control no longer exists.

LM_DESTROY window message which triggered the handler. Handler for widget moved message; updates the Bounds. Window message handled in the method. Event handler for size messages.

This method is called whenever Width, Height, ClientWidth or ClientHeight have changed. If the source of the message is the interface, the new size is stored in the internal BoundsRealized member to avoid sending a size message back to the interface.

Window message handled in the method. Event handler for size/move messages.

This method is called whenever left, top, width, height, clientwidth or clientheight have changed.

If the source of the message is the interface, the new size is stored in the internal BoundsRealized member. Avoids sending a size message back to the interface.

Window message handled in the method. Handler for a key pushed notification; the message is handled by DoKeyDownBeforeInterface by default. Message handled in the method. Handler for a system key pushed notification; the message is handled by DoKeyDownBeforeInterface by default. Message handled in the method. Handler for a key released notification; the message is handled by DoKeyUpBeforeInterface by default. Message handled in the method. Handler for a system key released notification; the message is handled by DoKeyUpBeforeInterface by default. Message handled in the method. Handler for a key pressed notification; CNChar is sent by the widget before it has handled the key press itself. Message handled in the method. Dispatches a drag message, sent by the DragManager.

On dmFindTarget, a TWinControl returns the child control under the mouse, or Self if none is found.

All other messages are handled by the inherited method.

Handles a dmDragDock message, when a control has been docked to this site.

Called when a control is dropped for docking. Asks the dropped control to Dock itself into this control (adjust HostDockSite etc.). Calls an installed DockManager to adjust the coordinates of the docked control. The Result is always True (unless overridden).

Notifies the DockManager of the undock of a client control. Always True. Adjust the Parent of a newly docked Client. The default action is to set the Parent to the new docksite (this control), so that the client is displayed within the new site. Called to check whether this control allows docking and where.

Called for messages from the DragManager including: dmEnter, dmLeave, and dmMove. Gets the DockRect to show.

Positions the DockRect, and invokes OnDockOver (via DoDockOver).

Everything can be overridden using the OnDockOver handler, when assigned.

Initially True, set to False to reject an drop. Invoke the OnDockOver handler. Override this method to take special actions on removal of an docked client. The default implementation does nothing. Notifies an OnUnDock handler and the DockManager of an undocked client control.

The OnUnDock handler can deny the undocking request for the control. This can cause problems; instead, the control better should not be draggable.

Set to False to deny undocking. The new docksite, Nil for floating. The control being undocked. Return information about this dock site (InfluenceRect).

The InfluenceRect determines the screen coordinates, within which a drop is accepted. The InfluenceRect is the slightly inflated WindowRect for the dock site, and can be adjusted in the OnGetSiteInfo event handler.

The dragged control. The screen rectangle within which a drop is allowed. The current mouse position. Can be set to False to reject an drop. Gets the handle for the Parent control.

GetParentHandle is a HWND function used to get the handle for the Parent in the current control. The return value contains the handle for the TWinControl instance in Parent (when assigned). When unassigned, the handle in ParentWindow is used as the return value.

Control or window handle that is the parent for the current control. Gets the window handle for the parent control at the top of the control hierarchy.

GetTopParentHandle is a HWND function used to get the window handle for the first control in the parent control hierarchy. The value in Parent is recursively searched until Parent is not assigned.

The return value is the ParentWindow property in the top-most control. If ParentWindow is 0 (the unassigned value), the value in its Handle property is used.

Window handle for the top-most parent control in the hierarchy. Returns the docked control of the specified name.

This method is used during the restore of the layout of a docksite.

The control is searched in the controls owned by the owner of the docksite.

Override to search other places, or to create a control of the requested name.

The name of the control to be docked. The matching control. Returns the DockManager for this control.

If DockManager is Nil, and UseDockManager is True, a new default DockManager is created.

The dockmanager for this site, can be Nil for an unmanaged site. Sets the value for the DockManager property. New value for the DockManager property. Handler called when the control starts floating.

A TWinControl can be floated as a stand-alone window, unless they request a special FloatingDockSiteClass.

Returns the dock caption in AControl.

Asks the control for its default dock caption, then allows the OnGetDockCaption handler to adjust the string value.

The control whose dock caption string is requested. The dock caption to use. Signals the OnEnter event handler (when assigned) when the control receives focus.

DoEnter is called from the CMEnter method when a CM_ENTER message is received for the control. The event handler allows actions to be performed when the control receives focus, either by using keyboard navigation or by mouse click in the client area for the control.

Signals the OnExit event handler (when assigned) when the control loses focus.

DoExit is called from the CMExit method when a CM_EXIT message is received for the control. The event handler allows actions to be performed when the control loses focus, either by using keyboard navigation or by mouse click in the client area for another control.

Handles a KeyDown event before the widget processes the key.

Key event handlers are invoked in sequence, until a handler is located which responds to the key.

First, all application wide handlers are invoked (TApplication.NotifyKeyDownBeforeHandler).

Second, the form handler is invoked when KeyPreview is requested.

Third, the DragManager is used to determine the dragging status for the control. It interprets the ESC key as a cancel dragging request, and the CTRL key as a request to ignore drag targets.

Finally, the user handler is invoked.

If none of the handlers accept / respond to the key, the widgetset class is used to process the key.

TApplication.NotifyKeyDownBeforeHandler
Set to True when the key was handled. Message examined in the method. Handles key down messages which are not handled by the widget. True if the key was handled. Key down message examined in the method. Handles key up messages not already handled by the widget. True if the key was handled. Key up message examined in the method. Performs actions needed to handle a key press message for the control.

DoKeyPress is a Boolean function used to handle a key press event received for the control. The return value is True if the character code in the specified Message is handled for the control.

DoKeyPress allows a TCustomForm instance in Parent with KeyPreview enabled to handle the notification message using its DoKeyPress method. If the character code is handled, the return value is set and no further actions are performed in the method.

The return value is False when standard events have been disabled by including csNoStdEvents in the ControlStyle property.

When not disabled, the KeyPress method is called using the character code in Message as an argument. If the character was handled in the OnKeyPress event handler, the return value is True.

DoKeyPress is called from the CNChar method when a CN_CHAR control notification message is received for the control.

True if the key press was handled for the control. Control Notification message handled in the method. Performs actions needed to handle a UTF-8-encoded key press message for the control.

DoUTF8KeyPress is a Boolean function used to handle a key press event for a UTF-8-encoded value received for the control. The return value is True if the character code in the specified Message is handled for the control.

DoUTF8KeyPress allows a TCustomForm instance in Parent with KeyPreview enabled to handle the notification message using its DoUTF8KeyPress method. If the character code is handled, the return value is set and no further actions are performed in the method.

The return value is False when standard events have been disabled by including csNoStdEvents in the ControlStyle property.

When not disabled, the UTF8KeyPress method is called using the character code in Message as an argument. If the character was handled in the OnUTF8KeyPress event handler, the return value is True.

At design-time, DoUTF8KeyPress redirects the key event to the active design surface in the Lazarus IDE.

DoUTF8KeyPress is called from the IntfUTF8KeyPress method when a CN_CHAR control notification message is received for the control. DoUTF8KeyPress is called after KeyDown has been executed.

True if the key was handled. UTF-8-encoded character examined in the method. Handles a KeyUp event before the widget processes the key.

For details, see the method.

True if the key was handled. Message examined in the method. Allows a parent form to process a keyboard message in one of its child controls. WantChildKey in TCustomForm always returns False. TCustomForm.WantChildKey True if the key message was handled. Child key message handled in the method. Forwards the key message to the parent form to be handled as an accelerator (shortcut) key.

If the dialog character is handled in the Parent form, the CharCode member in Message is set to VK_UNKNOWN (0).

No actions are performed in the method when accelerator keys are not enabled for the LCL interface, or when ParentForm is unassigned for the control.

True if the key was handled. Message with the key event handled and updated in the method. Handles the specified key in Message as an accelerator or shortcut key.

DialogChar is an overridden Boolean function in TWinControl used to handle a character code in Message as an accelerator (or shortcut) key for a control. It re-implements the inherited method which always returns False. In TWinControl, the Message is sent to each of the children in Controls until one of them indicates that it responds to the accelerator key.

DialogChar is overridden in descendent classes to perform actions needed when the shortcut key is handled in the method. These classes allow the accelerator key to be defined using the Caption or Shortcut properties. Some examples include:

  • TCustomGrid / TGrid
  • TCustomButton / TButton
  • TCustomLabel / TLabel
  • TCustomStaticText / TStaticText
  • TCustomSpeedButton / TSpeedButton
TControl.DialogChar
True if the key was handled. Message with the character examined in the method. Handles key down events for special navigation keys used in a control.

ControlKeyDown is a method used to detect and handle key down events for navigation keys used in the control. ControlKeyDown calls the corresponding method in TApplication to determine the actions needed for the key and modifier. The application handles Tab and cursor keys which may affect control or form focus.

ControlKeyDown is called from the DoRemainingKeyDown method to handle keys not otherwise handled by a control or its parent forms.

TApplication.ControlKeyDown TApplication.DoTabKey TApplication.DoArrowKey
Numeric key code examined in the method. Shift, Ctrl, or Alt modifier for the key. Handles key up events for special navigation keys.

ControlKeyUp is a method used to detect and handle key up events for navigation keys used in the control. ControlKeyUp calls the corresponding method in TApplication to determine the actions needed for the key and modifier. The application handles Return (Enter) and Escape keys which may affect control or form focus.

ControlKeyUp is called from the DoRemainingKeyUp method to handle keys not otherwise handled by a control or its parent forms.

TApplication.ControlKeyUp TApplication.DoReturnKey TApplication.DoEscapeKey
Numeric key code examined in the method. Shift, Ctrl, or Alt modifier for the key. Signals OnKeyDown event handlers (when assigned).

KeyDown is a method used to signal the assigned OnKeyDown event handler(s) for the control. It provides arguments with the virtual key code and the state modifiers for the TKeyEvent type.

KeyDown signals the OnKeyDown event handler (when assigned). The handler routine can modify the Key argument if it is handled (or discarded) in the event handler. Set Key to VK_UNKNOWN (0) in the handler routine if the key event is either applied or discarded by the handler.

When Key has a non-zero value - because OnKeyDown was not assigned or did not handle the key - DoCallKeyEventHandler is called to check other chtOnKeyDown handlers added to the control using AddHandler or AddHandlerOnKeyDown.

KeyDown is called from the KeyDownBeforeInterface method. It occurs after the Application, any forms with KeyPreview enabled, and the active DragManager have examined and possibly handled the key event.

See KeyUp for the actions performed when the key is released.

TCustomForm.KeyPreview TCustomForm.IsShortcut TApplication.IsShortcut Application
Numeric key code examined and handled in the method. Shift, Ctrl, or Alt modifier for the key. Allows the application, parent forms, or control to handle key preview before the LCL interface. Numeric key code examined in the method. Shift, Ctrl, or Alt modifier for the key. An empty implementation in the current LCL version.

An empty implementation in the current LCL version.

Numeric key code handled in the method. Shift, Ctrl, or Alt modifier for the key. Signals the OnKeyPress event handler (when assigned).

KeyPress is called from the DoKeyPress method when the parent form does not have KeyPreview enabled or does not handle the character code in Key. KeyPress is not called if csNoStdEvents has been included in the ControlStyle property.

See UTF8KeyPress for the actions performed for a UTF-8-encoded character in a key press.

Character value for the key press event. Signals the OnKeyUp event handler (when assigned).

KeyUp is a method used to signal the OnKeyUp event handler (when assigned). It provides the arguments with the virtual key code and the state modifiers for the TKeyEvent type.

KeyUp is called from the KeyUpBeforeInterface method. It occurs after forms with KeyPreview enabled or the active DragManager have examined and possibly handled the key event.

See KeyDown for the actions performed when the key down event has occurred.

Numeric key code for the key up event. Shift, Ctrl, or Alt modifier for the key. Signals the OnKeyUp handler (when assigned)) before calling the LCL interface. TCustomForm.KeyPreview Numeric key code for the key up event. Shift, Ctrl, or Alt modifier for the key. An empty implementation in the current LCL version.

An empty implementation in the current LCL version.

Numeric key code for the key up event. Shift, Ctrl, or Alt modifier for the key. Signals the OnUTF8KeyPress event handler (when assigned).

UTF8KeyPress is called from the DoUTF8KeyPress method when the parent form does not have KeyPreview enabled or does not handle the character code in Key. UTF8KeyPress is not called if csNoStdEvents has been included in the ControlStyle property.

The handler routine in OnUTF8KeyPress can modify the value in the Key argument. It sets Key to an empty string ('') if the encoded value is handled in the routine.

See KeyPress for the actions performed for a character value that does not use UTF-8 encoding.

UTF-8-encoded character value for the key press event. Returns the preceding or next control in the tab order.

When CurrentControl is Nil, the first control (forward) or last control (backward) in the TabOrder is returned; direction depends on the value in GoForward.

The (next) control. The control which has the focus. If Nil, the first control (forward) or last control (backward) in TabOrder is returned, depending on GoForward. False to find the preceding control. When True only a control with TabStop enabled is found. When True only a control with Parent set to Self is found. Returns the first control in the tab order for the parent form. Gets the value for the BorderStyle property. Value for the BorderStyle property. Gets the top, left screen coordinates for the client area in the control. TControl.GetClientOrigin TPoint instance with the screen coordinates for the origin of the control. Gets the value for the ClientRect property.

GetClientRect is an overridden method in TWinControl used to get the value for the ClientRect property. ClientRect contains the visual client area for the control.

GetClientRect extends the inherited method to synchronize values in the control with its widgetset class instance using the Handle for the control. It uses values in ComponentState and the control flags for the TWinControl instance to determine the actions needed in the method. If an action cannot be determined, or the handle is not available, values in ClientWidth and ClientHeight are used as the Width and Height in the TRect instance.

TControl.GetClientRect
Value for the ClientRect property. Gets the value for the ControlOrigin property.

GetControlOrigin is overridden in TWinControl to get a window rectangle from the LCL interface. If the Handle for the control has not been allocated, the inherited method is called.

Returns the screen coordinates for the Top and Left coordinate 0,0 of the control area. (The top / left pixel of the control on the screen). Note that this value is the position as stored in the interface and is not always in sync with the LCL. When a control is moved, the LCL sets the bounds to the wanted position and sends a move message to the interface. It is up to the interface to handle moves instantly or to queue them.

TControl.GetControlOrigin
TPoint instance with the screen coordinates for the Top and Left properties. Gets the device context for the control.

GetDeviceContext is an overridden HDC function in TWinControl used to get the device context used for the control.

The device context provides a Handle (yes another one) with information about the drawing region on a display or printer. In the LCL, this essentially identifies a clipping rectangle for a given window handle. In TControl, the device context for the WindowHandle in the Parent control is used (because it does not have its own handle). In TWinControl, the Handle for the control is used.

GetDevice context calls the GetDC routine in the LCL interface to get a device context for the value in its Handle property. On successful completion of the routine, the return value is also assigned to the WindowHandle argument (which is the member for the WindowHandle property for display purposes).

An EOutOfResources exception is raised when GetDC returns an unassigned device context (0).

GetDeviceContext re-implements the inherited method.

Device context created for the control, or 0 when unavailable. Handle for the control represented in the device context. Updated in the method. Sends the specified mouse message to a child control. True if a child control was found at the mouse coordinates. Creates the Handle for the widget, if not already created. Initializes the window creation parameter record with the settings for the control.

CreateParams is a procedure used to initialize and/or update creation parameters in the Params argument. CreateParams is called from the CreateWnd method when the window handle is allocated for the control.

CreateParams ensures that values in the TCreateParams record instance contain the values needed for the class instance. The following members in the record are update:

Caption
Set to the value in the Caption property.
Style
Includes flag values: WS_CHILD, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, and WS_TABSTOP when needed.
ExStyle
Includes style values needed for the value in ControlStyle and BorderStyle.
WndParent
Set to the handle in ParentWindow, or Parent.Handle when assigned.
X, Y, Width, Height
Set to the property values in the class instance.
TCreateParams
Create parameters updated in the method. Creates the interface object (widget) and assigns the value in Handle.

Raises a catchable debugger exception for various conditions, including:

  • The control, or its Parent, has the value csDestroying in the ComponentState property.
  • The method has been called recursively, as indicated by values in the window control flags.
  • The method has been called at run-time before LCL component streaming has been completed.
  • The Handle was not successfully created in the widgetset class.

Ensures that the realized bounds for the control is reset prior to creating the Handle for the control and any child Controls. An EInvalidOperation exception is raised if the handle for the Parent control is not valid when the method is called.

Calls the InvalidatePreferredSize method for the control, and any child controls, and calls AdjustSize. If an error occurred while creating the Handle, auto-sizing is not enabled for the control.

CreateWnd is called from the CreateHandle method.

Destroys the handle for the control and all child controls. Destroys the interface object (widget). Flip children horizontally (mirrors the Left position).

Child controls arranged in left-to-right order appear in right-to-left order after flipping. All anchors are adjusted accordingly.

Prepares to remove the window (called before the Handle is destroyed). Assigns sequential TabOrder values to child controls.

Called from the Loaded method when LCL component streaming is completed. It occurs before auto-sizing is enabled for the component.

Implements the event handler signalled when the Font has been changed for the control.

FontChanged is an overridden method in TWinControl which implements the handler assigned for OnChange events in the control Font. The assignment occurs in the inherited constructor. FontChanged is called when a new value of assigned to the Font property in the control.

FontChanged ensures that the widgetset class instance uses the TFont instance in the Sender argument when its handle has been allocated. It also updates the control flags to remove the value wcfFontChanged when the widgetset class has been updated. If the widgetset handle has not been allocated, the value wcfFontChanged is included in the control flags.

FontChanged calls the inherited method. NotifyControls is called to notify child controls of the change to their parent font.

Object instance (TFont) for the event notification. Copies cached control properties to the newly created widget.

Called after the Handle is created, and before child handles are created.

Performs actions when a component has been loaded during LCL streaming.

Loaded is an overridden method in TWinControl used to perform actions needed when a component has been loaded from a resource during LCL streaming. It extends the inherited method to align and resize it child Controls, as well synchronize property values with those in the widgetset class instance when its handle has been allocated.

Loaded calls the inherited method to update the BaseBounds for control, and to apply property values dependent on the Parent control.

Loaded calls FixupTabList to populate an internal list with child Controls ordered by their TabOrder property.

Realizes all cached changes after a bulk update to a form. Calls the inherited FormEndUpdated method, then informs each child control. The message handler loop for the control.

Used for controls which need features not yet supported by the LCL. MainWndProc has an empty implementation in TWinControl.

TApplication
Message handled in the method. Called after all child handles for the ParentForm are created; notifies all children of the end of the handle creation phase. Called after all child handles have been created; resets wcfCreatingChildHandles. Gets the value for the MouseCapture property.

GetMouseCapture is a Boolean function used to get the value for the MouseCapture property. It is overridden in TWinControl to ensure that the Handle for the control has been allocated. The return value is True when HandleAllocated returns True, and GetCaptureControl returns the current class instance.

Value for the MouseCapture property. Sets the text / caption for the control.

RealSetText is an overridden method in TWinControl. It ensures that the new value is applied to the widgetset class when its Handle has been allocated, and the control size is adjusted when needed/enabled. The inherited method is called to apply AValue to the Text and/or Caption properties for the control.

New value for the text / caption for the control. Notifies the parent Form when the control cannot be focused.

RemoveFocus is a method used to notify the parent form when the control cannot be focused. RemoveFocus is called from methods like Destroy and RemoveControl, where the control will no longer exist on the parent form. It is also called from methods like CMEnabledChanged and CMVisibleChanged, where the parent form should no longer allow the control to be focused.

RemoveFocus calls GetParentForm to get the parent form instance, and calls its DefocusControl method to ensure that the control is removed as the ActiveControl (when assigned).

TCustomForm.DefocusControl TCustomForm.ActiveControl GetParentForm
True if the control is being freed, False when it is not enabled or not visible. Sends Move or Size messages using the window message processing loop.

Sends Move and Size messages through the LCL message paths. This simulates the VCL behavior and has no real effect.

TControl.SendMoveSizeMessages
Sets the value for the BorderStyle property.

Notifies the widgetset class instance of the new property value when its handle has been allocated.

New value for the BorderStyle property. Sets the value for the Color property.

SetColor is an overridden method in TWinControl used to set the value for the Color property. It calls the inherited method on entry, and ensures that the new property value is applied to the internal TBrush instance used in the control. This includes translating the value clDefault to the actual brush color used for the platform.

If the Handle has been allocated for the control, the widgetset class is updated. Otherwise, control flags are updated to include the value wcfColorChanged.

The NotifyControls method is called to send the CM_PARENTCOLORCHANGED control message to the child controls.

New value for the Color property. Updates the position of the child control in the Z plane (i.e. front-to-back).

SetChildZPosition repositions the child control in AChild in the display order for the child Controls in the class instance. No actions are performed in the method when:

  • The Controls list has not been allocated.
  • AChild has not been assigned (contains Nil).
  • AChild is not stored in the child Controls for the class instance.

APosition contains the new relative display order on the Z-axis for the specified child control. A value in APosition must be in the range allowed in Controls (0..Controls.Count-1). Smaller values in APosition move the child control towards the front or top of the display order. Larger values move the child control towards the bottom or back of the display order.

SetChildZPosition calls the Move method in Controls to change the ordinal position for the specified control in the list.

If AChild is a TWinControl descendant, the SetChildZPosition method in the widgetset class is used to notify the child controls which have a valid handle. If AChild is a TControl instance, its InvalidateControl method is called to redraw the control using its visibility and opacity settings.

SetChildZPosition is used to implement the SetControlIndex method.

Control to locate and move in the method. New ordinal position for the control in the Controls property. Displays the control on its Parent.

ShowControl is a method used to display the control on its Parent. When Parent has been assigned, its ShowControl is called. This is repeated until a control without an assigned Parent is encountered.

ShowControl is called from the Show method in a control instance. It occurs before the Visible property is set toTrue, and forces each of the parent controls to become visible before setting the value in the control.

A control to display. Ignored in this method. Updates the visible state for the control, and notifies the widgetset class when available.

Calls AdjustSize when the Handle has been allocated for the control and the control is logically visible in the client area for the parent. This causes DoAllAutoSize and UpdateShowing to be called. If the control is not visible, UpdateShowing is called to hide the control.

Called from the SetParentWindow method.

Updates the Showing property with the visibility for the control, its Parents, and its child controls.

UpdateShowing is a method used to determine the visibility for the Handle in the control. It calls HandleObjectShouldBeVisible to check the handle state and visibility for both the control and each of its Parent controls. If the control should be showing and Handle has not already been allocated, CreateHandle is called.

When child controls exist in the Controls property, they are visited to call the UpdatingShowing method for each of the TWinControl instances.

If an auto-sizing request is not active, a CM_SHOWINGCHANGED message is performed to apply the new visibility for the control(s). The Showing property is updated prior to exiting from the method.

Adds special handling for focus and input messages, and notifies the DockManager.

Handles the following messages:

LM_SETFOCUS
Gets the parent form and show this control as focused
LM_KILLFOCUS
Removes focus from this control
LM_NCHITTEST
Checks the transparency for the control, etc.
Mouse messages
Sent to the DockManager
Message examined and handled in the method. Sets the value for the Text property in the widgetset class.

Calls the SetText method in the widgetset class instance.

WSSetText is called from the Loaded and InitializeWnd methods after the control has finished loading using the LCL streaming mechanism or created its window handle. It is also called from RealSetText to apply a new value for the Caption property to the Text for the control.

The text to send. For internal use; allows direct access to the Handle for the control, bypassing any getter/setter methods. Indicates the border style displayed around the control.

BorderStyle is a TBorderStyle property which indicates the borders drawn for the control. bsSingle indicates that borders are drawn for the control. The default value for the property is bsNone, and indicates that borders are not drawn for the control.

Changing the value for the property causes the widgetset class to be updated when the Handle has been allocated for the control.

BorderStyle is used in the CreateParams method. It causes the WS_EX_CLIENTEDGE extended window style flag to be included in the control when the property is set to bsSingle.

BorderStyle is used along with BorderWidth in descendent classes which allow their borders to be drawn with a raised or lowered appearance.

Provides information about the DockSite for the control.

The handler can adjust the InfluenceRect, within which mouse moves are recognized by this control. The handler also can deny any drops, depending on the dragging operation for the control.

OnGetSiteInfo occurs before the OnDockOver event handler.

This handler can provide a special DockCaption, different than the Caption default. Width of the Border around the control; default is zero.

BorderWidth is a TBorderWidth property which contains the size for a border drawn on the control. The default value for the property is 0 (zero). Changing the value for the property causes a CM_BORDERCHANGED control message to be sent to the processing loop for the control.

BorderWidth is significant when BorderStyle is set to bsSingle. Descendent classes, which allow their borders to be drawn using a raised or lowered appearance, may use the property value when the control is drawn. It indicates the amount of space to reserve for the borders in the bounds rectangle for the control.

A counter used to track updates to the BoundsRect for the control.

BoundsLockCount is a read-only Integer property with the counter used to track active updates to the BoundsRect for the control. Its value is maintained when the BeginUpdateBounds and EndUpdateBounds methods are called. Its value is incremented when BeginUpdateBounds is called, and decremented when EndUpdateBounds is called. When it has a non-zero value, updates to the BoundsRect property are blocked. When it reaches 0 (zero), the SetBounds method is called to store the values in Left, Top, Width, and Height to the bounds rectangle.

The Brush used to paint the background for the control.

Brush is a read-only TBrush property which provides the tool used to paint the interior of the control. The value in Brush is allocated and configured in the CreateBrush method, called when the value for the property is read but has not been assigned.

The Color property in Brush is updated when a new value is assigned to the Color property in the control.

Brush is used in the EraseBackground method and provides the Handle used to draw the background rectangle for the control.

TBrush
The intended ClientHeight, as sent to the widgetset class. The intended ClientWidth, as sent to the widgetset class. Provides settings used to resize and align child controls using a tabular layout.

ChildSizing is a TControlChildSizing property which contains properties and methods used to resize and layout child controls on the control instance. ChildSizing provides an alternative to using Anchors and Align to position and resize child controls. It allows a dynamic tabular (or matrix) layout to be applied to its child Controls.

See TControlChildSizing for more detailed information about the properties and methods in the class instance.

The number of child controls in the Controls property.

ControlCount is a read-only Integer property which contains the number of child controls stored in the indexed Controls property.

The value is updated when control instances are created using the current class instance as the Parent for the control. The value is used in the AlignControls method when the Controls are positioned, aligned, and resized. It is also used to determine whether additional actions are needed in methods like DoChildSizingChange, InvalidatePreferredChildSizes, DoAutoSize, and DoAllAutoSize.

Provides indexed access to the child controls for the class instance.

Controls is a read-only indexed TControl property which provides access to child controls by their ordinal position in the list.

The Index argument contains the ordinal position for the requested child control, and must be in the range 0..ControlCount-1. The index also indicates the display or tab order for the child controls. The physical order for the controls in the list my be changed when the FixupTabList method is called during LCL component streaming.

Ordinal position for the child control requested in the property value. The default WndProc on Windows widgetset and platforms. The number of clients docked into this control.

The docked controls can be accessed inDockClients[].

DockClientCount is equivalent to DockClients.Count, but handles the special case when DockClients is Nil.

The indexed list of controls docked into this control. Index of the requested docked client. The docking layout manager for this control.

A DockSite can be managed (using a DockManager), or unmanaged (positioning docked controls in the event handlers). The DockManager determines the placement for docked controls by setting DropOnControl and DropAlign before the drop, and by resizing and positioning the control when it's dropped.

A DockManager is used only when UseDockManager is set to True. Setting UseDockManager to True creates the DockManager using the DefaultDockManagerClass for this DockSite, if not previously assigned.

An unmanaged DockSite, without a DockManager, can handle the placement of dropped controls in the OnDockOver and OnDockDrop event handlers.

Allows controls to be drag-and-dock-ed into this control.

A DockSite reacts on controls dragged over this control, signals acceptance and where a dragged control would be dropped.

A DockSite should initially be empty, not containing any child controls.
When enabled, it reduces flicker when the control is painted.

Paint requests are typically buffered in the message queue. When a paint message arrives, all elements of the control are drawn onto the screen, according to their type, style, state and content.

This can cause flicker, when stacked controls wipe out preceding paintings, e.g. when unchanged text is erased from the screen before it is painted again, when it takes some time to retrieve the text of list entries, or wrapping long text at the current control boundaries. Owner-drawing also can cause noticeable flicker.

To reduce such flicker, DoubleBuffered controls use a bitmap buffer into which all painting is redirected. When the bitmap has been updated, a paint request is queued for the control. When that paint request is received again, the prepared bitmap is output in one fast BitBlt transfer, eliminating any flicker.

All this happens automatically when DoubleBuffered is set to True; no additional changes are required in application or custom control code.

A reference handle to the widgetset class instance associated with this control.

Handle is a HWND property which represents the handle to the widgetset class instance for the control. It provides a bi-directional communication mechanism between an LCL component and the native control on a given platform or widgetset. Handle has a non-zero value when it has been allocated for the widget.

Read access to the property value calls the HandleNeeded method to create the handle if it does not already exist in the control (and its Parent controls). When the property value is changed, the InvalidatePreferredSize method is called to update control flags and clear the cached size for the control.

Use HandleAllocated to check Handle for a non-zero value. Use HandleNeeded when the LCL component needs to ensure that the control and Parent controls have an assigned Handle. Or call CreateHandle.

Use WindowHandle to access the unique identifier for a device context used in drawing operations for the widgetset class.

Used in Carbon and Cocoa widgetsets

IsFlipped is a read-only Boolean property. It is used in the Carbon and Cocoa widgetsets for the macOS platforms.

Indicates if the control is changing its size after the BeginUpdateBounds method has been called.

IsResizing is a read-only Boolean property which indicates if SetBounds has been called to resize the control, but the action has not been completed. An internal bounds lock counter is used to track the progress of a resize operation. It is incremented when BeginUpdateBounds is called and decremented in the EndUpdateBounds method. The property value is True when the internal bounds lock counter has a non-zero value.

IsResizing is used when a designer surface in the Lazarus IDE tries to select one of its components. It prevents the selection if the SetBounds operation is still in progress (IsResizing is True).

Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.

TabOrder is a TTabOrder with a numeric value which indicates the navigation order for the control when the user presses the Tab or Shift+Tab key. The default value for the property is -1 and indicates that an explicit value has not been assigned.

Each TWinControl has an internal list used to maintain the tab order for its child Controls. When TabOrder is -1 for a given child control, it added to the end of the tab order list. A non-zero value forces the control to be stored at that ordinal position in the tab order list. Setting a new value for the property causes the private UpdateTabOrder method to be called to maintain the sequence for the child controls.

Use TabStop to indicate if the control can be focused using tab order navigation request.

Allows the user to navigate to / from the control by pressing the Tab or Shift+Tab keys.

TabStop is a TabStop property which indicates if the control can be focused when using the Tab or Shift+Tab keys to navigate between controls on a form. The default value for the property is False. At design-time, the Lazarus IDE sets the value to True in newly created control instances.

When set to True, the windows style flags are updated to include the value WS_TABSTOP in the CreateParams method.

Changing the value for the property causes the internal tab order list to be updated, and a CM_TABSTOPCHANGED control message is performed for the control.

TabStop is used in methods like FindNextControl, and may be updated in methods like Insert.

Event handler signalled to determine the order and placement for custom-aligned child controls. Event handler signalled to determines the position and size for custom-aligned child controls. Event handler signalled for the drop of a control to be docked. Event handler signalled when a control is moved over a docksite; determines whether the drop event is accepted or rejected. Event handler signalled when the control receives focus.

OnEnter is a TNotifyEvent property with the event handler signalled when the control receives focus. It is signaled from the DoEnter method, and occurs when the CM_ENTER control message is received and handled for the control.

The Sender argument contains the object for the event notification, and must be cast to TControl, TWinControl, or other descendent class to access properties or methods specific to the implementation.

Use OnExit to perform actions needed when the control loses focus.

Event handler signalled when the control loses focus.

OnExit is a TNotifyEvent property with the event handler signalled when the control loses focus. It is signalled (when assigned) from the DoExit method, and occurs when a CM_EXIT control message is received and handled for the control.

The Sender argument contains the object instance for the event notification. It must be cast to TControl, TWinControl, or a other descendent to access properties or methods specific to the implementation.

OnExit occurs after the OnEditingDone event handler which is signalled when the content for the control has been modified. Descendent classes generally perform any actions needed to maintain their internal state before OnExit is signalled. The notable exception is TCustomMaskEdit which can be configured to perform validation after the event.

Event handler signalled for key down keyboard events.

OnKeyDown is a TKeyEvent property with the event handler signalled to handle a key down event for the control. The event handler receives keys including control and other non-visual keys. It is signalled (when assigned) from the KeyDown method.

The Sender argument contains the control for the key event. It must be cast to TControl or TwinControl type to access properties or methods specific to the descendent classes.

The Key argument contains the virtual keyboard constant for the key event (like VK_F1 or VK_NUMPAD5). It is a variable argument and can be modified in the event handler. Set Key to VK_UNKNOWN if the handler routine has performed the actions needed to handle the key event. Otherwise, Key is passed to other OnKeyDown handlers at the form or application level.

Shift is a set type which contains the modifiers for the key down event like: Ctrl, Shift, Alt, or Meta.

When a key is held down, the OnKeyDown event is re-triggered. The first re-triggered event occurs after approximately 500ms, and subsequent events cycle between 30ms and 50ms until the key is released.

Use OnKeyUp to perform actions needed when the key is released.

Use OnKeyPress or OnUTF8KeyPress to implement a handler routine for printable character values.

Event handler signalled for character data entered by the user.

This handler only receives characters, not control or other special key codes. Control keys should be handled by an OnKeyDown handler instead. The handler can also be used to convert the character into a different one.

We recommend using OnUTF8KeyPress to prevent data loss. Characters are converted from UTF-8 to the system encoding in OnKeyPressEvent, with possible loss of characters outside the ANSI codepage.
Event handler signalled when a key up event has occurred for the control.

OnKeyUp is a TKeyEvent property with the event handler signalled when a key up event has occurred in the control. OnKeyUp is signalled (when assigned) from the KeyUp method. It occurs when the CN_KEYUP or CN_SYSKEYUP notifications are handled for the control.

The Sender argument contains the control for the key event. It must be cast to TControl or TwinControl type to access properties or methods specific to the descendent classes.

The Key argument contains the virtual keyboard constant for the key event (like VK_F1 or VK_NUMPAD5).

Shift is a set type which contains the modifiers for the key down event like: Ctrl, Shift, Alt, or Meta.

Unlike OnKeyDown, this event occurs only once for auto-repeated keys. For more information, see .

Use OnKeyDown to perform actions needed when a key down event for a non-printable key is received for the control.

Use OnKeyPress to handle a key press for printable characters entered into the control.

Event handler signalled before a control is undocked from its DockSite.

OnUnDock is a TUnDockEvent property with the event handler signalled before a control is undocked from its DockSite. The event handler arguments identify the control with the DockSite, the client control which will become undocked, the control that has the new dock site, and a Boolean which indicates if the operation is allowed.

The event handler can be used to disallow undocking by setting the Boolean argument to False in the handler routine.

OnUnDock is signalled from the DoUnDock method.

Handler for a character entered by the user.

This handler receives characters codes only, not control or other special key codes. Control keys should be handled by an OnKeyDown handler instead. The event handler can also convert the character code into a different value.

While OnKeyPress receives only ANSI characters (with possible loss of characters outside the ANSI codepage), the OnUTF8KeyPress handler receives the UTF-8-encoded character code.

Value for the DoubleBuffered property in a Parent control.

ParentDoubleBuffered is a Boolean property which indicates the value for the DoubleBuffered property in the Parent control. The default value for the property is True. Changing the value for the property causes a CM_PARENTDOUBLEBUFFEREDCHANGED message to be performed (for the control) when Parent has been assigned.

To disable double buffering for a single control, make sure both DoubleBuffered and ParentDoubleBuffered are set to False.

Double buffering is a technique used to reduce screen flicker when controls are redrawn. It uses an additional off-screen buffer to perform drawing operations, and transfers the content to the on-screen buffer when completed.

DoubleBuffered and ParentDoubleBuffered are implemented for the Win32 platform/widgetset. It is implemented for TWinControl (and descendants) and TApplication. In TApplication, the setting is applied to all forms and controls when assigned before the forms and controls are created.

The window Handle for the Parent widget.

ParentWindow is a HWND property with the window Handle for the Parent widget. A new value assigned to the property is ignored when Parent has already been assigned.

The property value is assigned when the CreateParented constructor or the CreateParentedControl class function is used to create a new TWinControl instance. Setting the property to 0 (zero) causes the handle to be destroyed. 0 is the unassigned handle value.

ParentWindow is used in the the CreateWnd method to form an association between the Handle in the widgetset class instance and the window handle for a control.

Cached visibility for the widget. Not necessarily in sync with the widget.

Showing is a read-only Boolean property with the visibility for the Handle in a control or its Parent. The value for the property is assigned in the UpdateShowing method when the control hierarchy is checked for valid and Visible window handles for the control or its Parents. Showing may be updated when the DoAllAutoSize or UpdateControlState methods are called.

Determines whether a DockManager is used for this DockSite.

When UseDockManager is set to True, and DockSite is also set to True, a DockManager is created automatically. When set to False, an existing DockManager is ignored.

If you want to use a special DockManager, install it before setting UseDockManager to True.

Indicates whether the wcfDesignerDeleting flag is included in the flags for the control.

DesignerDeleting is a Boolean property which indicates if the wcfDesignerDeleting is includes in the control flags for the TWinControl instance. When set to True, wcfDesignerDeleting is included in the control flag values. When set to False, it is removed. Used in TPairSplitter only.

Indicates if the control has the wcfSpecialSubControl control flag.

IsSpecialSubControl is a read-only Boolean property. Its value is True when wcfSpecialSubControl has been included in the WinControlFlags for the control. Used in TCustomPairSplitter only.

The number of visible docked controls. Translates control state flags into AutoSizePhases.

The return value is a TControlAutoSizePhases set type. It is populated with values from the TControlAutoSizePhase enumeration based on window control flags and other internal members in the class instance. When Parent has been assigned, the values are derived by calling AutoSizePhases in Parent.

AutoSizePhases is called from methods like DoAutoSize and UpdateShowing. It is also called from window message handlers like WMMove, WMSize, and WMWindowPosChanged.

Set withe auto-size phase values enabled for the control. Returns True if auto-sizing has been delayed until some other process is completed.

AutoSizeDelayed is an overridden Boolean function in TWinControl. It returns True when auto-sizing cannot or should not be performed at the current time, or when the value in Showing cannot be changed.

In TWinControl, it checks the ControlState flags for the value csDestroyingHandle when determining the return value for the method. AutoSizeDelayed calls the inherited method, and sets the return value to True if either condition is True.

The value from AutoSizeDelayed is used in methods like DoAllAutoSize and UpdateShowing.

True if auto-sizing cannot be performed at the current time. Returns True if AutoSize should be skipped / delayed because of its handle. Starts an update to the Bounds property; disables SetBounds by incrementing BoundsLockCount. Ends an update to the Bounds property; decrements BoundsLockCount and eventually calls SetBounds. Disables sending bounds to the widget, by incrementing the internal FRealizeBoundsLockCount. Enables sending bounds to the widget again, eventually updates the widget. Get the child control at the given client position.

WinControls are found before Controls (if overlapping).

The found control, Nil if none found. The client coordinates. Allow finding disabled controls. Allow finding TWinControls, in addition to TControls. Only search in client areas. Encoded Allow... conditions. Returns True if the control is a parent for the specified control. True when we are a parent of Control. The control examined as a child control. Asks the widget if ClientRect has changed since the last AlignControl execution; calls AdjustSize on change. The ClientRect is cached; call this procedure to invalidate the cache, so that the next ClientRect value is fetched from the widgetset class. Also invalidate all child controls, if True. The ClientRect is cached - check if the cache is valid. True if update needed. Sets the control bounds and adjusts child and docked controls.

SetBounds is an overridden method in TWinControl. used to set the bounds for the control to the values in the ALeft, ATop, AWidth, and AHeight arguments.

No actions are performed in the method when the internal BoundsLockCount member has a non-zero value. In other words, when BeginUpdateBounds has been called and EndUpdateBounds has not been called.

At design-time, SetBounds checks to ensure that negative is not present in the Width or Height properties when the user has changed the bounds for the control.

SetBounds calls DisableAutoSizing to reduce the overhead for recomputing/moving/resizing when the bounds are changed. The inherited method is called to apply the new values in ALeft, ATop, AWidth, and AHeight. EnableAutoSizing is called to re-enable auto-sizing when the operation has been completed.

SetBounds is called when any one of these Left, Top, Width or Height properties, or the BoundsRect property has been changed.

Keep in mind that the given aLeft, aTop, aWidth, aHeight might not be valid and will be changed by the LCL before applied.

The X coordinate for the left side of the control. The Y coordinate for the left side of the control. The width for the control. The height for the control. Returns the Client rectangle relative to the controls left, top.

If Scrolled is True, the rectangle is moved by the current scrolling values (for an example see TScrollingWincontrol).

TControl.GetChildrenRect
Disables auto-sizing when aligning the control and its parent. Re-enables auto-sizing after aligning the control and its parent. Adjusts the size and placement for the control and all of its children.

Calls the inherited AdjustSize method.

Scrolls the control using the handle for the widgetset class. Raises an Exception if the handle has not been allocated for the widgetset class instance. Raised with the message 'TWinControl.ScrollBy_WS: Handle not allocated'. Number of pixels scrolled in the horizontal direction. Number of pixels scrolled in the vertical direction. Scrolls child controls by the specified number of pixels.

ScrollBy temporarily disables auto-sizing while the child Controls are being moved, and re-enables auto-sizing prior to exiting form the method. The Left and Top bounds for each of the child Controls are updated by the amounts specified in DeltaX and DeltaY. The Height and Width values are not modified.

Number of pixels scrolled in the horizontal direction. Number of pixels scrolled in the vertical direction. Automatically adjusts the size and layout for the control (and all of its children).

AutoAdjustLayout is an overridden procedure used to automatically adjust the size and layout for the control. All children in the Controls property also call their AutoAdjustLayout method, and the inherited method is called to adjust and resize the current control instance.

AutoAdjustLayout calls DisableAutoSizing on entry, and EnableAutoSizing prior to exit from the method.

Layout mode applied in the method. Existing pixels per inch (PPI) setting for the control. Target pixels per inch (PPI) setting for the control. Form width before PPI scaling is applied. Form width after PPI scaling is applied. Fixes the design-time PPI settings for the control font, and applies the changes to child controls. Constructor for the class instance.

Create is the overridden constructor for the class instance. Create calls the inherited method using TheOwner as the owner for the class instance. Create allocates resources needed in the class instance, and sets the default values for the following properties:

ParentDoubleBuffered
Set to True
ChildSizing
Sets DoChildSizingChange as the OnChange event handler
Brush
Set to Nil; few controls require a brush, and it is created on DoRemainingKeyDown
TabOrder
Set to -1
TabStop
Set to False

Create calls the InvalidateClientRectCache method to invalidate a cached client rectangle, and to force the value to be read from the LCL interface.

Owner of the class instance. Constructor for a control that is the child of the given widget. Destructor for the class instance.

Destroy is the overridden destructor for the class instance.

Destroy call RemoveFocus to ensure that the control cannot receive focus from a Parent control. If a handle has been allocated for the windowed control, the DestroyHandle method is called.

Destroy iterates over Controls to remove the value in the Parent property for each child control, and to remove an assigned HostDockSite. It does not actually free the child Controls; they are freed by the owner of the control instance (usually a TForm instance).

Destroy ensures that any controls in the DockClients property remove the current class instance from their host dock site.

Destroy frees resources allocated in the constructor, or in other class methods, including the DockManager and DockCients. Destroy calls the inherited destructor prior to exiting from the method.

Handler for a DragManager dmDragDrop message, sent when a dragged control has been dropped onto this docksite.

Asks the dropped control to dock itself into this docksite, updates its Parent, HostDockSite, and the DockClients for the old and new DockSite.

When a DockManager is installed, it is used to position the docked control (InsertControl).

Finally, an OnDockDrop event is signalled.

Is this control allowed to receive the focus when parent form is visible?

Checks if the control can get focus when parent form is visible, i.e. if all its parents except the form are visible and enabled.

A possible usage:

if FormFoo.EditBar.CanFocus then FormFoo.ActiveControl := FormFoo.EditBar; CanFocus returns True even if the parent form is not actually visible, and a subsequent SetFocus call could throw an exception. Use CanSetFocus in this case.
Is this control allowed to receive the focus?

Checks if the control can receive focus, i.e. if all its parents are visible and enabled.

A possible usage:

if MyControl.CanSetFocus then MyControl.SetFocus;

CanSetFocus should be preferred over CanFocus if used in CanSetFocus/SetFocus combination because it checks also if the parent form can receive focus and thus prevents the "cannot focus an invisible window" LCL exception.

Finds the position for the specified control in the Controls property.

Calls the IndexOf method in Controls to find the child control in AControl. The return value contains the ordinal position in Controls where AControl is stored, or -1 when not found or Controls has not been assigned.

TFPList.IndexOf
The ordinal position in Controls, -1 if not found. The child control to locate in the method. Checks whether the control has focus.

Focused is a Boolean function which indicates whether the control can be and is the currently focused control. The return value is True when the control can become focused during tab order navigation, has a valid Handle, and is the currently focused control in the widgetset class instance.

True when the control has focus. Changes the focus to the next (or preceding) control. True when the focus has been transferred. The direction of Tab movement; True for the next control in the TabOrder, False for the preceding control. Finds a child control with the specified name. True when the control has been found. The Name of the control to find. Transfers the focus to the next child control.

The search wraps around on the boundaries of the TabOrder array. When no next control can be found, the focus remains unchanged.

The control which is assumed to have the focus. False when the control preceding CurControl shall be found. When True, only select a control that can receive the focus. Posts the specified message to all of the child controls.

Allows the specified method to be handled by one of the child Controls. The ToAllMessage argument is untyped; any TLMessage descendant can be passed as the value for the argument.

The method name is a misnomer. Broadcast implies delivery of the message simultaneously to all of the recipients. Actually, it is more like a telegraph. The message is posted sequentially to child controls until one of them handles the message using its WindowProc method.

Use NotifyControls to post a message with a specific message identifier constant to child Controls in the class instance.

The message sent in the method. Sends a message to all child controls.

Calls the BroadCast method to deliver a TLMessage instance with the identifier in Msg.

The message ID. Handles all messages that the control doesn't fully handle itself.

This implementation sends the message to the widget's message handler.

Override this method to implement your own message handling. If the message Result is non-zero, the message already has been handled; otherwise, set the Result to a non-zero value (depending on the message ID) when the message has been handled.

TObject.DefaultHandler
The message to process. Schedules a repaint request.

Invalidate is an overridden method in TWinControl. It re-implements the inherited method to call the Invalidate method in the widgetset class instance when its Handle has been allocated. It does not call the inherited method.

The control is redrawn when there are no pending window messages in the message queue.

Tells the widgetset to add a Handle object representing the current control to the Parent handle. Inserts the specified control into the Controls property. The control to insert. Insert at index (optional). Removes the specified control from the Controls property. The control to remove. Gets an enumerator for the Controls property. The TWinControlEnumerator instance. Gets a reverse-order enumerator for the Controls property. The TWinControlEnumerator instance. Ensures that the control or window handle has focus.

SetFocus is a procedure used to give focus to the current control. SetFocus calls GetParentForm for the control instance, and uses its FocusControl method to change the focused control.

If the parent Form is unassigned (contains Nil), the LCL interface is used to change focus to the handle for the control. No actions are performed in the method when Form is unassigned and the control does not have an allocated handle.

Flip children horizontally. That means mirroring the Left position and anchoring.

Child controls arranged in left-to-right order appear in right-to-left order after flipping. All anchors are adjusted accordingly.

Flip recursive? Returns the docking caption for the specified control. String the docking caption for the control. Control instance examined in the method. Updates the Caption to reflect the names for the docked clients.

Called when this is a HostDockSite and either the list of docked clients have changed, or one of their captions has changed.

If the control is being undocked, but still is in the DockClients list, it is excluded from the docking caption and the Exclude argument is set to True.

Control to exclude from the DockCaption. Fill the list with all TabStop controls, recursing into child controls. The list to which the controls shall be added. Checks whether a handle for the widget has been allocated for the control. True when a widget exists and its Handle is not Nil. Returns True if all Parents have handles allocated, and are not being destroyed.

ParentHandlesAllocated is an overridden method in TWinControl which checks whether Handles are valid for all controls in the component hierarchy for the current control.

ParentHandlesAllocated visits each of the controls, starting with the current class instance, and checks whether the control has an allocated handle and is not being destroyed. It navigates to the next Parent control in the hierarchy, and exits when the Parent control is unassigned.

The return value is True when all of the controls in the hierarchy have an allocated Handle and are not being destroyed. The return value is False if any control is found in the hierarchy that does not have a valid handle allocated, or ComponentState indicates its handle is being freed.

True when all of the controls in the Parent hierarchy have a valid handle. Call this method when your code requires a valid Handle for this control.

An attempt is made to create a widget, when not already done.

In certain situations it may be impossible to create a widget right now!
Indicates whether a Brush has been created for the control. True when a Brush has been created. Fills the display rectangle for the control with the color and pattern in Brush.

EraseBackground is called during Paint requests from the WMEraseBkgnd method, which provides a valid device context in the DC argument. No actions are performed in the method when DC contains 0 (unassigned).

The FillRect routine is called to perform the operation using the Width, Height, and the handle in the Brush property.

The device context to use; may be clipped to a certain shape. Called by the interface after the navigation and specials keys are handled; i.e. after KeyDown but before KeyPress.

Essentially expands a repeat count into multiple keystrokes. Cannot be used for SysKeys.

True when multiple keystrokes have been processed. The UTF-8 encoding of the character. Must be greater than zero, the exact value is ignored. Must be False, else nothing happens. Searches for a Parent form that can be used as a file drop target. The TCustomForm instance that allows file drop actions, or Nil when file drag/drop is not supported. Paints the control using the handle for the widgetset class.

PaintTo is a procedure used to draw the control using the handle for the widgetset class. An overloaded variant is provided which uses the handle in a TCanvas instance as the target for the drawing operation.

Device context (or Handle) used for the operation. Horizontal coordinate where the control is drawn. Vertical coordinate where the control is drawn. TCanvas instance with the handle used in the operation. Specifies the non-rectangular shape of the widget.

SetShape is an overloaded procedure used to set the shape for the control to the non-rectangular value in AShape. The overloaded methods allow AShape to be either a TBitmap or a TRegion value.

When TBitmap is used, the widgetset class calls its SetShape method to apply the TBitmap handle to the handle for the widget. No actions are performed in the method when a handle has not been allocated for the widgetset class.

When TRegion is used, SetWindowRgn in the LCL interface is called to apply the region in AShape to the handle for the control.

Shape for the control; TBitmap or TRegion in overloaded methods. TGraphicControl is the base class for all lightweight controls.

TGraphicControl supports simple lightweight controls that do not need the ability to accept keyboard input, and do not contain other controls. Since lightweight controls do not wrap GUI widgets, they use fewer resources than controls based on TWinControl. If you want to accept keyboard input, or need to support child controls, use a TCustomControl instead.

TGraphicControl provides a Canvas property for access to the control's drawing surface and a virtual Paint method and an OnPaint handler, called in response to paint requests received by the parent control.

Override the Paint method, or supply your own OnPaint handler, to do the actual drawing of the control.

TCanvas
Handles a LM_PAINT message for the control. Message handled in the method. Performs actions needed when the Font for the control has been changed.

FontChanged is an overridden method in TGraphicControl used to perform actions needed when the Font for the control has been changed. It is the routine used as the OnChange event handler for the Font property, and is assigned in the inherited constructor for the class instance.

Sender contains the object instance for the event notification, and is provided to maintain compatibility with the TNotifyEvent signature for the event handler. It is not used in TGraphicControl, but is passed as an argument to the inherited method.

FontChanged ensures that the new value for the Font property is also applied to the Canvas for the control. This includes the PixelsPerInch setting for the Font. FontChanged calls the inherited method prior to exit.

TFont.PixelsPerInch
Object instance for the event notification. Implements the default handler used to draw the control.

Paint is a method which causes the control to be drawn using the drawing mechanism for the control. In TGraphicControl, like TCustomControl, the OnPaint event handler is used (when assigned). Assign a routine to the OnPaint handler to perform the drawing operations needed for the control.

Performs action needed when the bounds for the control have been changed.

DoOnChangeBounds is an overridden method in TGraphicControl. It calls the inherited method on entry to update control flags and signal OnChangeBounds event handlers for the control. The Handle in Canvas is freed prior to exiting from the method. The handle is re-allocated the next time it is accessed.

DoOnChangeBounds is called when the component is loaded using the LCL streaming mechanism, and from the ChangeBounds method when the control is resized.

Performs actions when the handle for the parent control is freed.

DoOnParentHandleDestruction is overridden in TGraphicControl to re-implement the method in the ancestor class. It ensures that Handle for the Canvas is freed when the parent handler is destroyed.

Event handler signalled to paint the control.

OnPaint is a TNotifyEvent with the event handler signalled to paint the control. Applications must implement and assign a routine to the event handler to perform the drawing operation. TGraphicControl does not provide a default drawing mechanism.

Use the Canvas for the control to perform drawing operations. The Font and Brush in Canvas are automatically configured to use values assigned to the corresponding properties in the control. BorderStyle, however, is not automatically applied. Use the Pen in Canvas as needed to draw the BorderStyle for the control.

OnPaint is signalled (when assigned) from the Paint method.

Handles the CM_CURSORCHANGED message for the control.

CMCursorChanged is an overridden method in TGraphicControl. It ensures that the control is Visible before the temporary cursor shape is changed.

Visible must be set to True, and the Parent control (with the window handle) must be assigned before the control can be displayed. No actions are performed in the method if Visible is False, or Parent is Nil.

In addition, the mouse must be over the control to apply the cursor shape using SetTempCursor and the value in the Cursor property.

Constructor for the class instance.

Create is the overridden constructor for the class instance. It calls the inherited method on entry using AOwner as the owner of the class instance. Create allocates a TControlCanvas instance used for the Canvas property.

Owner of the class instance. Destructor for the class instance.

Destroy is the overridden destructor for the class instance. It ensures that resources allocated for the Canvas property are freed. It calls the inherited destructor prior to exiting from the method.

A clipped window into the parent Canvas.

Don't paint on the entire Canvas! Instead use the dimensions of the TGraphicControl stored in the ClientRect.

If you ask for the Canvas.Width or Canvas.Height, you are actually getting the Canvas dimensions from the Parent control.

TCanvas
The base class for windowed controls which paint themselves.

In contrast to TGraphicControl, a TCustomControl can accept keyboard input (and receive Focus), and can have child controls. It is used as the base class for many of the controls in the LCL.

TCustomControl provides overridden methods which handle messages, update control state flags, and update the Canvas where the control is drawn.

Override the Paint method, or supply your own OnPaint handler, to perform the actual drawing operations for the control.

Handles LM_PAINT messages for the control.

Re-implements the method from the ancestor class to update ControlState prior to handling the specified Message. Includes the value csCustomPaint in ControlState before calling the inherited method. Removes csCustomPaint from ControlState after the message has been handled.

No actions are performed in the method when the control is being freed, or when a Handle has not been allocated for the control.

Message handled in the method. Destroys the handle for the Canvas and the interface object.

DestroyWnd is an overridden method in TCustomControl. It ensures that the Handle in Canvas is freed before calling the inherited method.

The Paint handler plug-in, intercepting paint requests.

PaintWindow is an overridden method in TCustomControl. It ensures that Canvas has an allocated Handle which matches the device context specified in the DC argument. If the Canvas handle does not match DC, the value in the argument is assigned to Canvas.

PaintWindow calls the Paint method to signal the OnPaint event handler (when assigned).

If Handle value in Canvas was changed in the method, it is reset to 0 (unassigned) prior to exit.

PaintWindow does not call the inherited method.

The Device Context used to draw on the Canvas. Performs actions needed when the Font for the control has been changed.

FontChanged is an overridden method in TCustomControl used to perform actions needed when the Font for the control has been changed. It is the routine used as the OnChange event handler for the Font property, and is assigned in the inherited constructor for the class instance.

Sender contains the object instance for the event notification, and is provided to maintain compatibility with the TNotifyEvent signature for the event handler. It is not used in TGraphicControl, but is passed as an argument to the inherited method.

FontChanged ensures that the new value for the Font property is also applied to the Canvas for the control. This includes the PixelsPerInch setting for the Font. FontChanged calls the inherited method prior to exit.

TFont.PixelsPerInch
Object instance (TControl) for the event notification. Sets the value for the Color property

SetColor is an overridden method in TCustomControl used to set the value in the Color property. It calls the inherited method on entry, and applies the new color value to the Brush in the control Canvas.

TControl.Color TWinControl.SetColor
New value for the Color property. Implements the default handler used to draw the control.

Paint is a method which causes the control to be drawn using the drawing mechanism for the control. In TCustomControl, like TGraphicControl, the OnPaint event handler is used (when assigned). Assign a routine to the OnPaint handler to perform the drawing operations needed for the control.

Paint called from the PaintWindow method, and occurs when a LM_PAINT message is handled for the control.

Constructor for the class instance.

Create is the overridden constructor for the class instance, and calls the inherited constructor on entry. Create allocates resources for the TControlCanvas instance used in the Canvas property.

Owner for the class instance. Destructor for the class instance.

Destroy is the overridden destructor for the class instance.

It calls RemoveFocus to prevent the Parent control from giving focus to the free control. It destroys the Handle for the control, and ensures that the control is removed as a Parent or DockSite for its child controls. It does not free the child controls; they are freed by their owner.

Controls in the DockClient property are updated to remove the class instance from the HostDockSite property in the docking clients.

Destroy frees resource allocated in the constructor, and calls the inherited method prior to exit.

The drawing surface for the control.

Canvas is a TCanvas property which contains the drawing surface for the control. Resources for the property are allocated in the constructor for the class instance. A TControlCanvas descendant is created and assigned to the member for the property. The Handle for the Canvas is updated when PaintWindow is called for a specific device context.

Changing values in the Font or Color properties causes settings in Canvas to be updated. A new value assigned to Font is also assigned to the Canvas in the control, and includes the PixelsPerInch setting for the Font. A new value assigned to Color is applied to the Brush in Canvas. A value assigned to BorderStyle must be handled in the routine assigned to the OnPaint event handler.

TCanvas
Event handler signalled to paint the control.

OnPaint is a TNotifyEvent property with the event handler signalled to draw the control on its Canvas. An object procedure which draws all aspects of the control must be implemented and assigned to the property.

The Sender argument provides access to properties and methods for the control instance. It must be cast to a TCustomControl to access members for the class type.

Use Canvas to render the control in the event handler. The values from Font and Color are already applied to the corresponding properties in Canvas. The BorderStyle property must be applied in code for the handler.

OnPaint is signalled from the Paint method.

For the macOS Carbon widgetset, drawing on the Canvas outside of the OnPaint event handler is not supported. Drawing directly to a screen device context is also not supported.
Implements a multi-resolution container for images used in an application.

TImageList is a TDragImageList descendant, and sets the visibility for properties in ancestor classes (like TCustomImageList). As a TDragImageList descendant, it provides support for using images in the list during drag-and-drop or drag-and-dock operations. Most of the features and functionality for the list are inherited from the TCustomImageList class.

TCustomImageList
Implements the abstract ancestor class used to get the property list for a control. Parses the values from SessionProperties in the Root component into the given list. TStrings instance where the component/property names and values are stored. Represents a node in a TDockTree

It encapsulates a dock zone, containing either other zones or a single control.

This implementation is specific to . Another DockManager can (and should) use its own class instead.

Gets the value for the Height property. Value for the Height property. Gets the value for the Left property. Gets the value for the Left property. Gets the value for the LimitBegin property. Value for the LimitBegin property. Gets the value for the LimitSize property. Value for the LimitSize property. Gets the value for the Top property. Value for the Top property. Gets the value for the Visible property. Value for the Visible property. Gets the value for the VisibleChildCount property. Value for the VisibleChildCount property. Gets the value for the Width property. Value for the Width property. Sets the value for the LimitBegin property. New value for the LimitBegin property. New value for the LimitSize property. New value for the LimitSize property. Sets the value for the Height property. New value for the Height property. Sets the value for the Left property. New value for the Left property. Sets the value for the Top property. New value for the Top property. Sets the value for the Width property. New value for the Width property. Constructor for the class instance.

Stores values passed in the TheTree and TheChild arguments to the Tree and ChildControl property. Sets the initial bounds for the dock zone to an empty rectangle. This causes the Top, Left, Width, and Height properties to contain 0 (zero).

The dock tree to which this zone belongs. The control in this zone (or Nil when unassigned). Returns the dock zone containing the given control. The zone containing AControl as ChildControl. Control to locate in the dock tree. The first visible child zone. The next visible zone. The zone, or Nil if none found. The next visible zone. The preceding visible zone. Inserts NewZone as preceding or following sibling. The zone to add. How to add the zone. Adds the given zone as the first child. The zone to add. Adds the given zone as the last child. The zone to add. Replace the OldChild zone by NewChild. The zone to unlink. The zone to link in place of OldChild. The last child zone. Calculates the index of the zone within its parent zone. Unlinks the given child zone. The control docked in this zone. A zone can contain nothing, a control, or child zones. The number of child zones. The first child zone. The height of the zone. The left coordinate of the zone. The free coordinate of the DockZone (Left or Top). The free size of the DockZone (Width or Height). Whether docking is oriented vertically, horizontally, in pages, or not at all.
  • doNoOrient: zone contains a TControl and no child zones.
  • doHorizontal: zone's children are stacked top-to-bottom.
  • doVertical: zone's children are arranged left-to-right.
  • doPages: zone's children are pages arranged left-to-right.
The parent zone in the DockTree. The top coordinate for the dock zone. The dock tree of which this dock zone is a part. A zone is visible if it contains a visible control, or if any child zone is visible. The number of visible child zones. The width of this zone. The next sibling zone. The preceding sibling zone. Class of The type for a ForEachZone callback procedure, currently unused. The iterated zone. Represents flag values used in TDockTree. Set type used to store values from the TDockTreeFlag enumeration. A tree of TDockZone instances where each docked window has one tree.

TDockTree is a TDockManager descendant with a simple docking manager that allows docking a control into another using Align=alClient to fill the whole client area.

In this class, Docking means: Combining several windows into one. And, a window can be a TCustomForm instance, a floating (undocked) control, or a TDockForm instance. A window can be docked to another to the left, right, top, bottom, or "into". The source docking window will be resized to fit to the target docking window.

A docking manager supporting multiple controls per docksite (aka a layout) can be found in the ldocktree.pas unit.

TAnchorDockManager which supports multiple controls with a more flexible layout, store and restore, and more options can be found in the anchordocking package.

TLazDockTree
The width of the border around a dock zone. Destroys the dock zone and its child zones. Returns the control and the part of the dockzone at the given coordinates. The docked control. The client coordinates. Returns the zone part at MousePos. Paints the dock header of the zone containing AControl. Updates the internal TDockTreeFlags to reflect the update status for the control

UpdateAll is a procedure used to update the internal TDockTreeFlags member to reflect the current update status for the control. UpdateAll checks an internal counter, incremented in BeginUpdate, to see if dtfUpdateAllNeeded needs to be included in or excluded from the set of flag values. It is included when the update count is greater than 0 (zero). Otherwise, it is excluded from the set.

UpdateAll is called from the EndUpdate method.

Constructor for the class instance.

Create is the overridden constructor for the class instance. TheDockSite contains the windowed control handled in the docking tree. Create calls the inherited constructor using TheDockSite as the owner for the class instance.

Creates allocates resources needed for the RootZone property, and sets the value for its border width to 4.

The window control to be managed. Destructor for the class instance.

Frees resources allocated to the RootZone property, and calls the inherited destructor.

Starts an update process for the class instance.

BeginUpdate is an overridden method in TDockTree. It increments the internal update counter for the class. It is used to consolidate calls to the UpdateAll method until the internal counter reaches zero (0).

Finishes an update process for the class instance.

EndUpdate is an overridden method in TDockTree. BeginUpdate and EndUpdate are used to consolidate calls to the UpdateAll method. EndUpdate decrements the internal update counter, and when it reaches zero (0) calls UpdateAll to remove dtfUpdateAllNeeded from the docking tree flags.

Adjusts the zone rectangle for AControl.

ARect initially describes the dockzone into which the control is docked. From that area the zone decoration is excluded, so that ARect describes the area reserved for the docked control.

AdjustDockRect is not part of the general docking model. It can implemented and used for any purpose in a dock tree manager. Most docking managers will replace it by a method with more arguments, that allow to identify the zone and its properties immediately.

Positions DropCtl relative Control, using the alignment specified by InsertAt.

InsertControl determines the layout and appearance of the just docked control, forcing a repaint of the container control if necessary.

When SetReplacingControl has been called with a non-Nil Control before, the dropped control only should replace that control.

A tree docking manager organizes the docksite into layers of horizontal or vertical orientation. As long as no more than one control is docked into a docksite, the tree has no orientation at all. The second docked control determines the orientation of the docksite and the dock tree. All further drops are either isogonal (in direction of the zone orientation) or orthogonal (opposite to the zone orientation). On an isogonal drop a new leaf zone is created for the dropped control, as a sibling of the already existing child zones. On an orthogonal drop the zone containing the DropControl becomes the root of another subtree, whose initial members are the leaf zones for Control and DropCtl.

One value of InsertAt (alCustom) is reserved for notebook docking, where DropCtl is replaced by a tabbed notebook, and Control and DropCtl are moved into pages of the notebook. The notebook is a docksite of its own, further drops into the notebook are handled by the notebook itself, the DockManager of the host docksite is not involved.

The control beneath which to place DropControl. How to insert DropControl. The control to add. Has an empty implementation in TDockTree. Has an empty implementation in TDockTree. Stores the layout in a file. The class type for the dock zones in this tree. The parent control whose docked clients are managed. The root zone for the DockTree. Class type used to create new splitter class instances.

Normally contains a reference to the TSplitter class, as assigned in the initialization section for the extctrls.pp unit.

TSplitter
Provides access to properties of the Mouse.

Contains information about the current mouse position, whether messages are captured by a window, whether it is dragging an object, and how far the mouse must move before a control starts dragging. TMouse is the type used for the Mouse global unit variable.

Handle for the control with mouse capture.

Capture is a HWND property which contains the handle for the control which has the mouse capture. Its value is read from the LCL interface (and ultimately the widgetset class instance).

Setting a new value for the property causes either SetCapture or ReleaseCapture to be called in the LCL interface (or widgetset class instance). When set to 0 (the unassigned handle value), ReleaseCapture is called. Otherwise, SetCapture is called to assign the new handle value to the widget.

For the macOS Carbon widgetset, release capture is not supported.
The screen position for the mouse cursor.

CursorPos is a TPoint property which contains the screen coordinates where the mouse pointer is located. The X and Y members in the TPoint type contain the horizontal and vertical screen coordinates, respectively, and are read from and written to the widgetset class instance.

When reading values in the property, the X and Y members may return 0 if the widgetset is unable to return a TPoint instance.

For the macOS Carbon widgetset, changing the values in CursorPos does not triggering OnMoveMove events in a form or control.
True while dragging an object. The number of lines to scroll with every notch or unit on the mouse wheel Does dragging start immediately (True), or only after a mouse move? The minimum distance the mouse must move before dragging starts (in delayed mode)

The default value is 5 (pixels).

Array with sets of anchors used for a given alignment option.

AnchorAlign is an array constant that contains elements with TAnchors set values. Values in AnchorAlign are indexed by TAlign enumeration values. This allows the TAlign value to retrieve the set of Anchors used for the specified align option.

For example:

AControl.Align := AnchorAlign[alRight]; // contains [akRight, akTop, akBottom]
Used in the AnchorDocking package for the Lazarus IDE. Used in the AnchorDocking package for the Lazarus IDE. Used in the AnchorDocking package for the Lazarus IDE.

Used in the ldocktree unit and in the TControl.AnchorToNeighbour method.

Not used in the current LCL version. Gets the drag target at the specified screen position.

Disabled controls should be excluded, but are not due to an bug in FindControlAtPosition.

The control at Position; Nil if none. The screen position. Also finds disabled controls, if True. Gets the control at the specified screen position.

FindControlAtPosition is a TControl function used to get the control at the specified screen position. When AllowDisabled is True, a disabled control can also be located in the routine. In the current implementation, AllowDisabled is ignored (assumed to be True). First a window at the given screen position is searched, then a control within it.

The control found at the specified Position; Nil when not found. The screen position examined in the routine. Finds disabled controls when True. Find the window and its owning control at the given screen coordinates.

FindLCLWindow is a TWinControl function used to find the window (and its owner control) at the specified screen coordinates.

FindLCLWindow gets the Handle for the window and checks to ensure it is enabled. When it is not enabled, or AllowDisabled is False, parent handles are examined until a suitable window is located. FindOwnerControl is called for the handle to get the return value. The return value is Nil if a Window was not found at the specified position.

The control that owns the window at the specified screen position; Nil when a window is not found. TPoint with the screen coordinates examined in the routine. Allows a disabled window to be returned. Return the TWinControl for the given Handle.

The result is very interface specific; use FindOwnerControl when Handle may be a non-TWinControl handle. Handle can also be a child handle, and does not need to be the Handle property of the Result.

Important: In most cases, Result.Handle and the Handle parameter value are not the same.

GetProp
TWinControl with the specified handle, or Nil if the handle is not found. Handle for the control (or child control) used to locate the control in the return value. Returns the TWinControl for the given Handle; the parent control for a non-TWinControl Handle.

Handle can also be a child handle (of a TControl), in which case the returned control is the parent of the desired control. Parent, not Owner as suggested by the function name!

The function recursively tries GetParent(Handle), so the result depends on the implementation (meaning) of a parent handle.
Returns the TControl currently visible at the specified screen position.

The result is not reliable during resizing.

Control visible at the specified screen coordinates. The active windowed control (or form) is returned if a control is not found at the specified position. TPoint instance with the screen coordinates for the control located in the method. Moves the origin for a windowed control.

MoveWindowOrg is a procedure used to move the origin for a windowed control to the specified position. dc contains the device context for the Window handle used in the routine. X and Y contain the new coordinates in pixels used as the origin (Left and Top respectively) for canvas drawing operations.

Device context updated in the routine. Left coordinate for the new window origin. Top coordinate for the new window origin. Creates (or recreates) the widgetset class instance for a TWinControl.

This function was originally a member of TWinControl.

From a VCL point of view, that made perfectly sense since the VCL knows when a Win32 widget has to be recreated when properties have changed.

The LCL, however, does not know when properties values are changed. But the widgetset does. To avoid the old VCL behavior, and to provide a central function for use in the widgetset, it has been moved here.

The default class used to create a DockManager in . Cancels an active drag operation.

CancelDrag is a procedure used to cancel an active drag operation. CancelDrag calls the DragStop method in the currently active DragManager.

No actions are performed in the routine when DragManager has not been assigned (contains Nil), or when DragManager returns False from its IsDragging method.
Set the mouse capture to the specified control, or one of its children, at the given coordinates.

SetCaptureControl is an overloaded procedure in controls.pp. It ensures that the CaptureControl variable maintained in the LCL is updated when an control receives or loses the mouse input focus.

The overloaded variants allow the new mouse capture control to be specified as either a TControl or a TWinControl instance. No actions are performed in the routine if the specified control is already the CaptureControl.

If the new capture control is unassigned (Nil), the value in CaptureControl is cleared and the ReleaseCapture routine is called. No additional actions are performed in the routine.

Otherwise, the control class is used to determine the actions needed. For a TWinControl instance, the ControlAtPos method is called determine if a child control is active at the specified position and the new capture control. For a TControl instance, which does not have a handle, the Parent control is used as the new capture control.

ReleaseCapture is called to remove mouse capture for the previous control. The SetCapture routine in the LCL interface is called to change the mouse capture to the control with the specified handle.

Use GetCaptureControl to retrieve the control which currently has the mouse capture.

TControl instance (or Nil) representing the control for the mouse capture. TWinControl instance (or Nil) representing the windowed control for the mouse capture. TPoint instance with the coordinates for the mouse input. Returns the TControl instance with mouse capture enabled.

Please note: For the interface, only a Handle for TWinControl can capture the mouse. The LCL extends this to allow TControl to capture the mouse.

The control with the mouse capture, or Nil when a capture control is not set for the widgetset class. Used in SynEdit. NewStyleControls is a Boolean variable. Currently used only by SynEdit in synedit.pp. The global TMouse instance for the unit.

Mouse is a TMouse variable with the singleton used to access mouse information in the application. This includes the handle for the capture control, the current pointer position, as well as drag and scroll settings used in an application.

The class instance is created in the initialization section for the unit, and freed in the finalization section.

Returns a string with the name for the cursor in the integer constant.

Calls CursorToIdent to find correct entry in look-up table.

Returns a string with the name of the cursor type corresponding to the integer constant, or a value like '%-31' when Cursor is not found in the look-up table. Numeric constant from the TCursor range converted to a string in the routine. StringToCursor - returns the cursor value corresponding to the name supplied.

StringToCursor - returns the cursor value corresponding to the name supplied.

Finds the numeric cursor value corresponding to the name S in the cursor look-up table.

The numeric cursor value from the look-up table. The name of the cursor for which the numeric value is sought. Calls the specified procedure for each of the cursor identifiers. String procedure called in the routine. Uses a look-up table to find the cursor identifier corresponding to an Integer cursor constant.

CursorToIdent gets the identifier name for a cursor shape specified as an Integer value. Cursor contains one of the Integer constants which represent a value in the TCursor type. Ident is the String with the identifier name for the cursor shape.

For example:

// var CursorName: String; IsOk: Boolean; CursorName := ''; IsOk := CursorToIdent(crHourGlass, CursorName); // CursorName returns 'crHourGlass'

CursorToIdent calls the IntToIdent routine in the RTL Classes unit to get both the return value and the value for the Ident argument. The CursorIdents implementation constant is used as the mapping table for the integer and string values.

If Cursor is not found in the CursorIdents constant, the return value is False. If the numeric constant is not found in the look-up table, the value in Ident is not specified (or changed).

Use IdentToCursor or StringToCursor to convert the identifier name value back to an Integer value.

CursorToIdent is used in the implementation of the CursorToString routine.

IntToIdent
Returns True if a valid identifier is found in the look-up table. Integer constant for the cursor shape (like crHourGlass). Returns the string with the identifier name for the specified cursor shape (like 'crHourGlass'). Converts an identifier name for a cursor shape to its value as an Integer.

IdentToCursor converts the identifier name for a cursor shape to its Integer equivalent.

Ident contains the name for the cursor shape. The Cursor argument contains the TCursor value for the specified identifier name.

The return value is True if Ident is found in the CursorIdents look-up table. The value in Cursor is unspecified (and unchanged) when the return value is False.

For example:

// var CursorVal: Integer; IsOk: Boolean; CursorVal := crDefault; IsOk := IdentToCursor('crHourGlass', CursorVal); // CursorVal contains the crHourGlass constant

IdenttoCursor calls the IdentToInt routine in the RTL Classes unit to get both the return value and the value for the Cursor argument.

Use CursorToString or InttoIdent routines to return the Integer value to its string representation.

IntToIdent IdentToInt
Returns True if a valid entry was found for the identifier name in the look-up table. The identifier name for the cursor shape, like 'crHourGlass'. The numeric value of the named cursor, like crHourGlass. Checks whether the handle for a windowed control (or a parent control) is transparent.

CheckTransparentWindow is procedure used to check whether the handle for a windowed control (or a parent control) is transparent. CheckTransparentWindow uses the current mouse position to locate controls or forms under the mouse rectangle. The LM_NCHITTEST message is performed for AWinControl to determine if the handle is drawn transparently. Additional Forms in the Z-Order are visited until an opaque windowed control is located. Parent controls are searched too (when needed).

CheckTransparentWindow updates the values in Handle and AWinControl to reflect the results from the search. When an overlayed control is not located, the value in Handle is set to 0, and AWinControl is set to Nil.

Handle for the control (or parent) found for the specified windowed control. Handle for the windowed control examined in the routine. Checks for mouse click events for the specified control.

CheckMouseButtonDownUp is a Cardinal function used to check for mouse down or up events for the control represented by the handle in AWinHandle. The return value contains the Word value used in the Msg member in a TLMMouse mouse message.

LastMouse contains the most recent mouse event information examined and potentially updated in the method.

CheckMouseButtonDownUp consolidates mouse down events (single, double, triple, and quadruple) into a single value used in a mouse message, and updates LastMouse when needed.

AWinControl contains the control with the handle where the event mouse events occurred.

At run-time, multi-click events are adjusted to the ControlStyle specified in the control (or one of its children) including:

  • csDoubleClicks
  • csTripleClicks
  • csQuadClicks

If the target control does not allow one of the multi-click events, the click count in LastMouse is updated accordingly.

At design-time, only Single and Double click mouse events are handled.

CheckMouseButtonDownUp is used in the callback routine for a widgetset class when a mouse event message is created and passed to the class instance.

Value used as the Msg member in a mouse message. Handle for the control where the mouse events were detected. Control with the specified handle. Mouse information for the mouse event examined in the routine. Position where the last mouse event occurred. Mouse button for the last mouse event. True if the mouse event is a mouse down event. False for a mouse up event. Gets a set of state values for current modifier keys.

GetKeyShiftState is a TShiftState function used to get a set with the current state values for modifier keys. GetKeyShiftState calls GetKeyState to capture the values in the set for the following virtual keyboard keys:

VK_CONTROL
Includes ssCtrl when the Control key is pressed
VK_SHIFT
Includes ssShift when the Control key is pressed
VK_MENU
Includes ssAlt when the Alt key is pressed
VK_LWIN or VK_RWIN
Includes ssMeta when one of the WIN keys (or Alt+GR on Mac) is pressed

The return value is an empty set ([]) when none of the virtual keys have a non-zero value.

Set of Shift state values active for the virtual keys, or an empty set when none of the keys are active. Adjusts the border space around the control to the client rectangle.

AdjustBorderSpace is an overloaded routine used to determine the space reserved for borders on the corresponding edges of a control. AdjustBorderSpace is called from methods in a widgetset class when the its bounds and constraints are realized and child controls are aligned to the new dimensions.

The overloaded variants allow the border spaces to be specified as individual Integer values or passed in a TRect instance.

TRect instance with the unused client area in a control. TRect instance with the space reserved for borders on the corresponding edges of a control. Space reserved on the left edge of the client area. Space reserved on the top edge of the client area. Space reserved on the right edge of the client area. Space reserved on the bottom edge of the client area. TRect instance with the border space reserved on the corresponding edges of a control. Determines if the color for the control is the system default (GTK).

Used by GTK-based widgetset classes to determine if the color in a control needs to be compared to the SYS_COLOR_BASE value used in the widgetset.

True if the specified control does not have an explicit value other than the default color value ($80000000). Control with the color value examined in the routine. Gets the inverse alignment value when BiDiMode is enabled.

Applies to TAlignment value taLeftJustify and taRightJustify. taCenter is always taCenter regardless of BidiMode.

TAlignment value adjusted for the BidiAlignment in Flip. TAlignment value converted in the method. True to flip the alignment value when BiDiMode is enabled. Swaps left and right anchor side settings for the specified control when BiDiMode is enabled. Set of TAnchor values for the control after the value in Flip has been applied. Control with the anchors adjusted in the routine. True to flip the anchor values when BiDiMode is enabled. Flips the left and right coordinates in a rectangle and makes it relative to the ParentRect when Flip is True.

No actions are performed in the routine if Flip is set to False (the default value).

TCustomGrid.FlipRect TCustomColorBox.DrawItem
TRect instance with the converted / adjusted Left and Right coordinates calculated in the routine. TRect instance with the original Left and Right values potentially modified in the routine. TRect instance with the parent coordinates where the values in Rect are located. True to flip the left and right values when BiDiMode is enabled. Flips the value Alignment to reflect the value needed for BiDi mode. TAlignment value updated in the method. Converts items of several data types into strings, for debug output. [The parameters should have unique names, for every type] The string representing the given parameter(s). TAlign value converted in the routine. Set of TAnchorKind values converted in the routine. Anchor side enumeration value converted in the routine. Auto-size phase converted in the routine. All elements in this set will be shown as a comma-separated list. Control style flag converted in the routine. Set of control style flags converted in the routine. Form style value converted in the routine. Declares an assignment operator used to convert a Variant type to a TCaption type.

Declares an assignment operator used to convert a TVariant value to a TCaption value during assignment. Casts the value in AVariant to a String type and assigns it as the return value for the operator. For example:

var AVariant: Variant; AControl: TControl; // ... AControl.Caption := AVariant;
TCaption value for the assignment operator. Variant value converted to a TCaption value prior to assignment. Compares the specified pointers containing a Lazarus accessibility object and a accessibility object data. Compares the specified pointers containing Lazarus accessibility object data and a accessibility object. Register the components provided by this unit or package, so that they can be instantiated.

Register is a procedure used to register components in this unit in the Lazarus IDE. Register adds the TImageList component on the Common Controls tab. In addition, the TCustomControl and TGraphicControl components are registered without icons.

Register can also be used to register the controls required by an application.

RegisterComponents
AutoSize - boolean property that permits the size of a control to be adjusted automatically.

AutoSize is a boolean property found in many classes; it permits the size of a control to be adjusted automatically to accommodate differences in the text or graphic contained therein, and allows most efficient use of available space

Many controls call TControl.DoAutoSize to perform the actual auto-sizing.

IMPORTANT: Many Delphi controls override this method and many call this method directly after setting some properties.

During handle creation not all interfaces can create complete Device Contexts which are needed to calculate things like text size.

That's why you should always call AdjustSize instead of DoAutoSize.

TControl.AdjustSize calls DoAutoSize in a smart fashion.

During loading and handle creation the calls are delayed.

This method is essentially the same as TWinControl.DoAutoSize. But since DoAutoSize is commonly overridden in descendent components, it is not useful to perform all tests, which can result in too much overhead. To reduce the overhead, the LCL calls AdjustSize instead.

When setting AutoSize to True, the LCL auto-sizes the width and height for the control. This is one of the most complex parts of the LCL, because the result depends on nearly a hundred properties. Let's start with a simple scenario:

The LCL will only auto-size the Width or Height if it is free to resize. In other words, the width is not auto-sized if:

  • The left and right side is anchored. You can anchor the sides with the Anchors property or by setting the Align property to alTop, alBottom or alClient
  • The Width and Height are bound by the Constraints properties. The Constraints can also be overridden by the widgetset. For example the WinAPI does not allow resizing the height of a combo-box. And the gtk widgetset does not allow resizing the width of a vertical scrollbar.

The new size is calculated by the protected method TControl.CalculatePreferredSize. This method asks the widgetset for an appropriate Width and Height. For example a TButton has preferred Width and Height. A TComboBox has only a preferred Height. The preferred Width is returned as 0 and so the LCL does not auto-size the Width - it keeps the width unaltered. Finally a TMemo has no preferred Width or Height. Therefore AutoSize has no effect on a TMemo.

Some controls override this method. For example the TGraphicControl descendants like TLabel have no window handle and so cannot query the widgetset. They must calculate their preferred Width and Height themselves.

The widgetsets must override the GetPreferredSize method for each widget class that has a preferred size (Width or Height or both).

Parent.AutoSize

The above described the simple explanation. The real algorithm provides far more possibilities and is therefore far more complex.

Properties / Methods

Left and Top

If Parent is not Nil then Left, Top are the pixel distance to the top, left pixel of the parent's client area (not scrolled). Remember the client area is always without the frame and scrollbars of the parent. For Delphi users, some VCL controls like TGroupbox define the client area as the whole control including the frame. Others do not. The LCL is more consistent, and therefore Delphi incompatible. Left and Top can be negative or bigger than the client area. Some widgetsets define a minimum, and maximum somewhere around 10,000 pixels or more.

When the client area is scrolled the Left and Top are kept unchanged.

During resizing, or when moving, the Left and Top coordinates are not always in sync with the coordinates for the Handle object.

When Parent is unassigned (contains Nil), Left and Top depend on the widgetset and the window manager. Until Lazarus 0.9.25, this is typically the screen coordinate of the left, top of the client area for the form. This is Delphi incompatible. It is planned to change this to the Left, Top of the window.

Hint:

Each time you change Left and Top, the LCL starts the movement instantly. If you want to change both Left and Top, use the following instead:

with Button1 do SetBounds(NewLeft,NewTop,Width,Height);

Width and Height

The Size in pixels must not be negative; most widgetsets do not allow Width and/or Height to be Zero (0). Some controls (on some platforms )define a larger minimum constraint. Instead of sizing a control to Width=0 and/or Height=0, set Visible to False. During resizing and moving, Width and Height are not always in sync with the size of the Handle object.

BoundsRect

Same as Bounds(Left,Top,Width,Height).

Common newbie mistake:

BoundsRect.Left:=3; // WRONG: common newbie mistake

This has no effect, because reading BoundsRect is a function. It creates a temporary TRect on the stack.

ClientRect

Left and Top are always 0,0. Width and Height are the visible size in pixels of the client area. Remember the client area is without the frame and without scrollbars. In a scrollable client area the logical client area can be bigger than the visible.

ClientOrigin

Returns the screen coordinate of the top left coordinate 0,0 of the client area. Note that this value is the position as stored in the interface and is not always in sync with the LCL. When a control is moved, the LCL sets the bounds to the desired position and sends a move message to the interface. It is up to the interface to handle moves instantly or queued.

LCLIntf.GetClientBounds

Returns the client bounds of a control. Like ClientRect, but Left and Top are the pixel distances to the control's left, top. For example on a TGroupBox the Left, Top are the width and height of the left and top frame border. Scrolling has no effect on GetClientBounds.

LCLIntf.GetWindowRect

After the call, ARect will be the control area in screen coordinates. That means, Left and Top will be the screen coordinate of the TopLeft pixel of the Handle object and Right and Bottom will be the screen coordinate of the BottomRight pixel.

FBaseBoundsLock: integer

Increased/Decreased by LockBaseBounds/UnlockBaseBounds. Used to keep FBaseBounds during SetBounds calls.

FBaseParentClientSize: TPoint

The Parent.ClientRect size valid for the FBaseBounds. FBaseBounds and FBaseParentClientSize are used to calculate the distance for akRight (akBottom). When the parent is resized, the LCL knows what distance to keep.

FBoundsRectForNewParent: TRect

When changing the Parent of a control the Handle is recreated and many things can happen. Especially for docking forms the process is too unreliable. Therefore the BoundsRect is saved. The VCL uses a similar mechanism.

FLastDoChangeBounds: TRect

Used to avoid calling OnChangeBounds with the same coordinates. This reduces user defined auto-sizing.

FLastResizeClientHeight: integer
FLastResizeClientWidth: integer
FLastResizeHeight: integer
FLastResizeWidth: integer

Used to avoid calling OnResize with the same coordinates. This reduces user defined auto-sizing.

FLoadedClientSize: TPoint

During loading many things are delayed and many things are set and worse: in the wrong order. That's why SetClientWidth/SetClientHeight calls are stored and set at end of loading again. This way the LCL can restore the distances (e.g. akRight) used during designing.

FReadBounds: TRect

Same as FLoadedClientSize, but for SetLeft, SetTop, SetWidth, SetHeight.

SetBoundsRectForNewParent(const AValue: TRect);

Used to set FBoundsRectForNewParent. See above.

procedure SetInitialBounds(aLeft, aTop, aWidth, aHeight: integer); virtual;

A smart version of SetBounds, reducing overhead during creation and loading.

procedure UpdateBaseBounds(StoreBounds, StoreParentClientSize, UseLoadedValues: boolean); virtual;

Commit current bounds to base bounds.

procedure SetClientHeight(Value: Integer);
procedure SetClientSize(Value: TPoint);
procedure SetClientWidth(Value: Integer);

Exists for Delphi compatibility too. Resizes the control, to get the wanted ClientRect size.

procedure ChangeBounds(ALeft, ATop, AWidth, AHeight: integer); virtual;

This is the internal SetBounds. Applies constraints, updates base bounds, calls OnChangeBound, OnResize, locks bounds.

procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); virtual;

This really sets the FLeft, FTop, FWidth, FHeight private variables.

procedure SetBounds(aLeft, aTop, aWidth, aHeight: integer); virtual;

This is the standard procedure overridden by many Delphi controls. TWinControl overrides it too. Ignores calls when bounds are locked; lock the FBoundsRealized to avoid overhead to the interface during auto sizing. ChangeBounds is not locked this way.

Function GetClientOrigin: TPoint; virtual;

Screen coordinate of Left, Top of client area.

Function GetClientRect: TRect; virtual;

Size of client area. (always Left=0, Top=0)

Function GetScrolledClientRect: TRect; virtual;

Visible client area in ClientRect.

function GetChildsRect(Scrolled: boolean): TRect; virtual;

Returns the Client rectangle relative to the control's Left, Top. If Scrolled is True, the rectangle is moved by the current scrolling values (for an example see TScrollingWincontrol).

function GetClientScrollOffset: TPoint; virtual;

Returns the scrolling offset of the client area.

function GetControlOrigin: TPoint; virtual;

Returns the screen coordinate of the topleft coordinate 0,0 of the control area. (The topleft pixel of the control on the screen) Note that this value is the position as stored in the interface and is not always in sync with the LCL. When a control is moved, the LCL sets the bounds to the wanted position and sends a move message to the interface. It is up to the interface to handle moves instantly or queued.

The coordinates of a control can be specified or retrieved in various ways

The following description applies to members of TControl and TWinControl.

Every control has an origin (Top, Left) and extent (Width, Height). The origin is relative to its Parent control (client coordinates) or, for floating controls (forms) with Parent=Nil, relative to the screen.

The BoundsRect describes the TopLeft and BottomRight coordinates of the control, relative to its Parent.

The BoundsRectForNewParent holds the new coordinates, to be used when the Parent of the control is changed later.

The ClientRect describes the internal (client) area of a container control (TWinControl), excluding borders. Its Top and Left are always zero. In a TScrollingWinControl...

BaseBounds holds the designed Bounds, to be used e.g. when a scale factor is set later.

GetControlOrigin returns the origin in screen coordinates. These values are not always in sync with the True screen position, managed by the widgetset.

ScreenToClient returns the client coordinates of an point given in the screen coordinates, i.e. the coordinates relative to the control's client origin.

ClientToScreen returns the screen coordinates for an point in client coordinates.

How multiple controls can be aligned and resized together, at run-time.

The tree-style layout of a form allows one to specify table-style areas, with a common width or height of all controls in the same area (using container controls like e.g. TPanel).

Delphi introduced control anchoring to the sides of the Parent control. This means when a control in a form has Anchors[akRight]=True, its right side keeps its distance from the right side of its Parent, when its Parent is resized.

The default anchors [akLeft,akTop] keep every control anchored to the origin (TopLeft) of their Parent control (of form). This will cause controls to disappear when the form is shrunken, or the user has to scroll through the form's client area.

When a control shall e.g. use the available space, left over to its right, Anchors=[akLeft,akRight] will result in a variable-width control.

The Align property allows one to stack controls at their Parent's sides, e.g. all controls with Align=alTop are stacked at the top of their Parent. The remaining space in the Parent can be occupied by a single control, of Align=alClient.

Both Anchors and Align are tightly coupled, changing one property will affect the other one. This is harmless in so far, as the IDE (form designer) keeps all adjustments in sync, free of conflicts.

Some people found this approved layout method too restrictive, and too complicated to use, and now LCL controls also can be anchored freely to each other. This layout management is traditionally referred to as "Anchor Docking", even if it is not related to docking at all.

This freedom requires that the GUI designer is responsible for consistent anchor specifications, which do not result in unresolvable cyclic references or other contradictions.

Anchor docking allows one to anchor every side of a control to an arbitrary side of another control, i.e. the left side of an Edit control can be anchored to the right side of its associated Label.

Example1

If you want to have the top of B the same as the top of C:

+-----+  +-----+
|  B  |  |  C  |
|     |  +-----+
+-----+

use:

B.AnchorSide[akTop].Control:=C; B.AnchorSide[akTop].Side:=asrTop;

When you want to have a gap between both controls, set e.g. B.Borderspacing.Right to the desired amount. Setting C.Borderspacing.Left will have the same effect, and both can be used together; the resulting gap then reflects the maximum value of both properties.

BorderSpacing is in effect even for controls without special anchoring, when AutoSize is used.

Anchor docking also allows one to center a control relative to another control.

Example2

For centering A relative to B:

+-------+
|       | +---+
|   B   | | A |
|       | +---+
+-------+

use:

A.AnchorSide[akTop].Side:=asrCenter; A.AnchorSide[akTop].Control:=B;

Or use this equivalent:

A.AnchorSide[akBottom].Side:=asrCenter; A.AnchorSide[akBottom].Control:=B;

TControlChildSizing and TControlChildrenLayout offers additional means for aligning and separating controls.