mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 17:00:38 +02:00
LCL: add or remove page in TabVisible setter only if Parent.HandleAllocated
git-svn-id: trunk@14183 -
This commit is contained in:
parent
9f6b7ab596
commit
591cd49108
@ -61,16 +61,19 @@ begin
|
||||
if csDesigning in ComponentState then
|
||||
Exit;
|
||||
|
||||
TCustomNotebook(Parent).AddRemovePageHandle(Self);
|
||||
if FTabVisible then
|
||||
if Parent.HandleAllocated then
|
||||
begin
|
||||
// check if there was no visible tab
|
||||
if TCustomNotebook(Parent).PageIndex = -1 then
|
||||
TCustomNotebook(Parent).PageIndex:=PageIndex;
|
||||
end
|
||||
else
|
||||
// Check if the page is active and set a new pageindex
|
||||
TCustomNotebook(Parent).PageRemoved(PageIndex);
|
||||
TCustomNotebook(Parent).AddRemovePageHandle(Self);
|
||||
if FTabVisible then
|
||||
begin
|
||||
// check if there was no visible tab
|
||||
if TCustomNotebook(Parent).PageIndex = -1 then
|
||||
TCustomNotebook(Parent).PageIndex:=PageIndex;
|
||||
end
|
||||
else
|
||||
// Check if the page is active and set a new pageindex
|
||||
TCustomNotebook(Parent).PageRemoved(PageIndex);
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user