FMX.Controls.TControl.MouseWheel
Delphi
procedure MouseWheel(Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean); virtual;
C++
virtual void __fastcall MouseWheel(System::Classes::TShiftState Shift, int WheelDelta, bool &Handled);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
protected | FMX.Controls.pas FMX.Controls.hpp |
FMX.Controls | TControl |
Description
OnMouseWheel event dispatcher.
A control calls MouseWheel in response to any of mouse wheel messages, decoding the message parameters into the shift-key state, wheel rotation, and handle, which it passes in the Shift
, WheelDelta
, and Handled
parameters, respectively:
Shift
indicates which shift keys--SHIFT, CTRL, ALT, and CMD (only for Mac)--were down when the pressed mouse button is released.WheelDelta
indicates the distance the wheel was rotated.WheelDelta
is positive if the mouse was rotated upward, negative if the mouse was rotated downward.Handled
indicates whether the scroll bar was already moved, depending on theWheelDelta
value. If one of the scrolls bars (vertical or horizontal) was already handled or it does not exist, MouseWheel tries to apply the rolling on the other scroll bar, if it exists.
Override the protected MouseWheel method to provide other responses when the mouse wheel is rotated while the cursor is over the control.