mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 07:29:30 +02:00
Revert "LCL: Update PageIndex in PageControl after setting TabVisible", does not work when IDE is built for GTK2. Issue #23648
git-svn-id: trunk@39869 -
This commit is contained in:
parent
459cdc0ca9
commit
154caf4c01
@ -54,28 +54,25 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCustomPage.SetTabVisible(const AValue: Boolean);
|
||||
var
|
||||
TabCntrl: TCustomTabControl;
|
||||
begin
|
||||
if AValue = FTabVisible then Exit;
|
||||
FTabVisible := AValue;
|
||||
|
||||
|
||||
if csDesigning in ComponentState then
|
||||
Exit;
|
||||
|
||||
if Assigned(Parent) and Parent.HandleAllocated then
|
||||
begin
|
||||
TabCntrl := Parent as TCustomTabControl;
|
||||
if FTabVisible then
|
||||
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;
|
||||
begin
|
||||
// check if there was no visible tab
|
||||
if TCustomTabControl(Parent).PageIndex = -1 then
|
||||
TCustomTabControl(Parent).PageIndex:=PageIndex;
|
||||
end
|
||||
else // Check if the page is active and set a new pageindex
|
||||
TabCntrl.PageRemoved(PageIndex);
|
||||
TabCntrl.AddRemovePageHandle(Self);
|
||||
else
|
||||
// Check if the page is active and set a new pageindex
|
||||
TCustomTabControl(Parent).PageRemoved(PageIndex);
|
||||
TCustomTabControl(Parent).AddRemovePageHandle(Self);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user