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:
mattias 2006-07-14 22:39:38 +00:00
parent 21e56d495e
commit 8cc91672fe

View File

@ -4974,16 +4974,19 @@ Begin
Visible:=true;
TempEditor.Close;
TempEditor.Free;
if Notebook.PageCount>1 then begin
if Notebook.PageCount>1 then
begin
//writeln('TSourceNotebook.CloseFile B PageIndex=',PageIndex);
// if this is the current page, switch to left PageIndex
if (Notebook.PageIndex=PageIndex) and (PageIndex>0) then
Notebook.PageIndex:=PageIndex-1;
// if this is the current page, switch to right PageIndex (if possible)
if (Notebook.PageIndex = PageIndex) then
Notebook.PageIndex := PageIndex +
IfThen(PageIndex + 1 < Notebook.PageCount, 1, -1);
// delete the page
Notebook.Pages.Delete(PageIndex);
//writeln('TSourceNotebook.CloseFile C PageIndex=',PageIndex,' Notebook.PageCount=',Notebook.PageCount);
UpdateStatusBar;
end else begin
end else
begin
//writeln('TSourceNotebook.CloseFile D PageIndex=',PageIndex);
Notebook.Free;
//writeln('TSourceNotebook.CloseFile E PageIndex=',PageIndex);