mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 12:16:18 +02:00
LCL: Extend horizontal mouse wheel messages for Grid and TreeView. Issue #32753, patch from AlexeyT.
git-svn-id: trunk@56654 -
This commit is contained in:
parent
bd004732eb
commit
d171170bb6
@ -3462,6 +3462,8 @@ type
|
||||
procedure DoEndDrag(Target: TObject; X, Y: Integer); override;
|
||||
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;
|
||||
MousePos: TPoint): Boolean; override;
|
||||
function DoMouseWheelHorz(Shift: TShiftState; WheelDelta: Integer;
|
||||
MousePos: TPoint): Boolean; override;
|
||||
procedure DoPaint; virtual;
|
||||
procedure DoPaintNode(Node: TTreeNode); virtual;
|
||||
procedure DoStartDrag(var DragObject: TDragObject); override;
|
||||
|
@ -982,6 +982,8 @@ type
|
||||
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override;
|
||||
function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override;
|
||||
function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override;
|
||||
function DoMouseWheelLeft(Shift: TShiftState; MousePos: TPoint): Boolean; override;
|
||||
function DoMouseWheelRight(Shift: TShiftState; MousePos: TPoint): Boolean; override;
|
||||
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||
const AXProportion, AYProportion: Double); override;
|
||||
procedure DoOnChangeBounds; override;
|
||||
@ -7150,6 +7152,30 @@ begin
|
||||
{$ifdef dbgScroll}DebugLn('doMouseWheelUP END');{$endif}
|
||||
end;
|
||||
|
||||
function TCustomGrid.DoMouseWheelLeft(Shift: TShiftState; MousePos: TPoint
|
||||
): Boolean;
|
||||
begin
|
||||
{$ifdef dbgScroll}DebugLn('doMouseWheelLEFT INIT');{$endif}
|
||||
Result:=inherited DoMouseWheelLeft(Shift, MousePos);
|
||||
if not Result then begin
|
||||
GridMouseWheel([ssCtrl], -1);
|
||||
Result := True; // handled, no further scrolling by the widgetset
|
||||
end;
|
||||
{$ifdef dbgScroll}DebugLn('doMouseWheelLEFT END');{$endif}
|
||||
end;
|
||||
|
||||
function TCustomGrid.DoMouseWheelRight(Shift: TShiftState; MousePos: TPoint
|
||||
): Boolean;
|
||||
begin
|
||||
{$ifdef dbgScroll}DebugLn('doMouseWheelRIGHT INIT');{$endif}
|
||||
Result:=inherited DoMouseWheelRight(Shift, MousePos);
|
||||
if not Result then begin
|
||||
GridMouseWheel([ssCtrl], 1);
|
||||
Result := True; // handled, no further scrolling by the widgetset
|
||||
end;
|
||||
{$ifdef dbgScroll}DebugLn('doMouseWheelRIGHT END');{$endif}
|
||||
end;
|
||||
|
||||
procedure TCustomGrid.DoOnChangeBounds;
|
||||
var
|
||||
OldTopLeft: TPoint;
|
||||
|
@ -4698,6 +4698,23 @@ begin
|
||||
UpdateTooltip(MousePos.X, MousePos.Y);
|
||||
end;
|
||||
|
||||
function TCustomTreeView.DoMouseWheelHorz(Shift: TShiftState;
|
||||
WheelDelta: Integer; MousePos: TPoint): Boolean;
|
||||
var
|
||||
NDelta: integer;
|
||||
const
|
||||
cScrollStep = 50;
|
||||
begin
|
||||
Result:=inherited DoMouseWheelHorz(Shift, WheelDelta, MousePos);
|
||||
if not Result then
|
||||
begin
|
||||
NDelta := (WheelDelta * cScrollStep) div 120;
|
||||
ScrolledLeft := ScrolledLeft + NDelta;
|
||||
Result := true;
|
||||
end;
|
||||
UpdateTooltip(MousePos.X, MousePos.Y);
|
||||
end;
|
||||
|
||||
function TCustomTreeView.DoDragMsg(ADragMessage: TDragMessage; APosition: TPoint; ADragObject: TDragObject; ATarget: TControl; ADocking: Boolean):LRESULT;
|
||||
begin
|
||||
Result:=inherited;
|
||||
|
Loading…
Reference in New Issue
Block a user