diff options
author | Jean-Marc Levecque <jmarc.levecque@jmlesite.fr> | 2013-02-25 16:28:32 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2013-02-25 16:28:32 +0000 |
commit | 9f953aa69ba4e2a83cde82fcff99279c970e25ef (patch) | |
tree | 20098fcddeb71a98407b0157822f02d9b66e4b05 /examples/gui/edits | |
parent | d756e9abeb89b01bd0aae1fd25c700826ba96d30 (diff) | |
download | fpGUI-9f953aa69ba4e2a83cde82fcff99279c970e25ef.tar.xz |
numeric edits: adds min/max limits
I was just ready to send a new patch concerning the limit values
which is solving the issue with the gridediting. In addition, it is now
possible to set only one limit, max or min, and I solved a bug on the
editfloat which prevented to enter decimals in some cases.
Diffstat (limited to 'examples/gui/edits')
-rw-r--r-- | examples/gui/edits/edittest.lpr | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/examples/gui/edits/edittest.lpr b/examples/gui/edits/edittest.lpr index 8a2c9e54..411c4466 100644 --- a/examples/gui/edits/edittest.lpr +++ b/examples/gui/edits/edittest.lpr @@ -161,7 +161,10 @@ end; procedure TMainForm.chbFloatDecChange(Sender: TObject); begin if chbFloatDec.Checked then - edtFloat.Decimals := 3 + begin + edtFloat.Decimals := 3; + chbFloatFixDec.Checked:= False; + end else edtFloat.Decimals := -1; end; @@ -169,7 +172,10 @@ end; procedure TMainForm.chbFloatFixDecChange(Sender: TObject); begin if chbFloatFixDec.Checked then - edtFloat.FixedDecimals := 3 + begin + edtFloat.FixedDecimals := 3; + chbFloatDec.Checked:= False; + end else edtFloat.FixedDecimals := -1; end; @@ -177,14 +183,23 @@ end; procedure TMainForm.chbLimitChange(Sender: TObject); begin if chbLimit.Checked then - begin + begin edtInteger.MaxValue:= 5000; edtInteger.MinValue:= -1000; - edtFloat.MaxValue:= 5000;; + edtFloat.MaxValue:= 5000; edtFloat.MinValue:= -1000; edtCurrency.MaxValue:= 5000; edtCurrency.MinValue:= -1000; - end; + end + else + begin + edtInteger.MaxLimit:= False; + edtInteger.MinLimit:= False; + edtFloat.MaxLimit:= False; + edtFloat.MinLimit:= False; + edtCurrency.MaxLimit:= False; + edtCurrency.MinLimit:= False; + end; end; procedure TMainForm.AfterCreate; @@ -446,6 +461,7 @@ begin rbPoint.Checked := True else rbComma.Checked := True; + lbNegativeColor.SetFocus; end; procedure MainProc; |