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;
|
end;
|
||||||
|
|
||||||
procedure TCEPageControl.movePageRight;
|
procedure TCEPageControl.movePageRight;
|
||||||
|
var
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
if fPageIndex = fPages.Count-1 then
|
if fPageIndex = fPages.Count-1 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
fPages.Exchange(fPageIndex, fPageIndex + 1);
|
fPages.Exchange(fPageIndex, fPageIndex + 1);
|
||||||
fTabs.Tabs.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
|
if fPageIndex = fSplittedPageIndex then
|
||||||
fSplittedPageIndex += 1;
|
fSplittedPageIndex += 1;
|
||||||
setPageIndex(fPageIndex+1);
|
setPageIndex(fPageIndex+1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEPageControl.movePageLeft;
|
procedure TCEPageControl.movePageLeft;
|
||||||
|
var
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
if fPageIndex <= 0 then
|
if fPageIndex <= 0 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
fPages.Exchange(fPageIndex, fPageIndex - 1);
|
fPages.Exchange(fPageIndex, fPageIndex - 1);
|
||||||
fTabs.Tabs.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
|
if fPageIndex = fSplittedPageIndex then
|
||||||
fSplittedPageIndex -= 1;
|
fSplittedPageIndex -= 1;
|
||||||
setPageIndex(fPageIndex-1);
|
setPageIndex(fPageIndex-1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue