diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-14 15:55:06 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-14 15:55:06 +0000 |
commit | ccbce7ba60305b5438c3ac6311d39374ee2a0e55 (patch) | |
tree | 0ed2e5e12d0c2a3e2267a616156f9a07965b5b9c /examples/gui | |
parent | 050d90f6aeaaeae73461851ef4c0fea1f6e69a12 (diff) | |
download | fpGUI-ccbce7ba60305b5438c3ac6311d39374ee2a0e55.tar.xz |
* Applied patch no:2014995 EditFload decimal setup.
Diffstat (limited to 'examples/gui')
-rw-r--r-- | examples/gui/edits/edittest.lpr | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/examples/gui/edits/edittest.lpr b/examples/gui/edits/edittest.lpr index 01a33334..fcced01b 100644 --- a/examples/gui/edits/edittest.lpr +++ b/examples/gui/edits/edittest.lpr @@ -23,6 +23,7 @@ type procedure edtCurrencyChange(Sender: TObject); procedure chbPasswdChanged(Sender: TObject); procedure chbSpaceChange(Sender: TObject); + procedure chbFloatDecChange(Sender: TObject); public {@VFD_HEAD_BEGIN: MainForm} lblName1: TfpgLabel; @@ -41,6 +42,7 @@ type rbPoint: TfpgRadioButton; rbComma: TfpgRadioButton; chbSpace: TfpgCheckBox; + chbFloatDec: TfpgCheckBox; lbNegativeColor: TfpgColorListBox; lblNegativeColor: TfpgLabel; {@VFD_HEAD_END: MainForm} @@ -139,6 +141,14 @@ begin edtInteger.ThousandSeparator := '.'; end; +procedure TMainForm.chbFloatDecChange(Sender: TObject); +begin + if chbFloatDec.Checked then + edtFloat.Decimals := 3 + else + edtFloat.Decimals := -1; +end; + procedure TMainForm.AfterCreate; begin {@VFD_BODY_BEGIN: MainForm} @@ -248,7 +258,6 @@ begin SetPosition(24, 164, 120, 22); ShowThousand := True; ThousandSeparator := ','; - Decimals := 6; onChange := @edtFloatChange; end; @@ -267,7 +276,7 @@ begin with btnQuit do begin Name := 'btnQuit'; - SetPosition(296, 250, 75, 24); + SetPosition(296, 260, 75, 24); Anchors := [anRight,anBottom]; Text := 'Quit'; FontDesc := '#Label1'; @@ -313,6 +322,16 @@ begin OnChange := @chbSpaceChange; end; + chbFloatDec := TfpgCheckBox.Create(Self); + with chbFloatDec do + begin + Name := 'chbFloatDec'; + SetPosition(170, 220, 200, 20); + FontDesc := '#Label1'; + Text := 'Limit EditFloat to 3 decimals'; + OnChange := @chbFloatDecChange; + end; + lbNegativeColor := TfpgColorListBox.Create(self); with lbNegativeColor do begin |