* editor mousewheel support patch from mantis #12081

git-svn-id: trunk@40832 -
This commit is contained in:
marco 2019-01-10 10:51:09 +00:00
parent a6aa3cc092
commit 846c708df6
2 changed files with 19 additions and 3 deletions

View File

@ -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 }

View File

@ -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);