home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / picmas.zip / PICMASK.DOC < prev    next >
Text File  |  1993-05-05  |  6KB  |  172 lines

  1.       INSTRUCTIONS FOR IMPACT FORMATTED ENTRYFIELD DEMO
  2.  
  3. ***********************************************************
  4. Note:  The library files supplied with this demo are fully
  5. functional but will expire in approximately 2 months from 
  6. the date you receive them.  DO NOT INCLUDE THEM WITH ANY
  7. PRODUCTION CODE.
  8. ***********************************************************
  9.  
  10.  
  11.  
  12. Thank you for evaluating Impact's Formatted Entryfields.
  13. The purpose of this library is to provide the picture mask
  14. support so badly needed yet mysteriously not included in
  15. OS/2's entryfields.
  16.  
  17. Picture mask support allows you to determine how the data
  18. entered into an entryfield will be displayed.  It also
  19. assures a consistent input format for important data fields
  20. which users might enter into your application.  For example
  21. in a date field users may enter the date in many different
  22. ways, MM/DD/YY or MM/DD/YYYY or MM, DD YYYY.  If this field
  23. is to be used for sorting or indexing or the like, it is
  24. important for a consistent format.  The Impact picture mask
  25. support assures this uniformity in data entry.  The picture
  26. mask support also provides a basic level of data validation,
  27. by allowing you to specify what type of character is
  28. allowable for each specific character position in the
  29. entryfield.
  30.  
  31. The Impact Entryfields are a completely new window class
  32. called:
  33.  
  34. WC_EFPICMASK
  35.  
  36. This entryfield works almost identically to the OS/2
  37. entryfield.  The WC_EFPICMASK class accepts and sends all
  38. standard entryfield messages.  In addition, it allows the
  39. developer to specify a format string when the entryfield is
  40. created, which determines things like:
  41.  
  42. numeric entry only
  43. alpha characters only
  44. any characters
  45. special delimiting characters
  46.  
  47. There are certain initialization characters which tell the
  48. entryfield what type of data, if any, is allowable for a
  49. particular character position.  Any other character in the
  50. initialization string which is not one of these  special
  51. characters or a space, is interpreted as a "mask" character,
  52. and as such becomes a permanent part of the entryfield.  For
  53. example:
  54.  
  55. CONTROL "(999)999-9999", ID_E_PHONE, 78, 236, 18, 8,
  56. WC_EFPICMASK, ES_LEFT | ES_AUTOTAB | ES_MARGIN | WS_TABSTOP
  57. | WS_VISIBLE
  58.  
  59. this resource statement would create an entryfield for a
  60. phone number.  The '9' indicates that particular character
  61. position is numeric only.  The "(" " )" "-" (parentheses and
  62. dash)  are interpreted as mask characters and are therefore
  63. permanent parts of the entryfield and can not be deleted or
  64. typed over.  As soon as the user enters data and the cursor
  65. has reached a mask character, the cursor is automatically
  66. advanced to the first editable position after the mask(s).
  67.  
  68. Since the WC_EFPICMASK class is not part of OS/2's default
  69. window classes, it is necessary for you to register the
  70. class before you can use it.  This is done by calling the
  71. function fnInitWCPicMsk(HAB hab) at the beginning of your
  72. application, preferably as soon as you have created the
  73. anchor block.
  74.  
  75. The following example shows typical initialization of the
  76. window class:
  77.  
  78. /*
  79. ** Create the applications anchor block handle
  80. */
  81. if((hAB = WinInitialize(0)) == 0)
  82.    return(FALSE);
  83.  
  84. /*
  85. ** Create the primary threads message queue
  86. */
  87. if((hMQ = WinCreateMsgQueue(hAB, 0)) == 0)
  88.    return(FALSE);
  89.  
  90. /*
  91. ** Initialize the WC_EFPICMASK window class
  92. */
  93. fnInitWCPicMsk(hAB);
  94.  
  95.  
  96.                   Format Control Characters
  97.  
  98. There are currently eight special initialization characters
  99. which are recognized when placed as part of the
  100. initialization string for the WC_EFPICMASK class.  The
  101. characters are as follows:
  102.  
  103.  
  104. Value Meaning            Upper   Lower  Spaces
  105.                          case    case
  106.   x   Alphanumeric         n       y       y
  107.   X   Alphanumeric         y       n       y
  108.   @   Alphanumeric         y       y       y
  109.   a   Alpha                y       y       y
  110.   A   Alpha                y       n       y
  111.   #   Numeric             na      na       y
  112.   9   Numeric             na      na       n
  113.   ?   Any ASCII           na      na      na
  114.       character
  115.  
  116.  
  117. Any other character of the 256 ASCII character set will be
  118. interpreted as a mask character.  If you want to use any of
  119. the formatting characters as a mask character, simply
  120. precede it with a carat ^.  This will cause the field to
  121. automatically be treated as a mask character.
  122.  
  123. If you want to repeat a particular format control character,
  124. you can follow the character with a number in parentheses.
  125. For example, to repeat a numeric value five character
  126. places, you could represent it using the following syntax:
  127.  
  128.      "9(5)", ...
  129.  
  130. or you could represent it by simply repeating the format
  131. control character five times , such as:
  132.  
  133.      "99999"
  134.  
  135.  
  136.                            Linkage
  137.  
  138. Linkage of the Impact Formatted Entryfield Demo Library is
  139. handled by using one of the supplied 16 ro 32 bit LIB'S
  140. which contain object code.
  141.  
  142. Depending on whether you are producing a 16 bit or 32 bit
  143. application, you will need to link with the appropriate
  144. library combination.
  145.  
  146. WCPIC32.H        The header file which should be included
  147.                  in all source modules using the
  148.                  WC_EFPICMASK class.
  149. EF32MSS.LIB      A linkable lib.  Compiled with
  150.                  multithread, system link, static runtime.
  151.  
  152.  
  153. For 16 bit the following files have been included:
  154.  
  155. WCPIC16.H        The header file which should be included
  156.                  in all source modules using the
  157.                  WC_EFPICMASK class.
  158. EF16MS.LIB       A linkable library.  Only the large
  159.                  memory model is supplied since that is
  160.                  the required memory model for PM
  161.                  programming.  This LIB has been compiled
  162.                  for multithread static runtime.
  163.  
  164.  
  165. To Place an Order  you can call our 800 number, 1 (800) 676-
  166. 9390 or fax your order request to (818) 879-5593 or place an
  167. order over the BBS at (818) 879-7405.  We accept MC/VISA/AE
  168. and COD.
  169.  
  170. Thank you for your support!
  171.  
  172.