cocoa: adding automatic largeInc determination based of the page size

git-svn-id: trunk@62661 -
This commit is contained in:
dmitry 2020-02-23 03:36:30 +00:00
parent 9a9174aa69
commit cdede4ea6f

View File

@ -180,13 +180,38 @@ var
sz : Integer;
dlt : double;
v : double;
const
WinPageOfs : integer = 64; // this is an "ofset" of the pageInc used in Windows
// so the click on "large" makes two pages overlap
begin
Result := false;
case prt of
NSScrollerDecrementPage: adj := -sc.largeInc;
NSScrollerIncrementPage: adj := sc.largeInc;
NSScrollerDecrementLine: adj := -sc.smallInc;
NSScrollerIncrementLine: adj := sc.smallInc;
NSScrollerDecrementPage: begin
adj := -sc.largeInc;
if adj = 0 then
begin
adj := -sc.pageInt;
if (sc.PageInt>WinPageOfs) then
inc(adj, WinPageOfs);
end;
end;
NSScrollerIncrementPage: begin
adj := sc.largeInc;
if adj = 0 then
begin
adj := sc.pageInt;
if (sc.PageInt>WinPageOfs) then
dec(adj, WinPageOfs);
end;
end;
NSScrollerDecrementLine: begin
adj := -sc.smallInc;
if adj = 0 then adj := -1;
end;
NSScrollerIncrementLine: begin
adj := sc.smallInc;
if adj = 0 then adj := 1;
end;
else
adj := 0;
end;