home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / picmas2.zip / PICMASK.DOC next >
Text File  |  1993-11-10  |  6KB  |  163 lines

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