mirror of https://gitlab.com/basile.b/dexed.git
made page hisotry compatible with move page left/right
This commit is contained in:
parent
5ba68af663
commit
a850d00d27
|
|
@ -450,26 +450,52 @@ begin
|
|||
end;
|
||||
|
||||
procedure TCEPageControl.movePageRight;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
if fPageIndex = fPages.Count-1 then
|
||||
exit;
|
||||
|
||||
fPages.Exchange(fPageIndex, fPageIndex + 1);
|
||||
fTabs.Tabs.Exchange(fPageIndex, fPageIndex + 1);
|
||||
|
||||
{$PUSH}{$HINTS OFF}{$WARNINGS OFF}
|
||||
for i := 0 to fPagesHistory.Count-1 do
|
||||
begin
|
||||
if PtrInt(fPagesHistory[i]) = fPageIndex then
|
||||
fPagesHistory[i] := Pointer(PtrInt(fPageIndex+1))
|
||||
else if PtrInt(fPagesHistory[i]) = fPageIndex+1 then
|
||||
fPagesHistory[i] := Pointer(PtrInt(fPageIndex))
|
||||
end;
|
||||
{$POP}
|
||||
|
||||
if fPageIndex = fSplittedPageIndex then
|
||||
fSplittedPageIndex += 1;
|
||||
setPageIndex(fPageIndex+1);
|
||||
end;
|
||||
|
||||
procedure TCEPageControl.movePageLeft;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
if fPageIndex <= 0 then
|
||||
exit;
|
||||
|
||||
fPages.Exchange(fPageIndex, fPageIndex - 1);
|
||||
fTabs.Tabs.Exchange(fPageIndex, fPageIndex - 1);
|
||||
|
||||
{$PUSH}{$HINTS OFF}{$WARNINGS OFF}
|
||||
for i := 0 to fPagesHistory.Count-1 do
|
||||
begin
|
||||
if PtrInt(fPagesHistory[i]) = fPageIndex then
|
||||
fPagesHistory[i] := Pointer(PtrInt(fPageIndex-1))
|
||||
else if PtrInt(fPagesHistory[i]) = fPageIndex-1 then
|
||||
fPagesHistory[i] := Pointer(PtrInt(fPageIndex))
|
||||
end;
|
||||
{$POP}
|
||||
|
||||
if fPageIndex = fSplittedPageIndex then
|
||||
fSplittedPageIndex -= 1;
|
||||
fSplittedPageIndex -= 1;
|
||||
setPageIndex(fPageIndex-1);
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue