mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 23:22:08 +02:00
cocoa: adding automatic largeInc determination based of the page size
git-svn-id: trunk@62661 -
This commit is contained in:
parent
9a9174aa69
commit
cdede4ea6f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user