home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
t
/
tvinp102.zip
/
TVINP102.DOC
< prev
next >
Wrap
Text File
|
1992-08-21
|
3KB
|
58 lines
Tvinp102.tpu is a simple Turbo Vision unit that picks up where Borland left
off with regards to numeric dialog box inputs. Support is provided for the
standard types integer.longint,real,single,double,extended,and comp.
Each object comes complete with keyboard character input validation,
user supplied range checking, stream load/store methods, and standard
dialog box data transfer capabilities. They are modeled after and behave
similarly to the standard TInputLine.
Most of the code is fairly self documenting, especially if you are already
familiar with Turbo Vision. A quick overview:
Objects provided--
TInputInt; Integer input object
TInputLong; Long integer input object
TInputReal; Software real input object
TInputSingle; IEEE single precision object
TInputDouble; IEEE double precision object
TInputExtended; IEEE extended precision (long double) object
TInputComp; IEEE comp object
All of the above mentioned objects have two constructors : init() and default().
Init allows complete control over the initial value, allowed range, and
displayed appearance of an input object. The default constructor creates
an object with reasonable defaults : 0 initial value, a default input
width, and allows the entire range of the numeric type that the object
represents. See the unit interface for the exact syntax of these calls.
All of the objects have load,store,setdata,and getdata methods. Use them
exactly as you would the same methods for any TGroup descendent.
I have done my best to provide a bug free resource for your use. However,
if you have problems or questions, I can be reached via email at
bobb@vice.ico.tek.com. I am also a frequent reader of comp.lang.pascal.
Feel free to incorporate these routines into your own programs. I neither
require nor expect any royalties for their use.
Changes for TVINP102 from TVINP101:
I have tackled the problem of user input validation much more thoroughly
in this revision. Users requested that input numbers be validated whenever
the focus moved away from the current input. That has been implemented in
the following manner:
A default value for each numeric input is stored in the object and
initialized to the same value that is passed to the constructor (or 0
if you use the default() constructors). If the user enters an invalid
number for the type of the input, a warning message appears, informing
them of their error, giving the allowed range of inputs, and finally
restoring the input number to it's stored default value.
Input validation can also be delayed until the user closes the
encompassing dialog box. This is accomplished by setting the global
variable Immediate_Checking (found in the TVINP102 interface) to false.
There have also been some minor display changes, particularly with
the default inputs, but these shouldn't create any difficulties that I
can imagine.