LCL: Update Caption of a TPageControl when something is docked there. Issue , patch by Anton Kavalenka.

This commit is contained in:
Juha 2024-07-31 00:18:42 +03:00
parent 85bf6be863
commit d944f9f554
2 changed files with 10 additions and 1 deletions

View File

@ -592,6 +592,7 @@ type
procedure DoRemoveDockClient(Client: TControl); override;
function DoUndockClientMsg(NewTarget, Client: TControl):boolean; override;
function ChildClassAllowed(ChildClass: TClass): boolean; override;
procedure UpdateDockCaption(Exclude: TControl = nil); override;
public
procedure Clear;
function FindNextPage(CurPage: TTabSheet;

View File

@ -116,7 +116,15 @@ begin
if Widgetset.GetLCLCapability(lcAllowChildControlsInNativeControls) = LCL_CAPABILITY_YES then Result := True;
end;
procedure TPageControl.UpdateDockCaption(Exclude: TControl = nil);
var
i:integer;
begin
for i:=0 to Self.PageCount-1 do
with Pages[i] do
if ControlCount>0 then
Caption:=Controls[0].Caption;
end;
function TPageControl.FindNextPage(CurPage: TTabSheet; GoForward,
CheckTabVisible: Boolean): TTabSheet;