mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-15 12:29:32 +02:00
* editor mousewheel support patch from mantis #12081
git-svn-id: trunk@40832 -
This commit is contained in:
parent
a6aa3cc092
commit
846c708df6
@ -229,9 +229,12 @@ CONST
|
||||
{ MOUSE BUTTON STATE MASKS }
|
||||
{---------------------------------------------------------------------------}
|
||||
CONST
|
||||
mbLeftButton = $01; { Left mouse button }
|
||||
mbRightButton = $02; { Right mouse button }
|
||||
mbMiddleButton = $04; { Middle mouse button }
|
||||
mbLeftButton = $01; { Left mouse button }
|
||||
mbRightButton = $02; { Right mouse button }
|
||||
mbMiddleButton = $04; { Middle mouse button }
|
||||
mbScrollWheelDown = $08; { Scroll wheel down}
|
||||
mbScrollWheelUp = $10; { Scroll wheel up }
|
||||
|
||||
|
||||
{---------------------------------------------------------------------------}
|
||||
{ SCREEN CRT MODE CONSTANTS }
|
||||
|
@ -3422,6 +3422,7 @@ var
|
||||
E: TEvent;
|
||||
OldEvent : PEvent;
|
||||
CCAction: TCCAction;
|
||||
LinesScroll : sw_integer;
|
||||
begin
|
||||
CCAction:=ccClear;
|
||||
E:=Event;
|
||||
@ -3437,6 +3438,18 @@ begin
|
||||
case Event.What of
|
||||
evMouseDown :
|
||||
if MouseInView(Event.Where) then
|
||||
if (Event.Buttons=mbScrollWheelUp) then { mouse scroll up}
|
||||
begin
|
||||
LinesScroll:=1;
|
||||
if Event.Double then LinesScroll:=LinesScroll+4;
|
||||
ScrollTo(Delta.X, Delta.Y + LinesScroll);
|
||||
end else
|
||||
if (Event.Buttons=mbScrollWheelDown) then { mouse scroll down }
|
||||
begin
|
||||
LinesScroll:=-1;
|
||||
if Event.Double then LinesScroll:=LinesScroll-4;
|
||||
ScrollTo(Delta.X, Delta.Y + LinesScroll);
|
||||
end else
|
||||
if (Event.Buttons=mbRightButton) then
|
||||
begin
|
||||
MakeLocal(Event.Where,P); Inc(P.X); Inc(P.Y);
|
||||
|
Loading…
Reference in New Issue
Block a user