[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Controls' (#lcl)

TControl

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The base class for visible controls.

Declaration

Source position: controls.pp line 1122

type TControl = class(TLCLComponent)

protected

  FAccessibleObject: TLazAccessibleObject;

  

Member with the accessibility object for the control.

  FControlState: TControlState;

  

Member with the value for the ControlState property.

  FCursor: TCursor;

  

Member with the value for the Cursor property.

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

  function GetCursor; virtual;

  

Gets the value for the Cursor property.

  procedure SetCursor(); virtual;

  

Sets the value for the Cursor property.

  procedure SetVisible(); virtual;

  

Sets the value for the Visible property.

  procedure DoOnParentHandleDestruction; virtual;

  

Performs actions needed when the handle for the parent control is freed.

  procedure DoAutoSize; virtual;

  

For internal use only; call AdjustSize instead.

  procedure DoAllAutoSize; virtual;

  

Resizes and aligns the control and all of it children.

  procedure BeginAutoSizing;

  

Sets AutoSizing to True; used to prevent loops.

  procedure EndAutoSizing;

  

End of the auto-sizing process, resets AutoSizing to False.

  procedure AnchorSideChanged(); virtual;

  

Request further processing after an anchor side was changed.

  procedure ForeignAnchorSideChanged(); virtual;

  

Requests further processing after an anchor side has changed, that anchors another control to this one.

  procedure SetAlign(); virtual;

  

Sets the value for the Align property.

  procedure SetAnchors(); virtual;

  

Sets the value for the Anchors property.

  procedure SetAutoSize(); virtual;

  

Sets the value for the AutoSize property.

  procedure BoundsChanged; virtual;

  

Called when the Bounds of the control have been changed; override as required.

  function CreateControlBorderSpacing; virtual;

  

Creates the default BorderSpacing object instance for the class.

  procedure DoConstraintsChange(); virtual;

  

Performs actions needed when value(s) in Constraints have been changed.

  procedure DoBorderSpacingChange(); virtual;

  

Reacts on a change in the control's border spacing.

  function IsBorderSpacingInnerBorderStored; virtual;

  

Checks for a defined (non-zero) value in BorderSpacing.InnerBorder.

  function IsCaptionStored;

  

Implements the storage specifier for the Caption property.

  procedure SendMoveSizeMessages(); virtual;

  

Sends Move and Size messages through the LCL message paths.

  procedure ConstrainedResize(); virtual;

  

Signals the OnConstrainedResize handler.

  procedure CalculatePreferredSize(); virtual;

  

Override this method to return the preferred height and width for the control.

  procedure DoOnResize; virtual;

  

Signals OnResize event handlers for the control.

  procedure DoOnChangeBounds; virtual;

  

Signals OnChangeBounds event handlers for the control.

  procedure CheckOnChangeBounds;

  

Checks for changes and calls DoOnChangeBounds if needed.

  procedure Resize; virtual;

  

Checks for changes and calls DoOnResize if needed.

  procedure RequestAlign; virtual;

  

Smart calling of Parent.AlignControls (very indirectly).

  procedure UpdateAnchorRules;

  

Update the rules for anchoring the control.

  procedure ChangeBounds(); virtual;

  

Sets the bounds (left, top, height, width) optionally the BaseBounds of the control.

  procedure DoSetBounds(); virtual;

  

Internal function to set the control's bounds (Left, Top, Height, Width).

  procedure ScaleConstraints();

  

Scales the minimum and maximum Width and Height.

  procedure ChangeScale(); virtual;

  

Applies scaling (multiplier and divider) to the bounds coordinates, constraints, and Font in a control.

  function CanAutoSize(); virtual;

  

Determines if auto-sizing is possible, and if so, gets the new width and height when enabled.

  procedure SetBiDiMode(); virtual;

  

Sets the value for the BiDiMode property.

  procedure SetParentBiDiMode(); virtual;

  

Sets the value for the ParentBiDiMode property.

  function IsAParentAligning;

  

Determine if a parent control is involved in the alignment process.

  function GetClientOrigin; virtual;

  

Gets the value for the ClientOrigin property.

  function GetClientRect; virtual;

  

Gets the value for the ClientRect property.

  function GetLogicalClientRect; virtual;

  

Logical client area, can be bigger than the visible client area.

  function GetScrolledClientRect; virtual;

  

Get the visible part of the logical client area.

  function GetClientScrollOffset; virtual;

  

Returns the offset of the scrolled client area (in a scrolling TWinControl).

  function GetControlOrigin; virtual;

  

Gets the value for the ControlOrigin property.

  function IsClientHeightStored; virtual;

  

Implements the storage specifier for the ClientHeight property.

  function IsClientWidthStored; virtual;

  

Implements the storage specifier for the ClientWidth property.

  function WidthIsAnchored;

  

True when both the control's left and right side are anchored.

  function HeightIsAnchored;

  

True when both the control's top and bottom side are anchored.

  property AutoSizing: Boolean; [r]

  

True while auto-sizing is in progress.

  property AutoSizingAll: Boolean; [r]

  

Flag to prevent recursive AutoSizing (in DoAllAutoSize).

  property AutoSizingLockCount: Integer; [r]

  

Internal counter, increased/decreased by DisableAutoSizing/EnableAutoSizing.

  procedure WMCancelMode(); message;

  

Handles a LM_CANCELMODE message for the control.

  procedure WMContextMenu(); message;

  

Handles a LM_CONTEXTMENU message for the control.

  procedure WMLButtonDown(); message;

  

Handles a LM_LBUTTONDOWN (left mouse button down) message for the control.

  procedure WMRButtonDown(); message;

  

Handles a LM_RBUTTONDOWN (right mouse button down) message for the control.

  procedure WMMButtonDown(); message;

  

Handles a LM_MBUTTONDOWN (middle mouse button down) message for the control.

  procedure WMXButtonDown(); message;

  

Handles a LM_XBUTTONDOWN (extra mouse button down) message for the control.

  procedure WMLButtonDBLCLK(); message;

  

Message handler for left mouse button double click.

  procedure WMRButtonDBLCLK(); message;

  

Message handler for right mouse button double click.

  procedure WMMButtonDBLCLK(); message;

  

Message handler for middle mouse button double click.

  procedure WMXButtonDBLCLK(); message;

  

Message handler for extra mouse button double click.

  procedure WMLButtonTripleCLK(); message;

  

Message handler for left mouse button triple click.

  procedure WMRButtonTripleCLK(); message;

  

Message handler for right mouse button triple click.

  procedure WMMButtonTripleCLK(); message;

  

Message handler for middle mouse button triple click.

  procedure WMXButtonTripleCLK(); message;

  

Message handler for extra mouse button triple click.

  procedure WMLButtonQuadCLK(); message;

  

Message handler for left mouse button quadruple click.

  procedure WMRButtonQuadCLK(); message;

  

Message handler for right mouse button quadruple click.

  procedure WMMButtonQuadCLK(); message;

  

Message handler for middle mouse button quadruple click.

  procedure WMXButtonQuadCLK(); message;

  

Message handler for extra mouse button quadruple click.

  procedure WMMouseMove(); message;

  

Message handler for mouse moved.

  procedure WMLButtonUp(); message;

  

Message handler for left mouse button going up.

  procedure WMRButtonUp(); message;

  

Message handler for right mouse button going up.

  procedure WMMButtonUp(); message;

  

Message handler for middle mouse button going up.

  procedure WMXButtonUp(); message;

  

Message handler for extra mouse button going up.

  procedure WMMouseWheel(); message;

  

Handles mouse wheel messages for the control.

  procedure WMMouseHWheel(); message;

  

Handles horizontal mouse wheel messages for the control.

  procedure WMMove(); message;

  

Message handler for control moved.

  procedure WMSize(); message;

  

Message handler for changed control size.

  procedure WMWindowPosChanged(); message;

  

Message handler for changed control position.

  procedure CMChanged(); message;

  

Handles CM_CHANGED control messages for the control.

  procedure LMCaptureChanged(); message;

  

Message handler signalled when the mouse capture has been changed.

  procedure CMBiDiModeChanged(); message;

  

Message handler for BiDi mode changed.

  procedure CMSysFontChanged(); message;

  

Message handler for changed system Font.

  procedure CMEnabledChanged(); message;

  

Message handler for changed Enabled state.

  procedure CMHitTest(); message;

  

Message handler for hit test.

  procedure CMMouseEnter(); message;

  

Message handler for mouse entering the control.

  procedure CMMouseLeave(); message;

  

Message handler for mouse leaving the control.

  procedure CMHintShow(); message;

  

Message handler for hint display.

  procedure CMParentBiDiModeChanged(); message;

  

Message handler for parent control's BiDi mode changed.

  procedure CMParentColorChanged(); message;

  

Message handler for changed parent Color.

  procedure CMParentFontChanged(); message;

  

Message handler for changed parent Font.

  procedure CMParentShowHintChanged(); message;

  

Message handler for changed parent ShowHint.

  procedure CMVisibleChanged(); message;

  

Message handler for changed visibility.

  procedure CMTextChanged(); message;

  

Message handler for control's Text changed.

  procedure CMCursorChanged(); message;

  

Handles the CM_CURSORCHANGED message for the control.

  procedure CalculateDockSizes;

  

Saves the docked and undocked extent of the control.

  function CreateFloatingDockSite();

  

Create a floating dock site with a client area equal to the given screen coordinates.

  function GetDockEdge(); virtual;

  

Determine the side to which the dragged control shall be docked.

  function GetDragImages; virtual;

  

Get the list of images usable during dragging.

  function GetFloating; virtual;

  

Determines whether the control is floating.

  function GetFloatingDockSiteClass; virtual;

  

Returns the class for a floating host dock site.

  procedure BeforeDragStart; virtual;

  

Not implemented in TControl.

  procedure BeginAutoDrag; virtual;

  

For internal use: user has started dragging the control.

  procedure DoFloatMsg(); virtual;

  

Handler called when the control starts floating.

  procedure DockTrackNoTarget(); virtual;

  

Adjust the DockRect for floating state (no drop target under the mouse).

  procedure DoDock(); virtual;

  

Adjusts the control's position and extent for the new docksite.

  function DoDragMsg(); virtual;

  

Handler for a drag message, sent by the DragManager to the current target control.

  procedure DoEndDock(); virtual;

  

Invokes the OnEndDock handler.

  procedure DoEndDrag(); virtual;

  

Invokes the OnEndDrag handler.

  procedure DoStartDock(); virtual;

  

Invokes the OnStartDock handler.

  procedure DoStartDrag(); virtual;

  

Invokes the OnStartDrag handler.

  procedure DragCanceled; virtual;

  

Notifies the control of a cancelled drag.

  procedure DragOver(); virtual;

  

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

  procedure PositionDockRect(); virtual;

  

Get the DockRect for an possible drop.

  procedure SetDragMode(); virtual;

  

Sets the value for the DragMode property.

  function GetDefaultDockCaption; virtual;

  

Returns the string for the dock caption, by default the control's Name.

  procedure Click; virtual;

  

Signals OnClick and/or executes the ActionLink when the control has been clicked.

  procedure DblClick; virtual;

  

Signals the OnDblClick event handler (when assigned).

  procedure TripleClick; virtual;

  

Signals the OnTripleClick event handler (when assigned).

  procedure QuadClick; virtual;

  

Signals the OnQuadClick event handler (when assigned).

  function GetMousePosFromMessage();

  

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

  procedure MouseDown(); virtual;

  

Handler for MouseDown events.

  procedure MouseMove(); virtual;

  

Handler for MouseMove events.

  procedure MouseUp(); virtual;

  

Invokes the OnMouseUp handler.

  procedure MouseEnter; virtual;

  

Invokes the OnMouseEnter handler.

  procedure MouseLeave; virtual;

  

Invokes the OnMouseLeave handler.

  function DialogChar(); virtual;

  

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

  procedure UpdateMouseCursor();

  

Changes the cursor shape to the value in the Cursor property.

  procedure Changed;

  

Performs actions needed when the value for the control has been changed.

  function GetPalette; virtual;

  

Override GetPalette to return the handle of a color palette.

  function ChildClassAllowed(); virtual;

  

Returns True if the specified class is allowed for children of this control.

  procedure ReadState(); override;

  

Updates control flags and reads the data for the component.

  procedure Loaded; override;

  

Performs actions needed when LCL component streaming has been completed.

  procedure LoadedAll; virtual;

  

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

  procedure DefineProperties(); override;

  

Defines which non-published properties should be streamed (none here).

  procedure AssignTo(); override;

  

Implements assignment of the control to an Action object, or calls the inherited method.

  procedure FormEndUpdated; virtual;

  

Called for each control on a form where the update count has reached 0 (zero).

  procedure InvalidateControl();

  

Requests a repaint of the control.

  procedure FontChanged(); virtual;

  

Handles changes to the Font property.

  procedure ParentFontChanged; virtual;

  

[Delphi compatible] Does nothing here, all work is done in CMParentFontChanged.

  function GetAction; virtual;

  

Gets the value for the Action property.

  function RealGetText; virtual;

  

Returns the Caption property.

  procedure RealSetText(); virtual;

  

Sets the value for the Caption property.

  procedure TextChanged; virtual;

  

Performs actions needed when the value for the Text property has been changed.

  function GetCachedText(); virtual;

  

Returns the cached Text property (FCaption).

  procedure SetAction(); virtual;

  

Sets the value for the Action property.

  procedure SetColor(); virtual;

  

Sets the value for the Color property.

  procedure SetEnabled(); virtual;

  

Sets the value for the Enabled property.

  procedure SetHint(); virtual;

  

Sets the value for the Hint property.

  procedure SetName(); override;

  

Sets the value for the Name property.

  procedure SetParent(); virtual;

  

Sets the value for the Parent property.

  procedure SetParentComponent(); override;

  

Sets the value in the Parent property when the new parent component is a TWinControl instance.

  procedure WndProc(); virtual;

  

The general message handler for this control.

  procedure ParentFormHandleInitialized; virtual;

  

Internal handler for activities after a form widget has been created.

  function GetMouseCapture; virtual;

  

Gets the value for the MouseCapture property.

  procedure CaptureChanged; virtual;

  

Handler for mouse capture moved to a different control.

  procedure Notification(); override;

  

Notification handler for insertion or deletion of components.

  function CanTab; virtual;

  

Determined whether the Tab key can be used for navigation in the control.

  function GetDeviceContext(); virtual;

  

Returns a device context handle for the control, from Parent.

  function GetEnabled; virtual;

  

Gets the value for the Enabled property.

  function GetPopupMenu; virtual;

  

Gets the value for the PopupMenu property.

  procedure DoOnShowHint(); virtual;

  

Invokes the OnShowHint event handler.

  function DoMouseWheel(); virtual;

  

Invokes the OnMouseWheel handlers, when the wheel has been turned.

  function DoMouseWheelDown(); virtual;

  

Invokes the OnMouseWheelDown handler.

  function DoMouseWheelUp(); virtual;

  

Invokes the OnMouseWheelUp handler.

  function DoMouseWheelHorz(); virtual;

  

Performs actions needed to handle horizontal mouse wheel events.

  function DoMouseWheelLeft(); virtual;

  

Performs the OnMouseWheelLeft event handler.

  function DoMouseWheelRight(); virtual;

  

Performs the OnMouseWheelRight event handler.

  procedure VisibleChanging; virtual;

  

Notifies all OnVisibleChanging handlers.

  procedure VisibleChanged; virtual;

  

Notifies all OnVisibleChanged handlers.

  procedure EnabledChanging; virtual;

  

Notifies all OnEnabledChanging handlers.

  procedure EnabledChanged; virtual;

  

Notifies all OnEnabledChanged handlers.

  procedure AddHandler();

  

Adds an notification handler.

  procedure RemoveHandler();

  

Removes the given notification handler.

  procedure DoCallNotifyHandler();

  

Invokes all notification handlers of the specified type.

  procedure DoCallKeyEventHandler();

  

Passes key events for the specified type to the handlers added to the control.

  procedure DoCallMouseWheelEventHandler();

  

Passes mouse wheel events to the handlers added to the control.

  procedure DoContextPopup(); virtual;

  

Invokes the OnContextPopup handler.

  procedure SetZOrder(); virtual;

  

Moves the control in front or back of all sibling controls.

  class function GetControlClassDefaultSize; virtual;

  

Returns the default size for this class of controls (when added to a form).

  function ColorIsStored; virtual;

  

Implements the storage specifier for the Color property.

  procedure DoAutoAdjustLayout(); virtual;

  

Applies layout changes using the specified policy and scaling proportions to the control.

  procedure DoFixDesignFontPPI();

  

Applies the design-time PPI and resizes the specified control font.

  procedure DoScaleFontPPI();

  

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

  function GetActionLinkClass; virtual;

  

The default ActionLink class (TControlActionLink).

  procedure ActionChange(); virtual;

  

Handler for a changed Action.

  property ActionLink: TControlActionLink; [rw]

  

Link to the default Action associated with this control.

  property DesktopFont: Boolean; [rw]

  

Allows to use the desktop font for text display in this control.

  property DragCursor: TCursor; [rw]

  

The cursor shape shown while the control is dragged.

  property DragKind: TDragKind; [rw]

  

The operation when the control is dragged - Drag or Dock.

  property DragMode: TDragMode; [rw]

  

Allows the user to drag the control.

  property MouseCapture: Boolean; [rw]

  

True when mouse messages are currently captured by this control.

  property ParentColor: Boolean; [rw]

  

Use the Color from the Parent control, when enabled.

  property ParentFont: Boolean; [rw]

  

If true, the Font of the control will be the same as the one from the Parent. Default is true.

  property ParentShowHint: Boolean; [rw]

  

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

  property SessionProperties: string; [rw]

  

The stored (saved) properties of the current session, expressed as a string.

  property Text: TCaption; [rw]

  

The character string associated with the control.

  property OnConstrainedResize: TConstrainedResizeEvent; [rw]

  

This handler can supply specific Constraints (size limits), when the control is resized.

  property OnContextPopup: TContextPopupEvent; [rw]

  

Invoked when a context-sensitive pop-up menu is requested.

  property OnDblClick: TNotifyEvent; [rw]

  

Event Handler for double mouse clicks.

  property OnTripleClick: TNotifyEvent; [rw]

  

Event handler for triple mouse clicks.

  property OnQuadClick: TNotifyEvent; [rw]

  

Event handler for quadruple mouse clicks.

  property OnDragDrop: TDragDropEvent; [rw]

  

This handler determines the action on an drop onto this control, in a drag-drop operation.

  property OnDragOver: TDragOverEvent; [rw]

  

Event handler for a control being dragged over this control.

  property OnEndDock: TEndDragEvent; [rw]

  

Notification handler for the end of a docking operation.

  property OnEndDrag: TEndDragEvent; [rw]

  

Notification handler for the end of a dragging operation.

  property OnMouseDown: TMouseEvent; [rw]

  

Event handler for mouse button going down.

  property OnMouseMove: TMouseMoveEvent; [rw]

  

Event handler for mouse movement within the control.

  property OnMouseUp: TMouseEvent; [rw]

  

Event handler for mouse button going up.

  property OnMouseEnter: TNotifyEvent; [rw]

  

Event handler for mouse entering the area of the control.

  property OnMouseLeave: TNotifyEvent; [rw]

  

Event handler for mouse leaving the area of the control.

  property OnMouseWheel: TMouseWheelEvent; [rw]

  

Event handler for mouse wheel turned.

  property OnMouseWheelDown: TMouseWheelUpDownEvent; [rw]

  

Event handler for downward movement of mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent; [rw]

  

Event handler for upward movement of the mouse wheel.

  property OnMouseWheelHorz: TMouseWheelEvent; [rw]

  

Event handler for horizontal movements of the mouse wheel.

  property OnMouseWheelLeft: TMouseWheelUpDownEvent; [rw]

  

Event handler for left movements of the mouse wheel.

  property OnMouseWheelRight: TMouseWheelUpDownEvent; [rw]

  

Event handler for right movements of the mouse wheel.

  property OnStartDock: TStartDockEvent; [rw]

  

Event handler for the start of a docking operation.

  property OnStartDrag: TStartDragEvent; [rw]

  

Event handler for the start of a dragging operation.

  property OnEditingDone: TNotifyEvent; [rw]

  

Event handler signalled when editing is done.

public

  FCompStyle: Byte;

  

Deprecated.

  procedure DragDrop(); virtual;

  

Invokes the OnDragDrop handler, when a dragged object is dropped onto this control.

  procedure Dock(); virtual;

  

Moves the control into a new docksite.

  function ManualDock(); virtual;

  

Docks a control programmatically.

  function ManualFloat(); virtual;

  

Undocks the control into floating state.

  function ReplaceDockedControl();

  

Replaces a previously docked control.

  function Docked;

  

Indicates if the control has a host dock site.

  function Dragging;

  

Returns True if the control is being dragged.

  function GetAccessibleObject;

  

Returns True if the control is being dragged.

  function CreateAccessibleObject; virtual;

  

Creates a TLazAccessibleObject instance for this control.

  function GetSelectedChildAccessibleObject; virtual;

  

Returns the currently selected child accessible object.

  function GetChildAccessibleObjectAtPos(); virtual;

  

Returns the child accessibility object at the given position for the control.

  function ScaleDesignToForm();

  

Scales a size value from the design-time PPI to the run-time PPI for the parent form.

  function ScaleFormToDesign();

  

Scales a size value from the run-time PPI for the parent form to the design-time PPI.

  function Scale96ToForm();

  

Scales a size value from 96 PPI to the run-time PPI for the Screen.

  function ScaleFormTo96();

  

Scales a size value from the PPI for the Parent form (or designer control) to 96 PPI.

  function Scale96ToFont();

  

Scales a size value from 96 PPI to the PPI setting for the Font in the control.

  function ScaleFontTo96();

  

Scales a size value from the PPI setting in the Font for the control to 96 PPI.

  function ScaleScreenToFont();

  

Scales a size value from the PPI setting for the Screen to the PPI setting for the Font in the control.

  function ScaleFontToScreen();

  

Scales a size value from the PPI setting for the Font to the PPI setting for the Screen.

  function Scale96ToScreen();

  

Scales a size value from 96 PPI to the PPI setting for the Screen.

  function ScaleScreenTo96();

  

Scales a size value from the PPI setting for the Screen to 96 PPI.

  procedure AdjustSize; virtual;

  

Smart way to DoAutoSize.

  function AutoSizePhases; virtual;

  

Auto-sizing phases enabled for the control.

  function AutoSizeDelayed; virtual;

  

Returns true if auto-sizing must be has been delayed, until some other process is complete.

  function AutoSizeDelayedReport; virtual;

  

Returns a string with a debugging message for delayed auto-size requests.

  function AutoSizeDelayedHandle; virtual;

  

Returns true if AutoSize should be skipped or delayed because of its handle.

  procedure AnchorToNeighbour();

  

Anchor to Sibling at Side.

  procedure AnchorParallel();

  

Anchor parallel to Sibling, at Side.

  procedure AnchorHorizontalCenterTo();

  

Setup AnchorSide to center the control horizontally relative to a sibling.

  procedure AnchorVerticalCenterTo();

  

Setup AnchorSide to center the control vertically relative to Sibling.

  procedure AnchorToCompanion();

  

Anchor to Sibling at Side, with the same extent.

  procedure AnchorSame();

  

Copy Sibling's anchoring for Side.

  procedure AnchorAsAlign();

  

Anchor to Parent, following same rules as for Align.

  procedure AnchorClient();

  

Anchor to Parent's full client area.

  function AnchoredControlCount;

  

The number of controls anchored to this one.

  property AnchoredControls []: TControl; [r]

  

The list of controls anchored to this one.

  procedure SetBounds(); virtual;

  

Sets the bounds (Left, Top, Width, Height) of the control.

  procedure SetInitialBounds(); virtual;

  

Sets the bounds of the control initially, when it is created.

  procedure SetBoundsKeepBase(); virtual;

  

Set the bounds, keeping the base values.

  procedure GetPreferredSize(); virtual;

  

Returns default/preferred height and width, for use in auto-sizing.

  function GetCanvasScaleFactor;

  

Gets the scaling factor for the canvas used to render the control.

  function GetDefaultWidth;

  

The default width for this control, independent of any calculated values like Width and GetPreferredSize.

  function GetDefaultHeight;

  

The default height for this control, independent of any calculated values like Height and GetPreferredSize.

  function GetDefaultColor(); virtual;

  

Get the default color for this widget, from Parent or color type.

  function GetColorResolvingParent;

  

Returns the color of the control while resolving clDefault and ParentColor.

  function GetRGBColorResolvingParent;

  

Returns a RGB value for the color of the control.

  function GetSidePosition();

  

The client coordinate of the given side.

  procedure CNPreferredSizeChanged;

  

Message handler for preferred size changed.

  procedure InvalidatePreferredSize; virtual;

  

Marks the preferred size as invalid for this control and all parents (implies that we will look for another).

  function GetAnchorsDependingOnParent();

  

Returns the sides which are anchored to the Parent.

  procedure DisableAutoSizing;

  

Disables automatic sizing; implies that the default size is accepted, or sizing is done manually.

  procedure EnableAutoSizing;

  

Turns on (enables) automatic sizing.

  procedure UpdateBaseBounds(); virtual;

  

Update the basic boundaries of the control - essential if there has been a lot of re-sizing.

  property BaseBounds: TRect; [r]

  

The rectangle of the designed bounds.

  property ReadBounds: TRect; [r]

  

Reflects the Bounds for the Control read during LCL component streaming.

  property BaseParentClientSize: TSize; [r]

  

The Parent's client size, for which the BaseBounds are valid.

  procedure WriteLayoutDebugReport(); virtual;

  

Used for debugging.

  procedure AutoAdjustLayout(); virtual;

  

Applies an automatic adjustment layout policy to the control.

  procedure ShouldAutoAdjust(); virtual;

  

Indicates whether the height and/or width for a control can be automatically adjusted.

  procedure FixDesignFontsPPI(); virtual;

  

Corrects the font size for High-DPI-aware applications.

  procedure ScaleFontsPPI(); virtual;

  

Resizes a font to the specified Pixels per Inch setting.

  constructor Create(); override;

  

Constructor for the class instance.

  destructor Destroy; override;

  

Removes the control from its Parent.

  procedure BeforeDestruction; override;

  

Performs notifications to before destruction handlers added to the control.

  procedure EditingDone; virtual;

  

Invokes the OnEditingDone event handler.

  procedure ExecuteDefaultAction; virtual;

  

Called when the RETURN button is pressed, signifying default action.

  procedure ExecuteCancelAction; virtual;

  

Called when ESCAPE is hit or the CANCEL button is clicked - signifying CANCEL.

  procedure BeginDrag();

  

Starts dragging the control (programmatically).

  procedure EndDrag();

  

Ends a drag operation by notifying the drag manager.

  procedure BringToFront;

  

Bring the control in front of all sibling controls.

  function HasParent; override;

  

Returns True if there is a parent component responsible for streaming.

  function GetParentComponent; override;

  

Returns Parent (implements TComponent.GetParentComponent).

  function IsParentOf(); virtual;

  

Determines whether this control is a parent of AControl.

  function GetTopParent;

  

Find the control that is the top-most parent.

  function FindSubComponent();

  

Finds the sub-component with the specified name in the components property.

  function IsVisible; virtual;

  

Returns True if the control is visible, including all of its Parents.

  function IsControlVisible; virtual;

  

True if the control is Visible, or is in design mode.

  function IsEnabled;

  

Returns True if the control is Enabled, including all of its Parents.

  function IsParentColor;

  

Provides access to the value in the protected ParentColor property.

  function IsParentFont;

  

Provides access to the value in the protected ParentFont property.

  function FormIsUpdating; virtual;

  

True if the form is being updated.

  function IsProcessingPaintMsg;

  

True while painting the control.

  procedure Hide;

  

Hides this control, by setting Visible to False.

  procedure Refresh;

  

Causes the control to be redrawn.

  procedure Repaint; virtual;

  

Immediately redraws the control when visible, bypassing the message queue.

  procedure Invalidate; virtual;

  

Force a delayed Repaint of the control, by marking its visible area of the control as invalid.

  function CheckChildClassAllowed();

  

Returns True if the class is allowed for child controls.

  procedure CheckNewParent(); virtual;

  

Checks if this control can become a child of AParent.

  procedure SendToBack;

  

Moves all sibling controls in front of this control.

  procedure SetTempCursor(); virtual;

  

Changes the cursor shape temporarily, preserving the original TControl.Cursor

  procedure UpdateRolesForForm; virtual;

  

Internal method called by a Form when its DefaultControl or CancelControl has changed.

  procedure ActiveDefaultControlChanged(); virtual;

  

Notification of a changed active DefaultControl of a form.

  function GetTextBuf(); virtual;

  

Copy the Text property into Buffer.

  function GetTextLen; virtual;

  

The length of Text, here: of Caption.

  procedure SetTextBuf(); virtual;

  

Updates the Text property from a PChar buffer.

  function Perform();

  

Direct call of an message handler, bypassing the message queue.

  function ScreenToClient(); virtual;

  

Convert absolute screen coordinates into client-relative coordinates.

  function ClientToScreen(); virtual;

  

Convert client-relative coordinates into absolute screen coordinates.

  function ScreenToControl();

  

Convert absolute screen coordinates into control-relative coordinates.

  function ControlToScreen();

  

Converts control-relative coordinates to absolute screen coordinates.

  function ClientToParent();

  

Converts the screen coordinates for the control to the screen coordinates for the specified parent control.

  function ParentToClient();

  

Converts the screen coordinates for the parent control to the screen coordinates for the control.

  function GetChildrenRect(); virtual;

  

Get the visible part of a possibly scrolled client area.

  procedure Show;

  

Makes the control visible, by setting Visible to True.

  procedure Update; virtual;

  

Redraw invalidated parts of the control immediately.

  function HandleObjectShouldBeVisible; virtual;

  

True if the control shall be visible, unless it's being destroyed.

  function ParentDestroyingHandle;

  

Returns True if any parent is destroying its Handle (and its children').

  function ParentHandlesAllocated; virtual;

  

Returns True if all Parents have handles allocated, and are not being destroyed.

  procedure InitiateAction; virtual;

  

Update the action associated with this control.

  procedure ShowHelp; virtual;

  

Show the Help associated with this control.

  function HasHelp;

  

True when a HelpKeyword or HelpContext ID is assigned.

  procedure RemoveAllHandlersOfObject(); override;

  

Override this method to remove all references to notification handlers in AnObject.

  procedure AddHandlerOnResize();

  

Adds an handler for the OnResize event.

  procedure RemoveHandlerOnResize();

  

Removes an handler for the OnResize event.

  procedure AddHandlerOnChangeBounds();

  

Adds an handler for the OnChangeBounds event.

  procedure RemoveHandlerOnChangeBounds();

  

Removes an handler for the OnChangeBounds event.

  procedure AddHandlerOnVisibleChanging();

  

Adds an OnVisibleChanging handler.

  procedure RemoveHandlerOnVisibleChanging();

  

Removes an OnVisibleChanging handler.

  procedure AddHandlerOnVisibleChanged();

  

Adds an OnVisibleChanged handler.

  procedure RemoveHandlerOnVisibleChanged();

  

Removes an OnVisibleChanged handler.

  procedure AddHandlerOnEnabledChanged();

  

Adds an OnEnabledChanged handler.

  procedure RemoveHandlerOnEnableChanging();

  

Removes an OnEnabledChanged handler.

  procedure AddHandlerOnKeyDown();

  

Adds an handler for the OnKeyDown event.

  procedure RemoveHandlerOnKeyDown();

  

Removes an handler for the OnKeyDown event.

  procedure AddHandlerOnBeforeDestruction();

  

Adds a handler for OnBeforeDestruction events.

  procedure RemoveHandlerOnBeforeDestruction();

  

Removes a handler for OnBeforeDestruction events.

  procedure AddHandlerOnMouseWheel();

  

Adds a handler for OnMouseWheel events.

  procedure RemoveHandlerOnMouseWheel();

  

Removes a handler for OnMouseWheel events.

  property AccessibleName: TCaption; [rw]

  

Contains the accessible name for the control.

  property AccessibleDescription: TCaption; [rw]

  

The accessible description of the control.This should describe the role of the control, for example for TLabel it could be "a text caption"

  property AccessibleValue: TCaption; [rw]

  

The accessible value of the control.

  property AccessibleRole: TLazAccessibilityRole; [rw]

  

The accessible role of the control which classifies what kind of object this is. See TLazAccessibilityRole for a list of possible values.

  property Action: TBasicAction; [rw]

  

The Action associated with the control.

  property Align: TAlign; [rw]

  

Specifies the placement of the control inside its Parent.

  property Anchors: TAnchors; [rws]

  

The set of anchor definitions for this control.

  property AnchorSide []: TAnchorSide; [r]

  

Array of anchor definitions, indexed by the control sides.

  property AutoSize: Boolean; [rw]

  

Allows automatic adjustment of the size for the control, according to its content.

  property BorderSpacing: TControlBorderSpacing; [rw]

  

Determines the inner and outer border spacing for this control.

  property BoundsRect: TRect; [rw]

  

The TopLeft and BottomRight of the control, in client coordinates.

  property BoundsRectForNewParent: TRect; [rw]

  

Temporary BoundsRect, used when the control e.g. is docked into a different Parent.

  property Caption: TCaption; [rws]

  

The text describing the control to the user.

  property CaptureMouseButtons: TCaptureMouseButtons; [rws]

  

Which mouse button(s) to be used for capture? Default is the left button.

  property ClientHeight: Integer; [rws]

  

The height of the client area of the control.

  property ClientOrigin: TPoint; [r]

  

Screen coordinates of the Top, Left pixel (in the client area) of the control.

  property ClientRect: TRect; [r]

  

Size of the client area for the control.

  property ClientWidth: Integer; [rws]

  

The width of the client area of the control.

  property Color: TColor; [rws]

  

The background color of the control.

  property Constraints: TSizeConstraints; [rw]

  

The minimum and maximum Width and Height for the control.

  property ControlOrigin: TPoint; [r]

  

The top, left pixel of the control in screen coordinates.

  property ControlState: TControlState; [rw]

  

State flags, telling whether the control has been clicked, data being read, control being re-drawn, etc.

  property ControlStyle: TControlStyle; [rw]

  

Style flags, specifying whether the control responds to mouse clicks, can be re-sized, has particular actions, etc.

  property Enabled: Boolean; [rws]

  

Determines whether the control reacts on mouse or keyboard input.

  property Font: TFont; [rws]

  

The font to be used for text display in this control.

  property IsControl: Boolean; [rw]

  

Determines whether this object shall be streamed as a control.

  property MouseEntered: Boolean; [r] deprecated ;

  

True when the mouse has entered the control.

  property MouseInClient: Boolean; [r]

  

True when the mouse is in the client area for the control.

  property OnChangeBounds: TNotifyEvent; [rw]

  

Event handler for a change of the Bounds of the control.

  property OnClick: TNotifyEvent; [rw]

  

Notification handler for mouse clicks.

  property OnResize: TNotifyEvent; [rw]

  

Notification handler for a resize of the control.

  property OnShowHint: TControlShowHintEvent; [rw]

  

Event handler signalled when a hint window is displayed for the control.

  property Parent: TWinControl; [rw]

  

The control within which the control is shown.

  property PopupMenu: TPopupMenu; [rw]

  

A context-sensitive menu that pops up when the right mouse button is clicked over this control.

  property ShowHint: Boolean; [rws]

  

Enables the Hint display.

  property Visible: Boolean; [rws]

  

Allows the control, and all of its children, to be displayed or hidden.

  property WindowProc: TWndMethod; [rw]

  

The handler for all messages.

  property DockOrientation: TDockOrientation; [rw]

  

How the control is currently docked. (horizontally, vertically, in a notebook, or not at all).

  property Floating: Boolean; [r]

  

Determines whether the control is floating (not part of a form).

  property FloatingDockSiteClass: TWinControlClass; [rw]

  

The class for a floating host dock site for this control.

  property HostDockSite: TWinControl; [rw]

  

The host site (TWinControl) into which this control is docked. Nil if not docked.

  property LRDockWidth: Integer; [rw]

  

The Width when last docked, with siblings to the left or right.

  property TBDockHeight: Integer; [rw]

  

The Height when last docked, with siblings above or below.

  property UndockHeight: Integer; [rw]

  

Height for the control when undocked.

  property UndockWidth: Integer; [rw]

  

Width for the control when undocked.

  function UseRightToLeftAlignment; virtual;

  

True when BiDiMode is bdRightToLeft.

  function UseRightToLeftReading; virtual;

  

True when BiDiMode is not bdLeftToRight.

  function UseRightToLeftScrollBar;

  

True when scrollbars appear at the left side of the control.

  function IsRightToLeft;

  

True when BiDiMode is not bdLeftToRight.

  property BiDiMode: TBiDiMode; [rws]

  

Customization (of text controls) in bidirectional reading environments.

  property ParentBiDiMode: Boolean; [rw]

  

Allows to use the BiDiMode settings in the Parent control. Default is true.

published

  property AnchorSideLeft: TAnchorSide; [rw]

  

Contains anchor aligment information used to position the control with its left edge anchored to another control.

  property AnchorSideTop: TAnchorSide; [rw]

  

Contains anchor aligment information used to position the control with its top edge anchored to another control.

  property AnchorSideRight: TAnchorSide; [rw]

  

Contains anchor aligment information used to position the control with its right edge anchored to another control.

  property AnchorSideBottom: TAnchorSide; [rw]

  

Contains anchor aligment information used to position the control with its bottom edge anchored to another control.

  property Cursor: TCursor; [rw]

  

The shape of the mouse pointer, when the mouse is over this control.

  property Left: Integer; [rw]

  

The client coordinate of the left edge of the control.

  property Height: Integer; [rw]

  

The vertical size of the control.

  property Hint: TTranslateString; [rws]

  

The text to show in the Hint window for the control.

  property Top: Integer; [rw]

  

The client coordinate of the top edge of the control.

  property Width: Integer; [rw]

  

The horizontal extent of the control.

  property HelpType: THelpType; [rw]

  

Determines whether context-sensitive Help is selected by numeric ID or keyword.

  property HelpKeyword: string; [rws]

  

The keyword for context-sensitive Help on this control.

  property HelpContext: THelpContext; [rws]

  

The ID for context-sensitive Help on this control.

end;

Inheritance

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent

?

TObject

The latest version of this document can be found at lazarus-ccr.sourceforge.net.