diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-09-13 17:10:30 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-09-23 16:24:33 +0200 |
commit | 48e0a74aa9c2f732fc9a321823c365e3d7ae6b11 (patch) | |
tree | 2c48eab8073a2462a75b41d0a5cd5d3022fd9f21 /src | |
parent | b28c7e171686534db28e13355431d61d95b35dde (diff) | |
download | fpGUI-48e0a74aa9c2f732fc9a321823c365e3d7ae6b11.tar.xz |
Adds new boolean property AcceptDrops to TfpgWidget.
This will enable/disable drop support per widget.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/fpg_widget.pas | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas index 4e48aa75..589ab720 100644 --- a/src/corelib/fpg_widget.pas +++ b/src/corelib/fpg_widget.pas @@ -37,6 +37,7 @@ type TfpgWidget = class(TfpgWindow) private + FAcceptDrops: boolean; FAlignRect: TfpgRect; FOnClick: TNotifyEvent; FOnDoubleClick: TMouseButtonEvent; @@ -85,6 +86,7 @@ type FBackgroundColor: TfpgColor; FTextColor: TfpgColor; FIsContainer: Boolean; + procedure SetAcceptDrops(const AValue: boolean); virtual; function GetOnShowHint: THintEvent; virtual; procedure SetOnShowHint(const AValue: THintEvent); virtual; procedure SetBackgroundColor(const AValue: TfpgColor); virtual; @@ -151,6 +153,7 @@ type procedure Invalidate; // double check this works as developers expect???? property FormDesigner: TObject read FFormDesigner write SetFormDesigner; property Parent: TfpgWidget read GetParent write SetParent; + property AcceptDrops: boolean read FAcceptDrops write SetAcceptDrops; property ActiveWidget: TfpgWidget read FActiveWidget write SetActiveWidget; property IsContainer: Boolean read FIsContainer; property Visible: boolean read FVisible write SetVisible default True; @@ -233,6 +236,13 @@ begin FActiveWidget.HandleSetFocus; end; +procedure TfpgWidget.SetAcceptDrops(const AValue: boolean); +begin + if FAcceptDrops = AValue then + exit; + FAcceptDrops := AValue; +end; + function TfpgWidget.GetHint: TfpgString; begin Result := FHint; @@ -405,7 +415,8 @@ begin FShowHint := False; FParentShowHint := True; FBackgroundColor := clWindowBackground; - FTextColor := clText1; + FTextColor := clText1; + FAcceptDrops := False; inherited Create(AOwner); |