mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-16 08:19:41 +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;
|
sz : Integer;
|
||||||
dlt : double;
|
dlt : double;
|
||||||
v : 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
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
case prt of
|
case prt of
|
||||||
NSScrollerDecrementPage: adj := -sc.largeInc;
|
NSScrollerDecrementPage: begin
|
||||||
NSScrollerIncrementPage: adj := sc.largeInc;
|
adj := -sc.largeInc;
|
||||||
NSScrollerDecrementLine: adj := -sc.smallInc;
|
if adj = 0 then
|
||||||
NSScrollerIncrementLine: adj := sc.smallInc;
|
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
|
else
|
||||||
adj := 0;
|
adj := 0;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user