mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-21 16:19:24 +02:00
source editor now switches to the right, instead of the left when deleting a page from Alexandre Leclerc
git-svn-id: trunk@9613 -
This commit is contained in:
parent
21e56d495e
commit
8cc91672fe
@ -4974,16 +4974,19 @@ Begin
|
|||||||
Visible:=true;
|
Visible:=true;
|
||||||
TempEditor.Close;
|
TempEditor.Close;
|
||||||
TempEditor.Free;
|
TempEditor.Free;
|
||||||
if Notebook.PageCount>1 then begin
|
if Notebook.PageCount>1 then
|
||||||
|
begin
|
||||||
//writeln('TSourceNotebook.CloseFile B PageIndex=',PageIndex);
|
//writeln('TSourceNotebook.CloseFile B PageIndex=',PageIndex);
|
||||||
// if this is the current page, switch to left PageIndex
|
// if this is the current page, switch to right PageIndex (if possible)
|
||||||
if (Notebook.PageIndex=PageIndex) and (PageIndex>0) then
|
if (Notebook.PageIndex = PageIndex) then
|
||||||
Notebook.PageIndex:=PageIndex-1;
|
Notebook.PageIndex := PageIndex +
|
||||||
|
IfThen(PageIndex + 1 < Notebook.PageCount, 1, -1);
|
||||||
// delete the page
|
// delete the page
|
||||||
Notebook.Pages.Delete(PageIndex);
|
Notebook.Pages.Delete(PageIndex);
|
||||||
//writeln('TSourceNotebook.CloseFile C PageIndex=',PageIndex,' Notebook.PageCount=',Notebook.PageCount);
|
//writeln('TSourceNotebook.CloseFile C PageIndex=',PageIndex,' Notebook.PageCount=',Notebook.PageCount);
|
||||||
UpdateStatusBar;
|
UpdateStatusBar;
|
||||||
end else begin
|
end else
|
||||||
|
begin
|
||||||
//writeln('TSourceNotebook.CloseFile D PageIndex=',PageIndex);
|
//writeln('TSourceNotebook.CloseFile D PageIndex=',PageIndex);
|
||||||
Notebook.Free;
|
Notebook.Free;
|
||||||
//writeln('TSourceNotebook.CloseFile E PageIndex=',PageIndex);
|
//writeln('TSourceNotebook.CloseFile E PageIndex=',PageIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user