lcl: prevent removing neighbor Tab on changing TabVisible

git-svn-id: trunk@12596 -
This commit is contained in:
paul 2007-10-26 09:21:07 +00:00
parent 8039ec242a
commit 5242f5d1c4
2 changed files with 8 additions and 12 deletions

View File

@ -560,11 +560,13 @@ begin
{$IFDEF NOTEBOOK_DEBUG}
DebugLn(['TCustomNoteBook.AddRemovePageHandle REMOVE ',DbgSName(APage),' pfAdded=',pfAdded in APage.FFlags]);
{$ENDIF}
if not (pfAdded in APage.FFlags) then exit;
Exclude(APage.FFlags,pfAdded);
if not (pfAdded in APage.FFlags) or (pfRemoving in APage.FFlags) then
exit;
APage.FFlags := APage.FFlags - [pfAdded] + [pfRemoving];
TWSCustomNotebookClass(WidgetSetClass).RemovePage(Self, APage.VisibleIndex);
if APage.HandleAllocated then
APage.DestroyHandle;
Exclude(APage.FFlags, pfRemoving);
end;
end;

View File

@ -106,16 +106,10 @@ begin
and (OldParent is TCustomNotebook)
and (not (pfRemoving in FFlags)) then begin
// remove from old pagelist
ParentNotebook:=TCustomNotebook(OldParent);
i:=PageIndex;
if i>=0 then begin
Include(FFlags,pfRemoving);
try
ParentNotebook.RemovePage(i);
finally
Exclude(FFlags,pfRemoving);
end;
end;
ParentNotebook := TCustomNotebook(OldParent);
i := PageIndex;
if i >= 0 then
ParentNotebook.RemovePage(i);
end;
inherited SetParent(AParent);