diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-12-14 07:07:18 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-12-14 07:07:18 +0000 |
commit | fcb239976a2acb067511c25c8f020668883341f7 (patch) | |
tree | 4dac201f1274d833dd58c7b184f2d5f2eec5c7df /src/corelib | |
parent | 2f927a6acb4a28145ce1c32a4f4b24cdcdaf0d98 (diff) | |
download | fpGUI-fcb239976a2acb067511c25c8f020668883341f7.tar.xz |
* Implemented a OnClick event in TfpgWidget.
* published OnClick and OnDoubleClick in TfpgLabel, TfpgButton, TfpgBevel.
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/gfx_widget.pas | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas index d881bd1a..49ece1f8 100644 --- a/src/corelib/gfx_widget.pas +++ b/src/corelib/gfx_widget.pas @@ -17,6 +17,7 @@ type TfpgWidget = class(TfpgWindow) private FAlignRect: TfpgRect; + FOnClick: TNotifyEvent; FOnDoubleClick: TMouseButtonEvent; FOnMouseDown: TMouseButtonEvent; FOnMouseEnter: TNotifyEvent; @@ -87,6 +88,7 @@ type property OnMouseMove: TMouseMoveEvent read FOnMouseMove write FOnMouseMove; property OnMouseDown: TMouseButtonEvent read FOnMouseDown write FOnMouseDown; property OnMouseUp: TMouseButtonEvent read FOnMouseUp write FOnMouseUp; + property OnClick: TNotifyEvent read FOnClick write FOnClick; property OnDoubleClick: TMouseButtonEvent read FOnDoubleClick write FOnDoubleClick; property OnKeyPress: TKeyPressEvent read FOnKeyPress write FOnKeyPress; public @@ -384,7 +386,10 @@ begin if Assigned(FOnDoubleClick) then FOnDoubleClick(self, mb, msg.Params.mouse.shiftstate, Point(msg.Params.mouse.x, msg.Params.mouse.y)); - end; + end + else + if Assigned(FOnClick) then + FOnClick(self); // The mouse up must still be handled even if we had a double click event. HandleLMouseUp(msg.Params.mouse.x, msg.Params.mouse.y, msg.Params.mouse.shiftstate); end; |