home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
picmas.zip
/
PICMASK.DOC
< prev
next >
Wrap
Text File
|
1993-05-05
|
6KB
|
172 lines
INSTRUCTIONS FOR IMPACT FORMATTED ENTRYFIELD DEMO
***********************************************************
Note: The library files supplied with this demo are fully
functional but will expire in approximately 2 months from
the date you receive them. DO NOT INCLUDE THEM WITH ANY
PRODUCTION CODE.
***********************************************************
Thank you for evaluating Impact's Formatted Entryfields.
The purpose of this library is to provide the picture mask
support so badly needed yet mysteriously not included in
OS/2's entryfields.
Picture mask support allows you to determine how the data
entered into an entryfield will be displayed. It also
assures a consistent input format for important data fields
which users might enter into your application. For example
in a date field users may enter the date in many different
ways, MM/DD/YY or MM/DD/YYYY or MM, DD YYYY. If this field
is to be used for sorting or indexing or the like, it is
important for a consistent format. The Impact picture mask
support assures this uniformity in data entry. The picture
mask support also provides a basic level of data validation,
by allowing you to specify what type of character is
allowable for each specific character position in the
entryfield.
The Impact Entryfields are a completely new window class
called:
WC_EFPICMASK
This entryfield works almost identically to the OS/2
entryfield. The WC_EFPICMASK class accepts and sends all
standard entryfield messages. In addition, it allows the
developer to specify a format string when the entryfield is
created, which determines things like:
numeric entry only
alpha characters only
any characters
special delimiting characters
There are certain initialization characters which tell the
entryfield what type of data, if any, is allowable for a
particular character position. Any other character in the
initialization string which is not one of these special
characters or a space, is interpreted as a "mask" character,
and as such becomes a permanent part of the entryfield. For
example:
CONTROL "(999)999-9999", ID_E_PHONE, 78, 236, 18, 8,
WC_EFPICMASK, ES_LEFT | ES_AUTOTAB | ES_MARGIN | WS_TABSTOP
| WS_VISIBLE
this resource statement would create an entryfield for a
phone number. The '9' indicates that particular character
position is numeric only. The "(" " )" "-" (parentheses and
dash) are interpreted as mask characters and are therefore
permanent parts of the entryfield and can not be deleted or
typed over. As soon as the user enters data and the cursor
has reached a mask character, the cursor is automatically
advanced to the first editable position after the mask(s).
Since the WC_EFPICMASK class is not part of OS/2's default
window classes, it is necessary for you to register the
class before you can use it. This is done by calling the
function fnInitWCPicMsk(HAB hab) at the beginning of your
application, preferably as soon as you have created the
anchor block.
The following example shows typical initialization of the
window class:
/*
** Create the applications anchor block handle
*/
if((hAB = WinInitialize(0)) == 0)
return(FALSE);
/*
** Create the primary threads message queue
*/
if((hMQ = WinCreateMsgQueue(hAB, 0)) == 0)
return(FALSE);
/*
** Initialize the WC_EFPICMASK window class
*/
fnInitWCPicMsk(hAB);
Format Control Characters
There are currently eight special initialization characters
which are recognized when placed as part of the
initialization string for the WC_EFPICMASK class. The
characters are as follows:
Value Meaning Upper Lower Spaces
case case
x Alphanumeric n y y
X Alphanumeric y n y
@ Alphanumeric y y y
a Alpha y y y
A Alpha y n y
# Numeric na na y
9 Numeric na na n
? Any ASCII na na na
character
Any other character of the 256 ASCII character set will be
interpreted as a mask character. If you want to use any of
the formatting characters as a mask character, simply
precede it with a carat ^. This will cause the field to
automatically be treated as a mask character.
If you want to repeat a particular format control character,
you can follow the character with a number in parentheses.
For example, to repeat a numeric value five character
places, you could represent it using the following syntax:
"9(5)", ...
or you could represent it by simply repeating the format
control character five times , such as:
"99999"
Linkage
Linkage of the Impact Formatted Entryfield Demo Library is
handled by using one of the supplied 16 ro 32 bit LIB'S
which contain object code.
Depending on whether you are producing a 16 bit or 32 bit
application, you will need to link with the appropriate
library combination.
WCPIC32.H The header file which should be included
in all source modules using the
WC_EFPICMASK class.
EF32MSS.LIB A linkable lib. Compiled with
multithread, system link, static runtime.
For 16 bit the following files have been included:
WCPIC16.H The header file which should be included
in all source modules using the
WC_EFPICMASK class.
EF16MS.LIB A linkable library. Only the large
memory model is supplied since that is
the required memory model for PM
programming. This LIB has been compiled
for multithread static runtime.
To Place an Order you can call our 800 number, 1 (800) 676-
9390 or fax your order request to (818) 879-5593 or place an
order over the BBS at (818) 879-7405. We accept MC/VISA/AE
and COD.
Thank you for your support!