LCL: add or remove page in TabVisible setter only if Parent.HandleAllocated

git-svn-id: trunk@14183 -
This commit is contained in:
tombo 2008-02-18 14:44:29 +00:00
parent 9f6b7ab596
commit 591cd49108

View File

@ -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;
{------------------------------------------------------------------------------