mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 22:49:30 +02:00
lcl: prevent removing neighbor Tab on changing TabVisible
git-svn-id: trunk@12596 -
This commit is contained in:
parent
8039ec242a
commit
5242f5d1c4
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user