diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2014-01-24 23:06:44 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-01-24 23:06:44 +0000 |
commit | 76c82447b036f19565958200a9e801af1d797ac2 (patch) | |
tree | 5d4963833d9d369ce146d9361abbec24ab6b6257 /src | |
parent | b12b0b58d216926c1bae99e3315d074e522371ea (diff) | |
download | fpGUI-76c82447b036f19565958200a9e801af1d797ac2.tar.xz |
GDI: Fixes mouse wheel scrolling bug on newer Windows versions.
For some odd reason under Win7 only downward scrolling was working. This
changes fixes it. Tested on Win2000 and Win7 systems.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/gdi/fpg_gdi.pas | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index 6f3510fb..d065bb4c 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -706,6 +706,7 @@ var wmsg: TMsg; PaintStruct: TPaintStruct; TmpW: widestring; + wheelpos: integer; //------------ procedure SetMinMaxInfo(var MinMaxInfo: TMINMAXINFO); @@ -1091,7 +1092,13 @@ begin begin msgp.mouse.x := pt.x; msgp.mouse.y := pt.y; - msgp.mouse.delta := SmallInt(HiWord(wParam)) div -120; + { calculate direction of the mouse wheel } + wheelpos := 0; + dec(wheelpos, SmallInt(HiWord(wParam))); + if wheelpos > 0 then + msgp.mouse.delta := 1 + else + msgp.mouse.delta := -1; i := 0; if (wParam and MK_LBUTTON) <> 0 then |