diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2015-08-18 15:42:02 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2015-08-22 09:08:43 +0100 |
commit | dbd547b619aaad509bbac6928b8e7d689b2ec795 (patch) | |
tree | d668c8208a82e4069c2cf530052e559db55e81c6 | |
parent | 6a1f2b06c5c11288afd376a6310ff088484768e9 (diff) | |
download | fpGUI-dbd547b619aaad509bbac6928b8e7d689b2ec795.tar.xz |
fpg_spinedit: Introduced a new overloaded CreateSpinEdit() function.
It is a bit more simplified, and only sets essential properties, leaving
the rest as widget defaults.
-rw-r--r-- | src/gui/fpg_spinedit.pas | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/fpg_spinedit.pas b/src/gui/fpg_spinedit.pas index 280529d4..b344b6c5 100644 --- a/src/gui/fpg_spinedit.pas +++ b/src/gui/fpg_spinedit.pas @@ -238,7 +238,8 @@ function CreateSpinEditFloat(AOwner: TComponent; x, y, w, h: TfpgCoord; AFixedDecimals: integer = 1; AValue: extended = 0; ADecimals: integer = -1): TfpgSpinEditFloat; function CreateSpinEdit(AOwner: TComponent; x, y, w, h: TfpgCoord; AMinValue: integer = 0; AMaxValue: integer = 100; AIncrement: integer = 1; ALargeIncrement: integer = 10; - AValue: integer = 0): TfpgSpinEdit; + AValue: integer = 0): TfpgSpinEdit; overload; +function CreateSpinEdit(AOwner: TComponent; x, y, w: TfpgCoord; AOnChangeEvent: TNotifyEvent = nil): TfpgSpinEdit; overload; implementation @@ -299,6 +300,15 @@ begin Result.Value := AValue; end; +function CreateSpinEdit(AOwner: TComponent; x, y, w: TfpgCoord; AOnChangeEvent: TNotifyEvent): TfpgSpinEdit; +begin + Result := TfpgSpinEdit.Create(AOwner); + Result.SetPosition(x, y, w, Result.Height); + if Assigned(AOnChangeEvent) then + Result.OnChange := AOnChangeEvent; + Result.UpdatePosition; +end; + { TfpgAbstractSpinEdit } |