mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-08 17:27:33 +01:00
LCL: reapply patch from Chronos to update PageIndex in PageControl after setting TabVisible. Issue #23251
git-svn-id: trunk@39883 -
This commit is contained in:
parent
8e1595bae1
commit
ca2fc53e25
@ -54,6 +54,8 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCustomPage.SetTabVisible(const AValue: Boolean);
|
||||
var
|
||||
TabCntrl: TCustomTabControl;
|
||||
begin
|
||||
if AValue = FTabVisible then Exit;
|
||||
FTabVisible := AValue;
|
||||
@ -63,16 +65,17 @@ begin
|
||||
|
||||
if Assigned(Parent) and Parent.HandleAllocated then
|
||||
begin
|
||||
TabCntrl := Parent as TCustomTabControl;
|
||||
if FTabVisible then
|
||||
begin
|
||||
// check if there was no visible tab
|
||||
if TCustomTabControl(Parent).PageIndex = -1 then
|
||||
TCustomTabControl(Parent).PageIndex:=PageIndex;
|
||||
begin // check if there was no visible tab
|
||||
if TabCntrl.PageIndex = -1 then
|
||||
TabCntrl.PageIndex := PageIndex
|
||||
else if TabCntrl.PageIndex >= PageIndex then
|
||||
TabCntrl.PageIndex := TabCntrl.PageIndex + 1;
|
||||
end
|
||||
else
|
||||
// Check if the page is active and set a new pageindex
|
||||
TCustomTabControl(Parent).PageRemoved(PageIndex);
|
||||
TCustomTabControl(Parent).AddRemovePageHandle(Self);
|
||||
else // Check if the page is active and set a new pageindex
|
||||
TabCntrl.PageRemoved(PageIndex);
|
||||
TabCntrl.AddRemovePageHandle(Self);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user