summaryrefslogtreecommitdiff
path: root/src/corelib/fpg_widget.pas
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/fpg_widget.pas')
-rw-r--r--src/corelib/fpg_widget.pas18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas
index 8fb68a04..527e2987 100644
--- a/src/corelib/fpg_widget.pas
+++ b/src/corelib/fpg_widget.pas
@@ -39,6 +39,8 @@ type
TfpgDragDropEvent = procedure(Sender, Source: TObject; X, Y: integer; AData: variant) of object;
+ { TfpgWidget }
+
TfpgWidget = class(TfpgWindow)
private
FAcceptDrops: boolean;
@@ -57,6 +59,7 @@ type
FOnMouseMove: TMouseMoveEvent;
FOnMouseUp: TMouseButtonEvent;
FOnMouseScroll: TMouseWheelEvent;
+ FOnMouseHorizScroll: TMouseWheelEvent;
FOnPaint: TPaintEvent;
FOnKeyPress: TKeyPressEvent;
FOnResize: TNotifyEvent;
@@ -82,6 +85,7 @@ type
procedure MsgMouseEnter(var msg: TfpgMessageRec); message FPGM_MOUSEENTER;
procedure MsgMouseExit(var msg: TfpgMessageRec); message FPGM_MOUSEEXIT;
procedure MsgMouseScroll(var msg: TfpgMessageRec); message FPGM_SCROLL;
+ procedure MsgMouseHorizScroll(var msg: TfpgMessageRec); message FPGM_HSCROLL;
procedure MsgDropEnter(var msg: TfpgMessageRec); message FPGM_DROPENTER;
procedure MsgDropExit(var msg: TfpgMessageRec); message FPGM_DROPEXIT;
protected
@@ -135,6 +139,7 @@ type
procedure HandleMouseEnter; virtual;
procedure HandleMouseExit; virtual;
procedure HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); virtual;
+ procedure HandleMouseHorizScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); virtual;
function FindFocusWidget(startwg: TfpgWidget; direction: TFocusSearchDirection): TfpgWidget;
procedure HandleAlignments(const dwidth, dheight: TfpgCoord); virtual;
procedure HandleShow; virtual;
@@ -155,6 +160,7 @@ type
property OnMouseMove: TMouseMoveEvent read FOnMouseMove write FOnMouseMove;
property OnMouseUp: TMouseButtonEvent read FOnMouseUp write FOnMouseUp;
property OnMouseScroll: TMouseWheelEvent read FOnMouseScroll write FOnMouseScroll;
+ property OnMouseHorizScroll: TMouseWheelEvent read FOnMouseHorizScroll write FOnMouseHorizScroll;
property OnPaint: TPaintEvent read FOnPaint write FOnPaint;
property OnResize: TNotifyEvent read FOnResize write FOnResize;
property OnShowHint: THintEvent read GetOnShowHint write SetOnShowHint;
@@ -862,6 +868,12 @@ begin
msg.Params.mouse.shiftstate, msg.Params.mouse.delta);
end;
+procedure TfpgWidget.MsgMouseHorizScroll(var msg: TfpgMessageRec);
+begin
+ HandleMouseHorizScroll(msg.Params.mouse.x, msg.Params.mouse.y,
+ msg.Params.mouse.shiftstate, msg.Params.mouse.delta);
+end;
+
procedure TfpgWidget.MsgDropEnter(var msg: TfpgMessageRec);
begin
// do nothing
@@ -1201,6 +1213,12 @@ begin
FOnMouseScroll(self, shiftstate, delta, Point(x, y));
end;
+procedure TfpgWidget.HandleMouseHorizScroll(x, y: integer; shiftstate: TShiftState; delta: smallint);
+begin
+ if Assigned(FOnMouseHorizScroll) then
+ FOnMouseHorizScroll(self, shiftstate, delta, Point(x, y));
+end;
+
function TfpgWidget.FindFocusWidget(startwg: TfpgWidget; direction: TFocusSearchDirection): TfpgWidget;
var
w: TfpgWidget;