TFloatEdit/TSpinFloatEdit/TDBFloatEdit readme
- TFloatEdit is a descendant of TEdit to enter and check floating point numbers (min/max, number of decimal digits).
- TSpinFloatEdit is based on this, it also implements increment/decrement buttons and keystrokes and also "dynamic" inc/dec via an event handler.
- TDBFloatEdit is a database aware version of TFloatEdit, written by Eddie Shipman.
TFloatEdit, TSpinFloatEdit, TDBFloatEdit components for borland delphi
V 1.4, january 27, 2003
borland delphi 4/5/6/7?
- copy or extract fledit.pas, dbfloatedit.pas, dbfloatedit.dcr and fledit.dcr into a folder included in delphi's search path (like $(DELPHI)\lib).
- select "component"->"install component" in delphi's main menu.
- type fledit.pas into the "unit name" edit box.
- select "OK".
- select "add".
- type dbfloatedit.pas into the "unit name" edit box.
- select "OK".
- after the component package is opened in delphi, click "compile".
- then, after recompilation of the package, you should find the components on the "mirkes.de" and "samples" component palette tabs.
TFloatEdit
added published properties:
- Digits: Byte (r/w)
the number of decimal digits (digits after the decimal separator), range 0..18
- Min: Extended (r/w)
the lowest valid value
- Max: Extended (r/w)
the highest valid value
- Value: Extended (r/w)
the current value
- ErrorMessage :string (r/w)
the message that will be displayed if an invalid (not a number, out of range) value is typed
in the edit box, if this is the empty string ("", default), no error message will be displayed, and the value will be reset to a default
- Alignment: TAlignment (r/w)
how to align the text in the edit box (taLeftJustify, taCenter, taRightJustify (default))
- About: string (r)
shows the version and copyright holder of the component in the delphi ide, not editable
added events:
- OnEnterPress : TKeyPressEvent (r/w)
this event handler is called everytime the ENTER key is pressed
changed properties:
- Text: string (r)
this property is not writeable in TFloatEdit, you can just read the current value in textual format. to change the value, use the Value property instead
TSpinFloatEdit
TSpinFloatEdit inherits all properties of TCustomFloatEdit (like TFloatEdit), it additionally implements the following:
added types:
- TComputedIncrementEvent = procedure (Sender: TObject; const bIncrement:Boolean) of object;
this event handler is used in the OnComputedIncrement (see below) event
added published properties:
- EditorEnabled: Boolean (rw)
if this is set to flase (default is true), you cannot enter values in the edit box, you can just use the increment/decrement buttons and keys (up: CURSOR UP, down: CURSOR DOWN)
-
Increment: Extended (rw)
the value that is added to/substracted from the current value on increment/decrement event
added events:
- OnComputedIncrement : TComputedIncrement (r/w)
if a method is assigned to this event handler, it will be called whenever an increment/decrement event happens rather than adding/substracting the Increment property's value. the boolean parameter bIncrement tells you whether an increment (true) or decrement (false) event is occured. in this method you may implement your own increment/decrement algorithm
included
markus stephany, losheim am see, saarland, germany
mailto:merkes@mirkes.de
http://www.mirkes.de
Version 1.4, jan 27, 2003
some problems with return/escape keys fixed, multiline style avoided on newer operating systems,
on win98/me/2k/xp+ escape/return now are only handled by the component itself if no cancel/default
buttons are on the form. thanks to Moz. (this does not affect TSpinFloatEdit. it's always a multiline edit control)
Version 1.3c, nov 19, 2002
- entering numbers in scientific notation should now work better (reported by Scott Westfall and others)
Version 1.3b, oct 27, 2001
- bugfix: OnExit had been called twice, thanks to Philippe Oppliger
- included a DB aware version of TFloatEdit 1.2 (TDBFloatEdit in dbfloatedit.pas), written by Eddie Shipman, many thanks!
Version 1.3a, feb 23, 2001
- changed the license from GNU LGPL to the Clarified Artistic License
Version 1.3, jan 28, 2001
- implemented a base class TCustomFloatEdit where TFloatEdit is derived from
- hopefully fixed a problem with different decimalseparators
- text property is no longer writable (use value instead)
- added a component TSplinFloatEdit (like TSpinEdit from Borland's sample
vcl, much of the code is just copy&paste'd from the sources,
not just fix increment/decrement, also computed - via event handler)
- credits to George Paraskevaidis
- credits to Borland for the TSpinEdit sample component
Version 1.2
- Added properties: Alignment, OnEnterPress
- credits to Giuseppe Mosca and Andrea Carli
Version 1.1
There was a bug in the range checking; I hope it is fixed now. In V1.0 the value has been checked at each onkeypress-event, and that was not very fine in some cases. Now the correctness of the value will be checked when the focus get lost. If the value isn't in the range of min-max, the focus can't get lost. And now, the user can press the ESC-Key in FloatEdit to restore the value that was set
before he made changes.
*********************************************************************************************************************}
* *
* TFloatEdit, TSpinFloatEdit Copyright (C)1997-2003 markus stephany *
* *
* This package is free software; you can redistribute it and/or modify *
* it under the terms of either: *
* *
* a) the GNU General Public License as published by the Free *
* Software Foundation; either version 2, or (at your option) any *
* later version, or *
* *
* b) the Clarified Artistic License as used by the authors of NCFTP *
* version 3.0.2. *
* *
* This package is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* (Lesser) General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this package in the file named "COPYING"; if not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, *
* Boston, MA 02111-1307, USA. *
* *
* You should also have received a copy of the Clarified Artistic *
* License along with this package in the file named "ARTISTIC"; if not, *
* you may find a copy at http://www.mirkes.de/downloads/ARTISTIC.txt *
* *
*********************************************************************************************************************}
-END-