mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-07 18:06:01 +02:00
Merge branch 'lcl/notebook' into 'main'
FIX #40019: LCL/TPageControl: FIX algorithm of clear tabs in TNBPages.Clear() See merge request freepascal.org/lazarus/lazarus!122
This commit is contained in:
commit
1af6a0e61f
@ -105,9 +105,15 @@ end;
|
|||||||
TNBPages Clear
|
TNBPages Clear
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TNBPages.Clear;
|
procedure TNBPages.Clear;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
while FPageList.Count>0 do
|
// remove the pages in reverse order but skip the Active Page,
|
||||||
Delete(FPageList.Count-1);
|
// and remove the Active Page at the end,
|
||||||
|
// to avoid activating other Pages.
|
||||||
|
for i:=FNoteBook.PageCount-1 downto 0 do
|
||||||
|
if i<>FNoteBook.PageIndex then Delete(i);
|
||||||
|
if FNoteBook.PageCount>0 then Delete(0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user