mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-24 03:59:29 +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
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TNBPages.Clear;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
while FPageList.Count>0 do
|
||||
Delete(FPageList.Count-1);
|
||||
// remove the pages in reverse order but skip the Active Page,
|
||||
// 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;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user