SpinEditEx: implement increment/decrement with mousewheel.

git-svn-id: trunk@55023 -
This commit is contained in:
bart 2017-05-20 11:53:38 +00:00
parent 083ef5923c
commit d396b86379
3 changed files with 20 additions and 2 deletions

View File

@ -212,6 +212,22 @@ begin
if (Key = '-') and IsLimited and (MinValue >= 0) then Key := #0;
end;
procedure TCustomFloatSpinEditEx.EditMouseWheelUp(Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
inherited EditMouseWheelUp(Shift, MousePos, Handled);
if not Handled then
SpinUpDown(True);
end;
procedure TCustomFloatSpinEditEx.EditMouseWheelDown(Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
inherited EditMouseWheelDown(Shift, MousePos, Handled);
if not Handled then
SpinUpDown(False);
end;
procedure TCustomFloatSpinEditEx.SetValue(const AValue: Double);
var

View File

@ -124,6 +124,8 @@ type
procedure EditChange; override;
procedure EditKeyDown(var Key: word; Shift: TShiftState); override;
procedure EditKeyPress(var Key: char); override;
procedure EditMouseWheelUp(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); override;
procedure EditMouseWheelDown(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); override;
procedure SetDecimals(ADecimals: Integer); virtual;
procedure SetValue(const AValue: Double); virtual;
procedure SetNullValue(AValue: Double); virtual;

View File

@ -228,8 +228,8 @@ type
procedure EditMouseMove(Shift: TShiftState; X, Y: Integer); virtual;
procedure EditMouseWheel(Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
procedure EditMouseWheelUp(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
procedure EditMouseWheelDown(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
procedure EditMouseWheelUp(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); virtual;
procedure EditMouseWheelDown(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); virtual;
procedure EditUtf8KeyPress(var UTF8Key: TUTF8Char); virtual;
procedure EditStartDrag(var DragObject: TDragObject); virtual;