//ecSyntMemo.pas

//TCustomSyntaxMemo
  private
    function DoMouseWheelUpDown(Up: boolean; Shift: TShiftState): Boolean;//AT
  protected
    function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override;//AT
    function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override;//AT

function TCustomSyntaxMemo.DoMouseWheelUpDown(Up: boolean; Shift: TShiftState): Boolean;
const
  cMultiplyX = 10;
var
  Delta: Integer;
begin
  Delta := Mouse.WheelScrollLines;
  if Up then
    Delta := -Delta;
  if ssShift in Shift then
    ScrollPosX := ScrollPosX + Delta*cMultiplyX
  else
    ScrollPosY := ScrollPosY + Delta;
  ResetHint;
  Result := true;
end;

function TCustomSyntaxMemo.DoMouseWheelUp(Shift: TShiftState;
  MousePos: TPoint): Boolean;
begin
  Result := DoMouseWheelUpDown(True, Shift);
end;

function TCustomSyntaxMemo.DoMouseWheelDown(Shift: TShiftState;
  MousePos: TPoint): Boolean;
begin
  Result := DoMouseWheelUpDown(False, Shift);
end;

