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

TWinControl

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

TWinControl - the base class for all windowed controls

Declaration

Source position: controls.pp line 1578

type TWinControl = class(TControl)

protected

  FWinControlFlags: TWinControlFlags;

  

FWinControlFlags - local variable to hold status flags

  procedure WSRegisterClass; override;

  

WSRegisterClass - Register this Class for the current Widget Set

  procedure AdjustClientRect(); virtual;

  

AdjustClientRect - method for adjusting the size and position of the client control

  procedure CreateControlAlignList();

  

CreateControlAlignList - creates a list of the controls that are aligned with the present window control

  procedure AlignControls(); virtual;

  

AlignControls - align the specified control with a given client rectangle

  function CustomAlignInsertBefore(); virtual;

  

CustomAlignInsertBefore - returns True if the OnAlignInsertBefore event handler has been assigned and executes successfully

  procedure CustomAlignPosition(); virtual;

  

CustomAlignPosition calls the OnAlignPosition event handler to make a highly specified alignment

  function DoAlignChildControls(); virtual;

  

DoAlignChildControls - method for aligning child controls from a list; returns True if successful

  procedure DoChildSizingChange(); virtual;

  

DoChildSizingChange - method for changing size of a child component

  procedure ResizeDelayedAutoSizeChildren; virtual;

  

ResizeDelayedAutoSizeChildren - method for re-sizing children, using autosize delayed

  procedure InvalidatePreferredChildSizes;

  

InvalidatePreferredChildSizes - renders the preferred child sizes invalid

  function CanTab; override;

  

CanTab - if True, the Tab key can be used to navigate to this control

  function IsClientHeightStored; override;

  

Is Client Height Stored?

  function IsClientWidthStored; override;

  

Is Client Width Stored?

  procedure DoSendShowHideToInterface; virtual;

  

DoSendShowHideToInterface - send the Show/Hide status to the interface

  procedure ControlsAligned; virtual;

  

ControlsAligned - called by AlignControls after aligning controls

  procedure DoSendBoundsToInterface; virtual;

  

DoSendBoundsToInterface - sends information about the control's bounds to the interface

  procedure RealizeBounds; virtual;

  

RealizeBounds - checks for changes and calls DoSendBoundsToInterface

  procedure RealizeBoundsRecursive;

  

RealizeBoundsRecursive - perform RealizeBounds in a recursive manner

  procedure CreateSubClass();

  

CreateSubClass - creates a sub-class using the supplied parameters

  procedure DoConstraintsChange(); override;

  

Procedure to execute a change in the control's constraints

  procedure DoSetBounds(); override;

  

DoSetBounds - anticipate the new clientwidth/height and call inherited method

  procedure DoAutoSize; override;

  

DoAutoSize - performs a lot of calculations and adjustments of child components in the window before automatically adjusting the size of the window itself

  procedure CalculatePreferredSize(); override;

  

CalculatePreferredSize - calculates the default/preferred width and height for a TWinControl, which is used by the LCL autosizing algorithms as default size

  procedure GetChildren(); override;

  

GetChildren - makes a list of all the child components for this control

  function ChildClassAllowed(); override;

  

ChildClassAllowed - returns True if the given child class is permitted

  procedure PaintControls();

  

PaintControls - method for painting a series of controls

  procedure PaintHandler();

  

PaintHandler - message handler for painting

  procedure PaintWindow(); virtual;

  

PaintWindow - method for painting a window

  procedure CreateBrush; virtual;

  

CreateBrush - method to create a brush for painting

  procedure CMBiDiModeChanged(); message;

  

CMBiDiModeChanged - control message for a change in the BiDiMode property

  procedure CMBorderChanged(); message;

  

CMBorderChanged - ControlMessage for a change in the Border property

  procedure CMEnabledChanged(); message;

  

CMEnabledChanged - control message for a change in the Enabled property

  procedure CMShowingChanged(); message;

  

CMShowingChanged - control message when Showing property is changed

  procedure CMShowHintChanged(); message;

  

CMShowHintChanged - control message for a change in the ShowHint property

  procedure CMVisibleChanged(); message;

  

CMVisibleChanged - control message when Visible property is changed

  procedure WMEraseBkgnd(); message;

  

WMEraseBkgnd - LCL message for erasing background

  procedure WMNotify(); message;

  

WMNotify - LCL Notify message

  procedure WMSetFocus(); message;

  

WMSetFocus - LCL Message to set focus

  procedure WMKillFocus(); message;

  

WMKillFocus - LCL Message to kill focus

  procedure WMShowWindow(); message;

  

WMShowWindow - LCL Message to show window

  procedure WMEnter(); message;

  

WMEnter - LCL Message for entry to the control

  procedure WMExit(); message;

  

WMExit - LCL Message for exit from control

  procedure WMKeyDown(); message;

  

WMKeyDown - LCL Message for a key down

  procedure WMSysKeyDown(); message;

  

WMSysKeyDown - LCL Message for a system key down

  procedure WMKeyUp(); message;

  

WMKeyUp - LCL Message for a key up

  procedure WMSysKeyUp(); message;

  

WMSysKeyUp - LCL Message for a system key up

  procedure WMChar(); message;

  

WMChar - LCL Message signifying a character

  procedure WMSysChar(); message;

  

WMSysChar - LCL Message signifying a system character

  procedure WMPaint(); message;

  

WMPaint - LCL Message for Paint

  procedure WMDestroy(); message;

  

WMDestroy - LCL Message for control destruction

  procedure WMMove(); message;

  

WMMove - LCL Message for movement

  procedure WMSize(); message;

  

WMSize - LCL Message for sizing control

  procedure CNKeyDown(); message;

  

CNKeyDown - control message for key down

  procedure CNSysKeyDown(); message;

  

CNSysKeyDown - control message for system key down

  procedure CNKeyUp(); message;

  

CNKeyUp - control message for key up

  procedure CNSysKeyUp(); message;

  

CNSysKeyUp - control message for system key up

  procedure CNChar(); message;

  

CNChar - control message specifying a character

  function DoDragMsg(); override;

  

DoDragMsg - issues a Drag message for a nominated drag object at a specified position, to a specific target with ADocking set True or False; returns an integer result

  function DoDockClientMsg(); virtual;

  

DoDockClientMsg - issues a Dock Client message for a specified DragDropOject at a given position; returns True if successful

  function DoUndockClientMsg(); virtual;

  

DoUndockClientMsg - issues a message to undock a client control; returns True if successful

  procedure DoAddDockClient(); virtual;

  

DoAddDockClient - add the specified control as a client for docking in the specified location (Arect)

  procedure DockOver(); virtual;

  

DockOver - software emulation of the OnDockOver event

  procedure DoDockOver(); virtual;

  

DoDockOver - perform the DockOver method

  procedure DoRemoveDockClient(); virtual;

  

DoRemoveDockClient - method for removing a docking client

  function DoUnDock(); virtual;

  

DoUnDock - software emulation of the OnUnDock evnet

  procedure GetSiteInfo(); virtual;

  

GetSiteInfo - software emulation of the OnGetSiteInfo event

  procedure ReloadDockedControl(); virtual;

  

ReloadDockedControl - load the docked control again (it may have become misaligned during other processes)

  function CreateDockManager; virtual;

  

CreateDockManager - returns a new Dock Manager

  procedure SetDockManager();

  procedure DoFloatMsg(); override;

  

Sends a message to the operating system about the floating status of ADockSource

  procedure DoGetDockCaption(); virtual;

  

DoGetDockCaption - find the caption for the docked control

  procedure DoEnter; virtual;

  

DoEnter - perform the action for the OnEnter event handleer

  procedure DoExit; virtual;

  

DoExit - perform the action for the OnExit event handler

  function DoKeyDownBeforeInterface();

  

DoKeyDownBeforeInterface - issues a message to the interface and returns True if a key was already down

  function DoRemainingKeyDown();

  

DoRemainingKeyDown - issues a LCL message and returns True if a key remains down

  function DoRemainingKeyUp();

  

DoRemainingKeyUp - issues a LCL message and returns True if a key remains up

  function DoKeyPress();

  

DoKeyPress - issues a LCL message and returns True if a key is pressed

  function DoUTF8KeyPress(); virtual;

  

DoUTF8KeyPress - issues a LCL message and returns True if there has been a UTF8 key press

  function DoKeyUpBeforeInterface();

  

DoKeyUpBeforeInterface - issues an interface message and returns True if a key was already up

  function ChildKey(); virtual;

  

ChildKey - LCL message: returns True if this is a child key

  function SendDialogChar();

  

SendDialogChar - LCL key message: returns True if a dialog character has been sent

  function DialogChar(); override;

  

DialogChar - a LCL Key Message; returns True if a Dialog character has an associated message

  procedure ControlKeyDown(); virtual;

  

ControlKeyDown - contains the set of special keys (shift, control, alt, meta) that are pressed

  procedure ControlKeyUp(); virtual;

  

ControlKeyUp - contains the set of special keys (shift, control, alt, meta) that are not pressed ('up')

  procedure KeyDown(); virtual;

  

KeyDown - emulate the action of pressing the specified key (makes OnKeyDown respond)

  procedure KeyDownBeforeInterface(); virtual;

  

KeyDownBeforeInterface - informs interface that the specified key (with defined shift state) was already pressed

  procedure KeyDownAfterInterface(); virtual;

  

KeyDownAfterInterface - informs interface that the specified key (with defined shift state) was pressed after an event

  procedure KeyPress(); virtual;

  

KeyPress - simulates the action of pressing the specified key

  procedure KeyUp(); virtual;

  

KeyUp - emulates the action of a key being released (makes OnKeyUp respond)

  procedure KeyUpBeforeInterface(); virtual;

  

KeyUpBeforeInterface - informs interface that the specified key (with defined shift state) was already up

  procedure KeyUpAfterInterface(); virtual;

  

KeyUpAfterInterface - informs interface that the specified key (with defined shift state) was released (up) after an event

  procedure UTF8KeyPress(); virtual;

  

UTF8KeyPress - simulates the action of pressing the specified (UTF8) key

  function FindNextControl();

  

FindNextControl - returns the next control on the list; optionally checks if it is a TabStop or a parent control

  procedure SelectFirst;

  

SelectFirst - select the first control on the list

  function RealGetText; override;

  

Function to get a text-string associated with the control

  function GetBorderStyle;

  

GetBorderStyle - returns the style of the border

  function GetClientOrigin; override;

  

Find the origin (top left pixel) of the client control

  function GetClientRect; override;

  

Visual size of client area

  function GetControlOrigin; override;

  

Find the origin (top left pixel) of this control

  function GetDeviceContext(); override;

  

GetDeviceContext - returns a device handle to correspond with the nominated WindowHandle

  function IsControlMouseMsg();

  

IsControlMouseMsg - returns True if the specified message is a control mouse message

  procedure CreateHandle; virtual;

  

CreateHandle - generates an operating system handle

  procedure CreateParams(); virtual;

  

CreateParams - create parameters for this windowed class

  procedure CreateWnd; virtual;

  

CreateWnd - Creates the Window

  procedure DestroyHandle; virtual;

  

DestroyHandle - removes the handle for this window

  procedure DestroyWnd; virtual;

  

DestroyWnd - destroy the window for this control

  procedure DoFlipChildren; virtual;

  

DoFlipChildren - reverses the order of the children

  procedure FinalizeWnd; virtual;

  

FinalizeWnd - getting ready to remove window (gets called before the Handle is destroyed)

  procedure FixupTabList;

  

FixupTabList - renders the Tab list into a suitable state

  procedure FontChanged(); override;

  

FontChanged - method for dealing with a changed font

  procedure InitializeWnd; virtual;

  

InitializeWnd - initialise the window for this control

  procedure Loaded; override;

  

Loaded makes a number of checks, using client size if specified, and copying appropriate flags, fonts, text etc, makes list of child controls to notify them of any changes, then calls inherited Loaded

  procedure FormEndUpdated; override;

  

FormEndUpdated - calls inherited FormEndUpdated then informs each child control

  procedure MainWndProc();

  

MainWndProc - issus a LCL message that this is the main window procedure

  procedure ParentFormHandleInitialized; override;

  

Called after all childs handles of the ParentForm are created. Tells all wincontrols about the final end of the handle creation phase

  procedure ChildHandlesCreated; virtual;

  

ChildHandlesCreated - called after a child's handles are created

  procedure RealSetText(); override;

  

Procedure to store text associated with the control in a string

  procedure RemoveFocus();

  

RemoveFocus from this WinContro

  procedure SendMoveSizeMessages(); override;

  

Send a message to the system if the size and/or position of the control change

  procedure SetBorderStyle(); virtual;

  

SetBorderStyle - specify the style for the border

  procedure SetColor(); override;

  

Set up the colour to be used by the control

  procedure SetChildZPosition();

  

SetChildZPosition - specify the position of the child control in the Z plane (ie front-to-back)

  procedure ShowControl(); virtual;

  

ShowControl - method for showing the specified control

  procedure UpdateControlState;

  

UpdateControlState - update the state of the control

  procedure UpdateShowing; virtual;

  

UpdateShowing - update the value of the Showing property

  procedure WndProc(); override;

  

WndProc - makes specific reactions according to the message passed, then calls inherited WndProc

  procedure WSSetText(); virtual;

  

WSSetText - writes the name of the current widget set to a local variable

  property BorderStyle: TBorderStyle; [rw]

  

BorderStyle - none, or single

  property OnGetSiteInfo: TGetSiteInfoEvent; [rw]

  

OnGetSiteInfo - event handler for finding out information about the (docking) site

  property OnGetDockCaption: TGetDockCaptionEvent; [rw]

  

OnGetDockCaption - event handler to find the caption for the docked control

public

  property BorderWidth: TBorderWidth; [rw]

  

Property to determine width of the window's border

  property BoundsLockCount: Integer; [r]

  

Finds how many of the Bounds are locked

  property Brush: TBrush; [r]

  

Find which type of brush to use for drawing the control

  property CachedClientHeight: Integer; [r]

  

Stored value of client height

  property CachedClientWidth: Integer; [r]

  

Stored value of Client Width

  property ChildSizing: TControlChildSizing; [rw]

  

Definitions of how any child control is to be sized

  property ControlCount: Integer; [r]

  

The number of controls associated with this window

  property Controls: TControl; [r]

  

The indexed list of controls found in this window

  property DefWndProc: Pointer; [rw]

  

The default procedure to be associated with the window

  property DockClientCount: Integer; [r]

  

The number of clients to which this control is docked

  property DockClients: TControl; [r]

  

The indexed list of dock clients of this window

  property DockManager: TDockManager; [rw]

  

Property that actually controls the docking process

  property DockSite: Boolean; [rw]

  

Is this a dock site? Default false

  property DoubleBuffered: Boolean; [rw]

  

Are the contents of this window to be double buffered?

  property Handle: HWND; [rw]

  

Operating System Handle for identifying and manipulating this window

  property IsResizing: Boolean; [r]

  

Is the window being re-sized?

  property TabOrder: TTabOrder; [rw]

  

The place this control occupies in the list of tabs

  property TabStop: Boolean; [rw]

  

Is the control in the sequence of controls accessed by successive presses of the Tab key?

  property OnAlignInsertBefore: TAlignInsertBeforeEvent; [rw]

  

OnAlignInsertBefore - event handler for an aligned insertion before action

  property OnAlignPosition: TAlignPositionEvent; [rw]

  

OnAlignPosition - event handler for supplying align position

  property OnDockDrop: TDockDropEvent; [rw]

  

Event handler for dropping a control in a docked position

  property OnDockOver: TDockOverEvent; [rw]

  

Event handler for docking a control over another control

  property OnEnter: TNotifyEvent; [rw]

  

OnEnter - event handler for when the mouse enters the control, and the control receives focus

  property OnExit: TNotifyEvent; [rw]

  

OnExit - event handler for when the mouse leaves the control and it loses focus

  property OnKeyDown: TKeyEvent; [rw]

  

OnKeyDown - event handler for instance when key is down while control has focus

  property OnKeyPress: TKeyPressEvent; [rw]

  

OnKeyPress - event controller for a key being pressed while the control has focus. To properly handle national chars use UTF8KeyPress instead.

  property OnKeyUp: TKeyEvent; [rw]

  

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

  property OnUnDock: TUnDockEvent; [rw]

  

OnUnDock - event handler for control becoming disconnected (undocked) from parent

  property OnUTF8KeyPress: TUTF8KeyPressEvent; [rw]

  

UTF8KeyPress - event controller for a key being pressed while the control has focus.

  property Showing: Boolean; [r]

  

Is the window showing? (similar to Visible in other contexts)

  property UseDockManager: Boolean; [rw]

  

Use a dock manager to control docking? (default false)

  property VisibleDockClientCount: Integer; [r]

  

The number of visible client controls for docking

  function AutoSizeDelayed; override;

  

Auto-sizing has been delayed until some other process is complete

  procedure BeginUpdateBounds;

  

BeginUpdateBounds - start updating the bounds of the current WinControl

  procedure EndUpdateBounds;

  

EndUpdateBounds - finishes updating the bounds setting

  procedure LockRealizeBounds;

  

LockRealizeBounds - make the realized bounds unaccessible

  procedure UnlockRealizeBounds;

  

UnlockRealizeBounds - unlock the previously locked realized bounds

  function ControlAtPos();

  

ControlAtPos - the identity of the control located at the specified point Pos

  function ContainsControl();

  

This component contains a specified control

  procedure DoAdjustClientRectChange();

  

DoAdjustClientRectChange - perform any adjustments needed when the client rectangle changes

  procedure InvalidateClientRectCache();

  

InvalidateClientRectCache - render invalid any information in the client rectangle cache

  function ClientRectNeedsInterfaceUpdate;

  

ClientRectNeedsInterfaceUpdate - True if update needed

  procedure SetBounds(); override;

  

SetBounds - set the bounds (top. left, height, width) for the window

  function GetChildsRect(); override;

  

Gets the rectangular co-ordinates for a child control

  procedure DisableAlign;

  

DisableAlign - turn off any alignment

  procedure EnableAlign;

  

EnableAlign - turn on the alignment process

  procedure ReAlign;

  

ReAlign - realign all children

  procedure WriteLayoutDebugReport(); override;

  

Used for debugging

  constructor Create(); override;

  

Create - constructor for TWinControl: performs inherited Create and initialises some local variables

  constructor CreateParented();

  

CreateParented - constructor for a window that is the child of a specified parent

  function CreateParentedControl();

  

CreateParentedControl - returns a newly created window control that has a specified window as its parent

  destructor Destroy; override;

  

Destroy - destructor for TWinControl and derived classes. Removes handles and docked controls, frees resources, then calls inherited Destroy

  procedure DockDrop(); virtual;

  

DockDrop - drop a dragged object into its docking position

  function CanFocus; virtual;

  

CanFocus - is the current window allowed to receive focus?

  function GetControlIndex();

  

GetControlIndex - find the index value for the given control

  procedure SetControlIndex();

  

SetControlIndex - set a new index value for the given control

  function Focused; virtual;

  

Focused - is the current window receiving focus?

  function PerformTab(); virtual;

  

PerformTab - perform a tab - is it in the forward direction?

  function ControlByName();

  

ControlByName - returns the identity of a control whose name is given as an argument

  procedure SelectNext();

  

SelectNext - move to the next windowed control and give it focus

  procedure SetTempCursor(); override;

  

SetTempCursor - set a temporary cursor

  procedure BroadCast();

  

BroadCast - send ToAllMessage to all recipients

  procedure NotifyControls();

  

NotifyControls - send Msg (a message) to all controls

  procedure DefaultHandler(); override;

  

DefaultHandler - performs CallDefaultWndHandler

  function GetTextLen; override;

  

Get the length of the specified text

  procedure Invalidate; override;

  

Render this control non-valid

  procedure AddControl; virtual;

  

AddControl - add this control to the list of controls

  procedure InsertControl();

  

  procedure RemoveControl();

  

RemoveControl - remove the specified control from the list

  procedure Repaint; override;

  

Repaint the control, ie refill its canvas

  procedure Update; override;

  

Perform the Update method specified by the parent control (if there is one)

  procedure SetFocus; virtual;

  

SetFocus - give the current control the focus

  function FindChildControl();

  

FindChildControl - find what controls are descended from the current one

  procedure FlipChildren(); virtual;

  

FlipChildren - reverse the order of the child components

  function GetDockCaption(); virtual;

  

GetDockCaption - get the caption for the specified docked control

  procedure GetTabOrderList();

  

GetTabOrderList - find the list with the Tab Order

  function HandleAllocated;

  

HandleAllocated - find if the operating system has allocated a handle to this control

  function ParentHandlesAllocated; override;

  

ParentHandlesAllocated - returns True if the parent handles have been allocated

  procedure HandleNeeded;

  

HandleNeeded - tell the Operating System that this control requires a handle

  function BrushCreated;

  

BrushCreated - has a brush been created for this control?

  procedure EraseBackground(); virtual;

  

EraseBackground - remove all material from the background

  function IntfUTF8KeyPress(); virtual;

  

IntfUTF8KeyPress - returns the UTF8 value of the pressed key from the interface

  procedure PaintTo();

  

PaintTo - Paint to a specified position on the canvas

  procedure SetShape();

  

SetShape - make the specified shape appear on the Window

end;

Inheritance

TWinControl

  

TWinControl - the base class for all windowed controls

|

TControl

  

TControl - the main ancestor class for visual controls.

|

TLCLComponent

?

TObject

Description

Defines many of the properties inherited by child classes, particularly those related to size, position, bounds, docking, the responses to mouse movements and key presses.

Defines procedures and functions related to windowed controls, some of which override virtual methods defined in ancestor classes.

See also

TControl

  

TControl - the main ancestor class for visual controls.

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