lcl: TWinControl class completed

This commit is contained in:
mattias 2023-07-12 11:35:43 +02:00
parent 2dc7c77293
commit c6200e29c8

View File

@ -2405,7 +2405,7 @@ end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
function TWinControl.AutoSizeDelayed: boolean; function TWinControl.AutoSizeDelayed: boolean;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TWinControl.AutoSizeDelayed: boolean; function TWinControl.AutoSizeDelayed: Boolean;
begin begin
Result:=(csDestroyingHandle in ControlState) Result:=(csDestroyingHandle in ControlState)
or (inherited AutoSizeDelayed); or (inherited AutoSizeDelayed);
@ -3755,7 +3755,7 @@ end;
The clientrect is cached. Call this procedure to invalidate the cache, so that The clientrect is cached. Call this procedure to invalidate the cache, so that
next time the clientrect is fetched from the interface. next time the clientrect is fetched from the interface.
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TWinControl.InvalidateClientRectCache(WithChildControls: boolean); procedure TWinControl.InvalidateClientRectCache(WithChildControls: Boolean);
var var
I: Integer; I: Integer;
begin begin
@ -3783,7 +3783,7 @@ end;
The clientrect is cached. Check if cache is valid. The clientrect is cached. Check if cache is valid.
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
function TWinControl.ClientRectNeedsInterfaceUpdate: boolean; function TWinControl.ClientRectNeedsInterfaceUpdate: Boolean;
var var
InterfaceWidth, InterfaceHeight: integer; InterfaceWidth, InterfaceHeight: integer;
IntfClientRect: TRect; IntfClientRect: TRect;
@ -3824,7 +3824,7 @@ end;
Changing the clientrect in the LCL to the most probable size reduces Changing the clientrect in the LCL to the most probable size reduces
unneccessary resizes. unneccessary resizes.
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TWinControl.DoSetBounds(ALeft, ATop, AWidth, AHeight : integer); procedure TWinControl.DoSetBounds(ALeft, ATop, AWidth, AHeight: Integer);
var var
OldWidth: LongInt; OldWidth: LongInt;
OldHeight: LongInt; OldHeight: LongInt;
@ -3934,7 +3934,7 @@ end;
Allow TControl as child. Allow TControl as child.
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
function TWinControl.ChildClassAllowed(ChildClass: TClass): boolean; function TWinControl.ChildClassAllowed(ChildClass: TClass): Boolean;
begin begin
Result:=(ChildClass<>nil) and ChildClass.InheritsFrom(TControl); Result:=(ChildClass<>nil) and ChildClass.InheritsFrom(TControl);
end; end;
@ -4136,7 +4136,7 @@ end;
If Scrolled is true, the rectangle is moved by the current scrolling values If Scrolled is true, the rectangle is moved by the current scrolling values
(for an example see TScrollingWincontrol). (for an example see TScrollingWincontrol).
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TWinControl.GetChildrenRect(Scrolled: boolean): TRect; function TWinControl.GetChildrenRect(Scrolled: Boolean): TRect;
var var
ScrolledOffset: TPoint; ScrolledOffset: TPoint;
begin begin
@ -4317,7 +4317,7 @@ end;
Send Move and Size messages through the LCL message paths. This simulates the Send Move and Size messages through the LCL message paths. This simulates the
VCL behaviour and has no real effect. VCL behaviour and has no real effect.
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TWinControl.SendMoveSizeMessages(SizeChanged, PosChanged: boolean); procedure TWinControl.SendMoveSizeMessages(SizeChanged, PosChanged: Boolean);
var var
SizeMsg : TLMSize; SizeMsg : TLMSize;
MoveMsg : TLMMove; MoveMsg : TLMMove;
@ -4450,7 +4450,7 @@ begin
Result := CanTab and (HandleAllocated and (FindOwnerControl(GetFocus)=Self)); Result := CanTab and (HandleAllocated and (FindOwnerControl(GetFocus)=Self));
end; end;
function TWinControl.PerformTab(ForwardTab: boolean): boolean; function TWinControl.PerformTab(ForwardTab: Boolean): Boolean;
var var
NewFocus: TWinControl; NewFocus: TWinControl;
ParentForm: TCustomForm; ParentForm: TCustomForm;
@ -4490,7 +4490,7 @@ end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
TWinControl FindChildControl TWinControl FindChildControl
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TWinControl.FindChildControl(const ControlName: String): TControl; function TWinControl.FindChildControl(const ControlName: string): TControl;
var var
I: Integer; I: Integer;
begin begin
@ -5059,7 +5059,7 @@ end;
(e.g. after KeyDown but before KeyPress). (e.g. after KeyDown but before KeyPress).
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TWinControl.IntfUTF8KeyPress(var UTF8Key: TUTF8Char; function TWinControl.IntfUTF8KeyPress(var UTF8Key: TUTF8Char;
RepeatCount: integer; SystemKey: boolean): boolean; RepeatCount: Integer; SystemKey: Boolean): Boolean;
begin begin
IncLCLRefCount; IncLCLRefCount;
try try
@ -5285,7 +5285,7 @@ end;
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
function TWinControl.GetControlIndex(AControl: TControl): integer; function TWinControl.GetControlIndex(AControl: TControl): Integer;
begin begin
if FControls <> nil then if FControls <> nil then
Result := FControls.IndexOf(AControl) Result := FControls.IndexOf(AControl)
@ -5298,7 +5298,7 @@ end;
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TWinControl.SetControlIndex(AControl: TControl; NewIndex: integer); procedure TWinControl.SetControlIndex(AControl: TControl; NewIndex: Integer);
begin begin
SetChildZPosition(AControl, NewIndex); SetChildZPosition(AControl, NewIndex);
end; end;
@ -5431,7 +5431,7 @@ begin
inherited WndProc(Message); inherited WndProc(Message);
end; end;
procedure TWinControl.WSSetText(const AText: String); procedure TWinControl.WSSetText(const AText: string);
begin begin
TWSWinControlClass(WidgetSetClass).SetText(Self, AText); TWSWinControlClass(WidgetSetClass).SetText(Self, AText);
end; end;
@ -5638,7 +5638,7 @@ begin
inherited DoFloatMsg(ADockSource); inherited DoFloatMsg(ADockSource);
end; end;
function TWinControl.GetDockCaption(AControl: TControl): String; function TWinControl.GetDockCaption(AControl: TControl): string;
begin begin
Result := AControl.GetDefaultDockCaption; Result := AControl.GetDefaultDockCaption;
DoGetDockCaption(AControl, Result); DoGetDockCaption(AControl, Result);
@ -5651,7 +5651,8 @@ begin
Exclude an currently undocking control. } Exclude an currently undocking control. }
end; end;
procedure TWinControl.DoGetDockCaption(AControl: TControl; var ACaption: String); procedure TWinControl.DoGetDockCaption(AControl: TControl; var ACaption: string
);
begin begin
if Assigned(FOnGetDockCaption) then if Assigned(FOnGetDockCaption) then
OnGetDockCaption(Self, AControl, ACaption); OnGetDockCaption(Self, AControl, ACaption);
@ -5843,7 +5844,7 @@ begin
Result := False; Result := False;
end; end;
function TWinControl.ChildKey(var Message: TLMKey): boolean; function TWinControl.ChildKey(var Message: TLMKey): Boolean;
begin begin
if Assigned(Parent) then if Assigned(Parent) then
Result := Parent.ChildKey(Message) Result := Parent.ChildKey(Message)
@ -5851,7 +5852,7 @@ begin
Result := false; Result := false;
end; end;
function TWinControl.DialogChar(var Message: TLMKey): boolean; function TWinControl.DialogChar(var Message: TLMKey): Boolean;
var var
I: integer; I: integer;
begin begin
@ -5987,7 +5988,7 @@ end;
Returns True if key handled Returns True if key handled
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TWinControl.DoUTF8KeyPress(var UTF8Key: TUTF8Char): boolean; function TWinControl.DoUTF8KeyPress(var UTF8Key: TUTF8Char): Boolean;
var var
AParent: TWinControl; AParent: TWinControl;
F: TCustomForm; F: TCustomForm;
@ -6158,7 +6159,7 @@ end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
procedure TWinControl.Insert(AControl: TControl; Index: integer); procedure TWinControl.Insert(AControl: TControl; Index: integer);
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TWinControl.Insert(AControl: TControl; Index: integer); procedure TWinControl.Insert(AControl: TControl; Index: Integer);
begin begin
if AControl = nil then exit; if AControl = nil then exit;
if AControl.FParent<>nil then if AControl.FParent<>nil then
@ -6295,13 +6296,13 @@ begin
Registered := True; Registered := True;
end; end;
function TWinControl.IsClientHeightStored: boolean; function TWinControl.IsClientHeightStored: Boolean;
begin begin
// The ClientHeight is needed to restore children anchored akBottom // The ClientHeight is needed to restore children anchored akBottom
Result:=ControlCount>0; Result:=ControlCount>0;
end; end;
function TWinControl.IsClientWidthStored: boolean; function TWinControl.IsClientWidthStored: Boolean;
begin begin
// The ClientWidth is needed to restore children anchored akRight // The ClientWidth is needed to restore children anchored akRight
Result:=ControlCount>0; Result:=ControlCount>0;
@ -6341,7 +6342,7 @@ begin
InsertControl(AControl, ControlCount); InsertControl(AControl, ControlCount);
end; end;
procedure TWinControl.InsertControl(AControl: TControl; Index: integer); procedure TWinControl.InsertControl(AControl: TControl; Index: Integer);
begin begin
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.InsertControl'){$ENDIF}; DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.InsertControl'){$ENDIF};
try try
@ -7727,7 +7728,7 @@ end;
Checks if all Handles of all Parents are created. Checks if all Handles of all Parents are created.
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TWinControl.ParentHandlesAllocated: boolean; function TWinControl.ParentHandlesAllocated: Boolean;
var var
CurControl: TWinControl; CurControl: TWinControl;
begin begin
@ -7968,7 +7969,7 @@ end;
decreases the BoundsLockCount decreases the BoundsLockCount
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TWinControl.GetIsResizing: boolean; function TWinControl.GetIsResizing: Boolean;
begin begin
Result:=BoundsLockCount>0; Result:=BoundsLockCount>0;
end; end;
@ -8045,7 +8046,7 @@ begin
end; end;
function TWinControl.DoDockClientMsg(DragDockObject: TDragDockObject; function TWinControl.DoDockClientMsg(DragDockObject: TDragDockObject;
aPosition: TPoint): boolean; aPosition: TPoint): Boolean;
var var
DestRect: TRect; DestRect: TRect;
Form: TCustomForm; Form: TCustomForm;
@ -8069,7 +8070,7 @@ begin
end; end;
end; end;
function TWinControl.DoUndockClientMsg(NewTarget, Client: TControl): boolean; function TWinControl.DoUndockClientMsg(NewTarget, Client: TControl): Boolean;
begin begin
Result := True; Result := True;
{$IFDEF VerboseDocking} {$IFDEF VerboseDocking}
@ -8086,7 +8087,7 @@ end;
Sets the bounds of the control. Sets the bounds of the control.
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TWinControl.SetBounds(ALeft, ATop, AWidth, AHeight: integer); procedure TWinControl.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
procedure CheckDesignBounds; procedure CheckDesignBounds;
begin begin
@ -8164,7 +8165,7 @@ end;
the widgetset. the widgetset.
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TWinControl.CalculatePreferredSize(var PreferredWidth, procedure TWinControl.CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; WithThemeSpace: Boolean); PreferredHeight: Integer; WithThemeSpace: Boolean);
{$IFDEF VerboseCalculatePreferredSize} {$IFDEF VerboseCalculatePreferredSize}
procedure trav(aControl: TControl; Prefix: string); procedure trav(aControl: TControl; Prefix: string);
@ -8263,7 +8264,7 @@ begin
{$ENDIF} {$ENDIF}
end; end;
procedure TWinControl.GetPreferredSizeClientFrame(out aWidth, aHeight: integer); procedure TWinControl.GetPreferredSizeClientFrame(out aWidth, aHeight: Integer);
begin begin
aWidth:=Width-ClientWidth; aWidth:=Width-ClientWidth;
aHeight:=Height-ClientHeight; aHeight:=Height-ClientHeight;