summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorAndrew Haines <andrewd207@aol.com>2010-11-09 02:41:21 -0500
committerAndrew Haines <andrewd207@aol.com>2010-11-09 02:41:21 -0500
commit34712a70bbce960920df25c533b3ecd5dfc8023d (patch)
tree59cf677e61742511a6e3e24af5cf8b295fac3d2b /src/corelib
parent0b55c3504c406bfd408b5f9f29ab7cff4e300924 (diff)
downloadfpGUI-34712a70bbce960920df25c533b3ecd5dfc8023d.tar.xz
* Added property IgnoreDblClicks to TfpgWidget
* TfpgButton now ignores double clicks by default
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/fpg_widget.pas4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas
index 5e3ba007..f46c486a 100644
--- a/src/corelib/fpg_widget.pas
+++ b/src/corelib/fpg_widget.pas
@@ -98,6 +98,7 @@ type
FTextColor: TfpgColor;
FIsContainer: Boolean;
FOnClickPending: Boolean;
+ FIgnoreDblClicks: Boolean;
procedure SetAcceptDrops(const AValue: boolean); virtual;
function GetOnShowHint: THintEvent; virtual;
procedure SetOnShowHint(const AValue: THintEvent); virtual;
@@ -177,6 +178,7 @@ type
property Anchors: TAnchors read FAnchors write FAnchors default [anLeft, anTop];
property Align: TAlign read FAlign write SetAlign default alNone;
property Hint: TfpgString read GetHint write SetHint;
+ property IgnoreDblClicks: Boolean read FIgnoreDblClicks write FIgnoreDblClicks;
property ShowHint: boolean read FShowHint write SetShowHint stored IsShowHintStored;
property ParentShowHint: boolean read FParentShowHint write SetParentShowHint default True;
property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor default clWindowBackground;
@@ -671,7 +673,7 @@ begin
begin
FOnClickPending := True;
mb := mbLeft;
- if uLastClickWidget = self then
+ if (uLastClickWidget = self) and (not FIgnoreDblClicks) then
IsDblClick := ((fpgGetTickCount - uLastClickTime) <= DOUBLECLICK_MS)
and (Abs(uLastClickPoint.x - msg.Params.mouse.x) <= DOUBLECLICK_DISTANCE)
and (Abs(uLastClickPoint.y - msg.Params.mouse.y) <= DOUBLECLICK_DISTANCE)