home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / zfrms110.zip / ZFORMS.DOC < prev    next >
Text File  |  1993-09-06  |  57KB  |  1,280 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                      Z-Forms Screen Management Libraries
  23.                                 Version 1.1
  24.                                 Users Guide
  25.  
  26.  
  27.  
  28.  
  29.  
  30.                             (C) 1993, Z-Space
  31.                            All Rights Reserved
  32.  
  33.  
  34. Z-Forms Screen Management Libraries
  35.         
  36. Z-Forms Philosophy:
  37.  
  38.     Z-Forms is a powerful tool that assists programmers in producing 
  39. applications with a fast, text-mode, windowed user interface.  The package 
  40. features built-in windowing, menuing, dialog boxes, mouse handling, and data 
  41. input support.        
  42.     Z-Forms is intended to be easy to use, utilizing a minimal set of 
  43. function calls.  However, ease-of-use is not achieved at the expense of 
  44. flexability and power.  Z-Forms allows the programmer to configure every 
  45. parameter that effects the way the program screen looks, and contains many 
  46. built-in features to handle a wide variety of user-interface tasks.
  47.  
  48. Z-Forms Overview:
  49.  
  50.     The programmer specifies the content and look of any desired windows, 
  51. dialog boxes, menus, etc. by declaring and initializing structures in the 
  52. source code.  Once defined, Z-Forms handles the screen configuration and 
  53. drives the program flow based on user interaction.  Application functions, 
  54. menus, dialog boxes, etc.  can be specified to be the results of button 
  55. presses or menu selections.  For example, you might define a menu with three 
  56. items;  the first might call another menu, the second a dialog box, and the 
  57. third a function.  The programmer provides the desired structure, definition 
  58. and application specific functions, and Z-Forms handles the rest!
  59.     It is our hope that Z-Forms will cut down your programming time and 
  60. provide robust handling of the user interface.
  61.  
  62.  
  63. This IS a shareware package, and does require a registration fee if you 
  64. choose to continue using it after 30 days.  The registration fee is 
  65. currently $35 US (libraries only), or $65 for source code.  When you 
  66. register, you will be sent the latest "registered" version of Z-Forms.
  67. ------------------------------------------------------------------------
  68.  
  69. IMPORTANT: READ THE READ.ME FILE FOR NEW FEATURES AND BUG FIXES
  70. ------------------------------------------------------------------------
  71.  
  72. DISCLAIMER OF WARRANTY
  73. ======================
  74. THIS SOFTWARE AND MANUAL ARE DISTRIBUTED AND SOLD "AS IS" AND WITHOUT 
  75. WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES 
  76. WHETHER EXPRESSED OR IMPLIED.  BECAUSE OF THE VARIOUS HARDWARE AND SOFTWARE 
  77. ENVIRONMENTS INTO WHICH THIS PROGRAM MAY BE PUT, NO WARRANTY OF FITNESS FOR 
  78. A PARTICULAR PURPOSE IS OFFERED.
  79.  
  80. GOOD OPERATING PROCEDURE DICTATES THAT ANY PROGRAM BE THOROUGHLY TESTED WITH 
  81. NON-CRITICAL DATA BEFORE RELYING ON IT.  THE USER MUST ASSUME THE ENTIRE 
  82. RISK OF USING THE PROGRAM.  ANY LIABILITY OF THE SELLER WILL BE LIMITED 
  83. EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE. 
  84.  
  85.  
  86. Installing Z-Forms:
  87.  
  88. Unpack the distribution file into an appropriate directory (for example, 
  89. C:\ZFORMS).  Then unpack the library files from the library distribution 
  90. that matches your compiler:
  91.     Microsoft C 6.0           :    MSC600.ZIP
  92.     IBM C/Set                 :    CSET.ZIP
  93.     Borland C/C++ for OS/2    :    BCOS2.ZIP
  94.     Borland C/C++ V2.0/V3.0   :    BORLANDC.ZIP
  95.     EMX/GCC                   :    EMX.ZIP
  96.  
  97. Then, simply add the header file ZFORMS.H to any source files that will make 
  98. Z-Forms calls, and link with the libraries.  For more information about 
  99. using Z-Forms with your compiler, please read the READ.ME file.
  100.  
  101. We have included some sample code (in ZFORMS.C) which demonstrates most of 
  102. the functionality of Z-Forms.  We have supplied this sample code compiled 
  103. for bound 16-bit DOS and OS/2 (ZFORMS.EXE) and 32-bit OS/2 (ZFORMS32.EXE).  
  104. Please take a few minutes to examine the sample code and run the program.  
  105. This is your best guide to how the functions work.
  106.  
  107.  
  108. Z-Forms Object Types:
  109.     There are five basic object types in Z-Forms.  Each is defined by 
  110. initializing appropriate stuctures.  The number of Z-Forms objects allowed 
  111. is determined by available memory.
  112.  
  113.     WINDOW:
  114.     A Window is a rectangular region, with configurable size, position, 
  115. border, drop shadow, titles, colors, etc.  You can have as many windows 
  116. overlapping on the screen as you want. Each window is maintained in memory 
  117. as a complete virtual screen, and the physical screen is generated by 
  118. determining which parts of each window are visible, and displaying them.  
  119. All windows can be written to, and any visible parts will be updated on the 
  120. screen.
  121.                 
  122.     DIALOG BOX:
  123.     A special window that can have groups of controls (buttons, checkboxes, 
  124. one-of-buttons, data entry fields, etc.) used to request user input.
  125.  
  126.     MENU:
  127.     A vertical or horizontal group of selections.  Each menu option can be 
  128. used to select another menu, dialog box, or function, or to exit the menu.
  129.  
  130.     PROMPT:
  131.     A Prompt is a group of data entry fields on a window.  Each field may 
  132. have a data mask and a verification function, and allows editing.
  133.  
  134.     PICKLIST:
  135.     A vertical list of items, scrolled by the up/down arrow keys, that 
  136. allows the user to select an item from a group of items.
  137.  
  138.  
  139. Using Z-Forms
  140.  
  141.     Windows:
  142.  
  143.     A Window is defined by initializing a window structure, and passing it 
  144. to a Z-Forms function.  Z-Forms maintains a virtual screen buffer for the 
  145. window in memory, and updates the display from it.
  146.  
  147.     The window structure contains the following fields:
  148.     fShown     : Flags whether the window is visible or not.
  149.                    This field should not be directly manipulated,
  150.                    but is set and cleared by Z_ShowWindow and
  151.                    Z_HideWindow.  Initialize to zero.
  152.     Height     : Window height, including the border
  153.     Width      : Window width, including the border
  154.     Prev       : Pointer to the previous window (maintained by
  155.                    Z-Forms).  Initialize to NULL.
  156.     Next       : Pointer to the next window (maintained by
  157.                    Z-Forms).  Initialize to NULL.
  158.     XOrg       : X co-ordinate on the screen of the left edge
  159.                    of the window (0 based)
  160.     YOrg       : Y co-ordinate on the screen of the top edge of
  161.                    the window (0 based)
  162.     DefaultChar: A character/attribute pair used to fill the
  163.                    window when initially opened.  The high byte
  164.                    is the attribute, the low byte the character.
  165.                    For example, 0x1E20 would be Yellow (E) on Blue (1),
  166.                    Space (20) character.
  167.     BorderStyle: The border style identifier:
  168.                    BS_NOBORDER
  169.                    BS_SINGLELINE
  170.                    BS_DOUBLELINE
  171.     BorderColor: The border foreground color (See ZFORMS.H for colors)
  172.     BorderBack : The border background color
  173.     DropShadow : The drop shadow identifier:
  174.                    DS_UPPERLEFT
  175.                    DS_UPPERRIGHT
  176.                    DS_LOWERRIGHT
  177.                    DS_LOWERLEFT
  178.                    DS_NONE
  179.     DropAttr   : The attribute to use for the background of the
  180.                    drop shadow (DARKGREY is good).
  181.     Title      : Pointer to the title character string.  The
  182.                    title is centered on the top line of the
  183.                    window.  If this parameter is NULL, no title
  184.                    will be displayed.
  185.     SubTitle   : Pointer to the subtitle character string.  The
  186.                    subtitle is centered on the bottom line of the
  187.                    window.  If this parameter is NULL, no
  188.                    subtitle will be displayed.
  189.     pVS        : Pointer to the virtual screen buffer, maintained
  190.                    internally.  Initialize to NULL.
  191.  
  192.     Note: Prev, Next, and pVS should be initialized to NULL.
  193.     fShown should be initialized to 0.
  194.  
  195.  
  196.     There are three methods to create a window.  In method 1, a predefined 
  197. window structure is used, and all processing is handled internally:
  198.         Z_OpenWindow(...);
  199. This is the simplest method, assuming that the window structure was known or 
  200. can be initialized.  All of the windows in the sample code are opened using 
  201. Z_OpenWindow.  Method 2 involves creating a window structure, defining the 
  202. window, then showing it.  The code for this would be similar to:
  203.     Z_CreateWindow(...);
  204.     Z_DefineWindow(...);
  205.     Z_ShowWindow(...);
  206. This method would only be used when a window had to be created on-the-fly, 
  207. but even then you could probably use a pre-defined structure, and simply 
  208. change the fields.
  209.     Method 3 also uses a predefined window structure, which is defined and 
  210. shown:
  211.     Z_DefineWindow(...);
  212.     Z_ShowWindow(...);
  213.     Once the window is open, you may write to it using the Z_Text or Z_Char 
  214. functions:
  215.     Z_TextOut writes text at the specified window co-ordinates using the 
  216. designated colors.  Z_TextOver writes the text using the colors already on 
  217. that position. Z_CharOut and Z_CharOver write a single character to the 
  218. window.  Z_CharOutAtCursor and Z_CharOverAtCursor write a single character 
  219. at the current cursor coordinates.  Z_CharOutTTY and Z_CharOVerTTY write a 
  220. single character at the current cursor coordinates and advance the cursor 
  221. one unit.
  222.     The window may be hidden, if necessary, by calling Z_HideWindow.  If 
  223. the window is hidden, it may be shown using Z_ShowWindow.  Finally, you may 
  224. push a window to the 'back' of the screen using Z_PushWindow, or make a 
  225. window the 'top' window using Z_PopWindow.
  226.  
  227.  
  228.     Menus:
  229.     There are two types of menus available in Z-Forms; Vertical and 
  230. Horizontal.  The menu is created by defining a menu structure, as follows:
  231.     OrgX       : Menu X origin on the physical display
  232.     OrgY       : Menu Y origin on the physical display
  233.     Height     : Menu window height (1 for horizontal)
  234.     Width      : Menu window width
  235.     TextWidth  : The width of the menu text for a vertical
  236.                    menu.  This field determines the width of the
  237.                    highlight bar.
  238.     Flags      : Menu Flags (may be combined with | where sensible):
  239.                    MMF_VERTMENU
  240.                    MMF_HORIZMENU
  241.                    MMF_USEHINT
  242.                    MMF_NOHINT
  243.     TextColor  : Color of menu text
  244.     BackColor  : Color of menu text background
  245.     HotColor   : Color of hot key letter
  246.     HotBack    : Color of hot key letter background
  247.     HiTextColor: Color of highlighted text
  248.     HiBackColor: Color of highlighted text background
  249.     HintTextColor: Color of hint text
  250.     HintBackColor: Color of hint background
  251.     HintOrgX   : Screen X origin for hint window
  252.     HintOrgY   : Screen Y origin for hint window
  253.     HintWidth  : Width of hint window
  254.     BorderStyle: Border style identifier:
  255.                    BS_NOBORDER
  256.                    BS_SINGLELINE
  257.                    BS_DOUBLELINE
  258.     BorderColor: Color for border line, if any
  259.     BorderBack : Background color for border
  260.     DropShadow : The drop shadow identifier:
  261.                    DS_UPPERLEFT
  262.                    DS_UPPERRIGHT
  263.                    DS_LOWERRIGHT
  264.                    DS_LOWERLEFT
  265.                    DS_NONE
  266.     DropAttr   : The attribute to use for the background of the drop
  267.                    shadow
  268.     Title      : Pointer to title character string, or NULL for none
  269.     Item[]     : Array of menu items, terminated by a dummy entry with
  270.                    a NULL Text field (see below).
  271.  
  272.  
  273. A menu item has the following structure:
  274.     Text       : Pointer to menu item text string
  275.     Flags      : Menu item flags:
  276.                     MIF_USEHINT
  277.                     MIF_NOHINT
  278.                     MIF_CALLMENU
  279.                     MIF_CALLDIALOG
  280.                     MIF_CALLFUNC
  281.                     MIF_CALLNOTHING
  282.                     MIF_RIGHTJUST
  283.                     MIF_LEFTJUST
  284.                     MIF_SUBMENU
  285.                     MIF_NOSUBMENU
  286.     HotKey     : Key press to activate this item (i.e. k_Alt_A)
  287.     OffsetHiLite: Offset into item text to the character to highlight,
  288.                     or -1 for none.  The first character is 0
  289.     XOrg       : X position of item within window with respect to the menu
  290.     YOrg       : Y position of item within window with respect to the menu
  291.     ActionPtr  : Pointer to the action to take upon selection.  Can be a
  292.                     pointer to a function, another menu, or a dialog box
  293.     Hint       : Pointer to hint text
  294.  
  295.     A menu is created by initializing the menu structure and Item array.  
  296. The last entry in the Item array must have a NULL Text field.  For example, 
  297. this menu is taken from the sample code:
  298.  
  299.    static MENU_ITEM VertMenuItem[] = {
  300.       "TTY Demo", MIF_CALLFUNC, 'T', 0,  1, 1, (void *)TTYDemo,
  301.          " TTY demo with auto-scrolling        ",
  302.       "Background Demo", MIF_CALLFUNC, 'B', 0,  1, 2, 
  303.          (void *)BackgroundDemo,
  304.          " Demo of background processes/windows",
  305.       "Nothing", MIF_CALLEXIT, 'N', 0,  1, 3, NULL,
  306.          " Dummy option does nothing           ",
  307. ****> NULL, 0, 0, 0, 0, 0, NULL, "" };
  308.    static MENU VertMenu = {
  309.       33, 2, 5, 20, 18, MMF_VERTMENU | MMF_USEHINT, BRIGHTWHITE, BLUE,
  310.       LT_RED, BLUE, BLUE, CYAN, WHITE, BLUE, 1, 23, 78, BS_SINGLELINE,
  311.       YELLOW, BLUE, 0, 0, NULL, VertMenuItem };
  312.  
  313. Notice that the fourth menu item is completely NULL.  This terminates the 
  314. array.  After initializing the menu structure, call Z_HandleMenu(...).  This 
  315. function handles all menu processing.  If the menu is a horizontal menu, a 
  316. window is created which is 'Height' characters high and 'Width' wide.  The 
  317. items are displayed across the menu according to the XOrg parameter.  If the 
  318. menu is a vertical menu, a window is created using the Height and Width 
  319. parameters.  There can be extra space around the actual menu items, if 
  320. necessary.  There can also be a border and title around the window.  The 
  321. Height and Width include this border.
  322.     If MMF_USEHINT is set, a hint window is also created, and the hint text 
  323. is displayed for each item as the user selects it.  The hint is a short 
  324. description of the menu selection for the user.
  325.     NOTE: In order for the mouse to function properly, you must specify a 
  326. unique hot-key for each menu item.
  327.  
  328.     The menu then allows the user to select the desired menu choice  by 
  329. using the arrow keys, the mouse, or by pressing the hot key for the item.  
  330. When the user selects the menu item, Z-Forms checks the MIF_CALLXXXX flag to 
  331. determine what to do next.  If MIF_CALLMENU is set, then Z_HandleMenu is 
  332. called, and ActionPtr is assumed to point to another menu structure.  This 
  333. allows nested menus and submenus, pulldown menus, etc.  If MIF_CALLDIALOG is 
  334. set, ActionPtr is assumed to point to a dialog box structure, and 
  335. Z_HandleDialog is called.  If MIF_CALLFUNC is set, ActionPtr is assumed to 
  336. point to a function, and the function is called.  The function prototype 
  337. should be 
  338.     void UserFunc(int Item);
  339. where Item is the menu item number that was selected.  If MIF_CALLNOTHING is 
  340. set, no action occurs when the menu item is selected.  The Escape key or an 
  341. item with MIF_CALLEXIT exits the menu.
  342. Dialog Boxes:
  343.     A dialog box is defined by initializing a dialog box structure and 
  344. calling Z_HandleDialog(...).  The fields of the structure are:
  345.     XOrg            : Screen X origin of dialog box
  346.     YOrg            : Screen Y origin of dialog box
  347.     Height          : Dialog box height
  348.     Width           : Dialog box width
  349.     Flags           : Dialog box flags
  350.                         DBF_USEHINT
  351.                         DBF_NOHINT
  352.     DefaultChar     : Character/attribute pair used to fill the
  353.                         dialog box
  354.     HintTextColor   : Color of hint text, if any
  355.     HintBackColor   : Color of hint background color
  356.     HintOrgX        : Screen X Origin for hint window
  357.     HintOrgY        : Screen Y Origin for hint window
  358.     HintWidth       : Width of hint window
  359.     BorderStyle     : Type of border, if any
  360.                         BS_NOBORDER
  361.                         BS_SINGLELINE
  362.                         BS_DOUBLELINE
  363.     BorderColor     : Color of border line
  364.     BorderBack      : Color of border background
  365.     DropShadow      : The drop shadow identifier:
  366.                         DS_UPPERLEFT
  367.                         DS_UPPERRIGHT
  368.                         DS_LOWERRIGHT
  369.                         DS_LOWERLEFT
  370.                         DS_NONE
  371.     DropAttr        : The attribute to use for the background of
  372.                         the drop shadow.
  373.     Title           : Pointer to dialog box title string
  374.     Control         : Array of control types, terminated by a NULL Text
  375.                         field (See Below).
  376.  
  377.  
  378. The dialog box may then contain any number of controls, which are defined 
  379. as:
  380.     Text            : Pointer to control text
  381.     Style           : control styles
  382.                         CSF_BUTTON
  383.                         CSF_TEXT
  384.                         CSF_DATAENTRY
  385.                         CSF_CHECKBOX
  386.                         CSF_ONOFBUTTON
  387.                         CSF_PICKLIST
  388.     Flags           : control type flags
  389.                         CSS_NOACTIVATE
  390.                         CSS_ACTIVATE
  391.                         CSS_CALLFUNC
  392.                         CSS_CALLDIALOG
  393.                         CSS_CALLMENU
  394.                         CSS_EXIT
  395.                         CSS_CALLNOTHING
  396.     HotKey          : Hot key to activate control
  397.     OffsetHiLite    : Offset into text for hilight
  398.     XOrg            : Window X origin for control
  399.     YOrg            : Window Y origin for control
  400.     Height          : Height of control
  401.     Width           : Width of control
  402.     TextColor       : Color of control text
  403.     TextBack        : Color of control text background
  404.     HiTextColor     : Color of hilighted text
  405.     HiBackColor     : Color of hilighted text background
  406.     ActionPtr       : Pointer to control action
  407.     Hint            : Pointer to hint text
  408.     Validate        : Pointer to a validation function, or NULL for none
  409.  
  410.     A Dialog Box is created by initializing the dialog structure and 
  411. control item array.  The last entry in the array must have a NULL Text 
  412. field.  For example, this dialog box is taken from the sample code:
  413.  
  414.   static DLG_CONTROL TestDialogControl[] = {
  415.     "This is a text control", CSF_TEXT, CSS_NOACTIVATE | CSS_CALLNOTHING,
  416.         0, 0, 20, 2, 1, 22, YELLOW, BLUE, CYAN, BLUE, NULL, NULL, NULL,
  417.     "Data Entry: ", CSF_DATAENTRY, CSS_ACTIVATE | CSS_CALLNOTHING,
  418.         k_Alt_D, 0, 3, 4, 0, 0x1E0A, WHITE, BLUE, CYAN, BLUE, DataVar,
  419.         "This is a data entry control", NULL,
  420.     "Checkbox", CSF_CHECKBOX, CSS_ACTIVATE | CSS_CALLNOTHING, k_Alt_C, 3,
  421.         42, 4, 0, 0, WHITE, BLUE, BRIGHTWHITE, BLUE, &CheckVar,
  422.         "This is a check box control", NULL,
  423.     "OneOfButton1", CSF_ONEOFBUTTON, CSS_ACTIVATE | CSS_CALLNOTHING,
  424.         k_Alt_O, 0, 22, 6, 0, 0, WHITE, BLUE, BRIGHTWHITE, BLUE, &OneOfVar,
  425.         "This is a group of one-of buttons", NULL,
  426.     "OneOfButton2", CSF_ONEOFBUTTON, CSS_ACTIVATE | CSS_CALLNOTHING,
  427.         k_Alt_N, 1, 22, 7, 0, 1, WHITE, BLUE, BRIGHTWHITE, BLUE, &OneOfVar,
  428.         "This is a group of one-of buttons", NULL,
  429.     " <Exit> ", CSF_BUTTON, CSS_ACTIVATE | CSS_EXIT, k_Esc, 0, 26, 9, 0,
  430.         0, WHITE, RED, BRIGHTWHITE, RED, NULL, "This is a button control",
  431.         NULL,
  432.     NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, "", NULL};
  433. Notice that the last control is completely NULL.  This terminates the array.
  434.  
  435.   static DIALOG TestDialog = {
  436.     10, 5, 13, 60, DBF_USEHINT, 0x1E20, YELLOW, BLUE, 11, 16, 58,
  437.     BS_DOUBLELINE, YELLOW, BLUE, DS_LOWERRIGHT, 0x8, "Test Dialog Box",
  438.     NULL, TestDialogControl };
  439.  
  440. This is the dialog box definition.
  441.  
  442.     Some of the fields in the DLG_CONTROL structure change depending on the 
  443. control style.  Each control is explained below.
  444.     CSF_BUTTON
  445.     The Push Button control is generally used to close a dialog box, or 
  446. activate the next stage of a program.  The Text field points to a string 
  447. containing the text to be displayed on the button face, and the width of the 
  448. button is determined from the string length.  The Height and Width fields 
  449. are ignored.
  450.     CSF_TEXT
  451.     The Text Control is a static text field, used for titles or other 
  452. information which is not editable by the user.  The text can be changed by 
  453. the program, however, and any changes will be reflected on the dialog box.  
  454. Text controls should always be marked with the CSS_NOACTIVATE flag, since 
  455. they are not editable.  The height and width fields specify the size of the 
  456. control, but the text is always displayed one line high.
  457.     CSF_DATAENTRY
  458.     The data entry control allows the user to edit a string of text.  The 
  459. ActionPtr field should point to the string that holds the response.  The 
  460. high byte of the Width field specifies the number of characters that should 
  461. be stored in the response string, and the low byte specifies how many should 
  462. be displayed on the dialog box.  For example, if the width field is 0x2010, 
  463. then 0x10 (16) characters are displayed, but 0x20 (32) are stored in the 
  464. string.  The control scrolls automatically if the user types past the 
  465. displayed width.
  466.  
  467.     CSF_CHECKBOX
  468.     A check box is a toggle field, which changes from TRUE to FALSE to TRUE 
  469. when selected.  ActionPtr should point to an 'int' variable containing the 
  470. flag.  The Height and Width fields in the control structure are ignored.
  471.  
  472.     CSF_ONOFBUTTON
  473.     The one-of button allows the user to select one option from a group of 
  474. options.  The ActionPtr for each button in the group should contain a 
  475. pointer to the same 'int' variable, and the Width field should contain the 
  476. option number for the button.  When the button is selected, the value in the 
  477. Width field is placed into the variable pointed to by ActionPtr.  This 
  478. allows the programmer to determine which button in the group was selected.  
  479. The option numbers are arbitrary, and need not be consecutive.
  480.  
  481.     CSF_PICKLIST
  482.     The picklist control determines how a picklist should be displayed on 
  483. the dialog box.  Unlike the standard dialog controls, the picklist control 
  484. allows a separately defined picklist to be displayed on the dialog box.  The 
  485. picklist structure must first be defined (as though it were a standard 
  486. picklist), and a pointer to it is placed in ActionPtr.  The picklist will be 
  487. handled internally, and will operate as though it were a dialog control.
  488.  
  489.     NOTE: In order for the mouse to function properly, you must specify a 
  490. unique hot-key for each dialog control.
  491.  
  492.     Once the dialog box is active, Z-Forms displays all controls, then 
  493. searches for the first control marked with the CSS_ACTIVATE flag.  This 
  494. control is hilighted, and is the current control.  The hint window, if one 
  495. is defined, is opened and the hint text for that control is displayed.  The 
  496. user may now cycle through the active controls using the TAB key.  To 
  497. activate a control, the user may press <SPACE> or <ENTER> when the control 
  498. is hilighted, or press the hot key for the desired control.  When the 
  499. control is activated, the CSS_CALLXXXX flag is tested, and ActionPtr is 
  500. used, as folows.  If CSS_CALLFUNC is set, ActionPtr is assumed to point to a 
  501. function, which is called.  The function prototype should be 
  502.     void UserFunc(void);.
  503. If CSS_CALLDIALOG is set, ActionPtr is assumed to point to another dialog 
  504. box, which is activated using Z_HandleDialog(...).  If CSS_CALLMENU is set, 
  505. ActionPtr is assumed to point to a menu, which is activated using 
  506. Z_HandleMenu(...).  If CSS_EXIT is set, the dialog box terminates, returning 
  507. the number of the control which causes it.  If CSS_CALLNOTHING is set, no 
  508. action is taken.
  509.     There is a pre-defined dialog box which may be used to inform the user 
  510. of an event, or to ask a yes/no type question.  Z_InformUser(...) takes 4 
  511. strings as input;  A title, the box text, and two buttons.  The box is 
  512. centered on the physical screen.  The box returns TRUE if button 1 is 
  513. selected, or FALSE if button 2 is selected.  If the text pointer for button 
  514. 2 is NULL, then only one button (Button 1) is displayed, and it is centered.
  515.  
  516.  
  517.     Prompts:
  518.     A prompt sequence is a set of questions to the user which wait for a 
  519. response.  The logic for displaying these questions and recieving responses 
  520. from the user is handled by Z-Forms, without intervention from the 
  521. application program.  Prompts are defined in a prompt structure array, 
  522. terminated by a NULL Response, whose fields are as follows:
  523.     Response        : Pointer to the destination string
  524.     Prompt          : Pointer to the prompt text string
  525.     Mask            : Pointer to the data mask
  526.                         # - Any ascii character
  527.                         9 - Numeric only
  528.                         U - Uppercase (converts lowercase)
  529.                         any other - literal
  530.     Length          : Maximum length of input or -1 for display only
  531.     XPos            : Window X Position for this prompt
  532.     YPos            : Window Y Position for this prompt
  533.     PromptColor     : Color for prompt
  534.     PromptBack      : Color for prompt background
  535.     ResponseColor   : Color of response
  536.     ResponseBack    : Color of response background
  537.     HiColor         : Color of response hilight
  538.     HiBack          : Color of response hilight background
  539.     Verify          : Pointer to verification function, or NULL
  540.                         for none
  541.     Hint            : Pointer to hint text
  542.  
  543. A prompt sequence is initialized, and passed to Z_HandleInputs(...).  This 
  544. function displays all of the prompts and responses along with the hint, if 
  545. any.  The user navigates through the prompts by presing the up and down 
  546. arrow keys, as well as the enter key.  Note that any response with a Length 
  547. field of -1 will be displayed, but can not be edited.  Before Z-Forms will 
  548. allow the user to move to another field the verification function is called 
  549. (if Verify is not NULL).  The verification function is an 
  550. application-supplied function with the following form:
  551.     int ValFunc(char *Line)
  552. The parameter 'Line' contains the data typed by the user.  The function 
  553. should return either TRUE (okay to move away from the field) or FALSE (stay 
  554. in the field).  This allows the application to verify that the data is valid 
  555. before accepting it.  To terminate the prompts, the user presses one of the 
  556. ExitKeys passed to Z_HandleInputs.  ExitKeys is an array of keys, terminated 
  557. by k_NoKey.  Z_HandleInputs returns the key used to terminate the function.
  558.  
  559.  
  560.     Picklists:
  561.     A Picklist is a vertical list of items which may be scrolled by the 
  562. user to find a particular selection.  The user may use the Escape key or 
  563. Enter to either escape the picklist, or make a selection.  A picklist is 
  564. created by initializing a picklist structure, which has the following 
  565. fields:
  566.     OrgX            : Screen X origin of dialog box
  567.     OrgY            : Screen Y origin of dialog box
  568.     Height          : PickList height
  569.     Width           : PickList width
  570.     TextWidth       : Width of picklist display area
  571.     Flags           : Picklist flags to select mouse scroll buttons
  572.                         PLF_NOSCROLL
  573.                         PLF_VERTSCROLL
  574.     TextColor       : Color of picklist text
  575.     BackColor       : Background color of the picklist
  576.     HiTextColor     : Color of highlighted text
  577.     HiBackColor     : Background color of highlighted text
  578.     BorderStyle     : Type of border, if any
  579.                         BS_NOBORDER
  580.                         BS_SINGLELINE
  581.                         BS_DOUBLELINE
  582.     BorderColor     : Color of border line
  583.     BorderBack      : Color of border background
  584.     DefaultChar     : character/attribute for the picklist
  585.                         background
  586.     DropShadow      : The drop shadow identifier:
  587.                         DS_UPPERLEFT
  588.                         DS_UPPERRIGHT
  589.                         DS_LOWERRIGHT
  590.                         DS_LOWERLEFT
  591.                         DS_NONE
  592.     DropAttr        : The attribute to use for the background of the
  593.                         drop shadow
  594.     Title           : Pointer to the picklist title
  595.     pWin            : Pointer to the window to display on
  596.     Item            : Pointer to the first PICKLIST_ITEM in the list
  597.     LastItem        : Pointer to the last PICKLIST_ITEM in the list
  598.  
  599. The PICKLIST_ITEM structure is:
  600.     ItemText        : Pointer to the item's text
  601.     Prev            : Pointer to the previous list entry
  602.     Next            : Pointer to the next list entry.
  603.  
  604.     Once the picklist structure is initialized, items can be added to it by 
  605. calling Z_AddPickListItem, or removed by calling either Z_RemovePickListItem 
  606. or Z_RemovePickListEntry.  To display the picklist, call Z_HandlePickList.  
  607. This function displays the picklist on the window specified, and accepts 
  608. keypresses from the user.  The user may scroll up and down by using the 
  609. up/down arrow keys.  The user may escape the picklist by pressing Escape, in 
  610. which case Z_HandlePickList returns NULL.  The user may also select an entry 
  611. by pressing Enter, in which case Z_HandlePickList returns the pointer to the 
  612. picklist item.
  613.     When you have finished with the picklist, you should free all of its 
  614. memory by destroying it with Z_DestroyPickList.
  615.  
  616.     Mouse:
  617.     Mouse support is implemented transparently in Z-Forms.  Mouse events 
  618. are handled internally, simulating keypresses.  For example, clicking the 
  619. mouse on a menu item simulates that menu item's hot key.  For this reason, 
  620. you should always use unique hot keys for dialog controls and menu items.  
  621. If you do not, the mouse will behave erratically or select the wrong item.
  622.  
  623.     Sound:
  624.     Sound may be produced from Z-Forms in two ways.  You may use Z_Beep to 
  625. generate a tone of any frequency and duration, or you may use Z_Alert to 
  626. produce one of a set of predefined tone sequences.
  627.  
  628.     Background Processes:
  629.     You may run a background process when Z-Forms is waiting for a 
  630. keystroke.  Use Z_SetBackgroundProcess to do this.  You can specify the time 
  631. interval between executions of the background process.
  632.  
  633.     Programming using Z-Forms:
  634.     The Z-Forms header file ZFORMS.H contains prototype definitions for all 
  635. Z-Forms functions, as well as definitions for other items, such as colors, 
  636. keycodes, and flags.  This file should be included in all source modules 
  637. that make Z-Forms calls.  In addition, the executable program should be 
  638. linked with the Z-Forms library, which is a large model library (for those 
  639. compilers supporting memory models).  Z-Forms is written to generate OS/2 
  640. 1.x or 2.x programs, or DOS-only programs.  OS/2 1.X programs may be bound 
  641. to run under either OS/2 or DOS.  To bind using MSC6, build the program for 
  642. OS/2 1.X using ZFORMS.LIB, then bind with ZFBIND.LIB.  Form more information 
  643. about binding, please see the READ.ME file.
  644.     If the program is to be DOS only, you should link with both the ZFORMS 
  645. and ZFDOS libraries, which contains DOS versions of the OS/2 VIO, KBD and 
  646. DOS calls used by Z-Forms.
  647. (NOTE: The library names will depend on which compiler you are using)
  648.  
  649.     Please take a few minutes to examine the sample code.  This is your 
  650. best guide to how the various Z-Forms functions work.  We hope that you find 
  651. Z-Forms a powerful, yet easy to use screen management library.
  652.  
  653.     Z-Forms Compilation Macros
  654.     There are two macros used to control the compilation of Z-Forms 
  655. applications.  The libraries are built using the correct macros, and the 
  656. standard compilers (Microsoft, IBM, EMX/GCC and Borland) define them 
  657. automatically.  If you are using Z-Forms with another compiler, you may need 
  658. to define these macros yourself.  The first is __Z_INIT_EXT__ (two underbars 
  659. before and after).  This option controls how menu and dialog box controls 
  660. are initialized.  Both definitions have an unsized array in the structure, 
  661. but some compilers do not support this.  If so, define __Z_INIT_EXT__.  If 
  662. not, a separate array must be defined (see the sample code).  The second 
  663. macro is __Z_SECVID__.  This option controls how the physical screen is 
  664. updated by Z-Forms.  If VioGetBuf and VioShowBuf are not supported, define 
  665. __Z_SECVID__ and Z-Forms will use VioWrtCellStr instead.
  666.     The option definitions for the standard compilers are:
  667.     Microsoft C 6.0:         __Z_INIT_EXT__
  668.     Borland C/C++ for DOS:   __Z_SECVID__
  669.     IBM C/Set:               __Z_SECVID__
  670.     Borland C/C++ for OS/2:  __Z_SECVID__
  671.     EMX/GCC:                 __Z_SECVID__
  672.  
  673. Functions Reference:
  674. **************************************************************
  675. WINDOW * Z_OpenWindow(WINDOW * pWin)
  676.         pWin    : Address of an initialized window structure
  677.  
  678.         This function defines and displays a window.  Z_DefineWindow and 
  679. Z_CreateWindow are called from here, so this is usually the only function 
  680. that must be called to open a new window.
  681.  
  682. Return Value: Pointer to the real window structure.
  683.  
  684. **************************************************************
  685. void Z_CloseWindow(WINDOW * pWin)
  686.         pWin    : pointer to the window structure to close
  687.  
  688.         This function hides the window and undefines it.  This is usually 
  689. the only function that must be called to close a window.
  690.  
  691. Return Value: none
  692.  
  693. **************************************************************
  694. WINDOW * Z_CreateWindow(WINDOW * temp, int Height, int Width,
  695.            int XOrg, int YOrg, int DefaultChar, int Border,
  696.            int For, int Back, char *Title, char *SubTitle)
  697.         temp    : pointer to window structure to be defined
  698.         Height  : window height
  699.         Width   : window width
  700.         XOrg    : Physical X Origin on the screen
  701.         YOrg    : Physical Y origin
  702.         DefaultChar : character to fill the window with
  703.         Border  : Border style identifier:
  704.                   BS_NOBORDER
  705.                   BS_DOUBLELINE
  706.                   BS_SINGLELINE
  707.         For     : Forground color
  708.         Back    : Background color
  709.         DropShadow : Drop shadow identifier:
  710.                      DS_UPPERLEFT
  711.                      DS_UPPERRIGHT
  712.                      DS_LOWERRIGHT
  713.                      DS_LOWERLEFT
  714.                      DS_NONE
  715.         DropAttr : Background attribute to use for the shadow
  716.         Title   : pointer to window title, or NULL for none
  717.         SubTitle : pointer to window subtitle, or NULL for none
  718.  
  719.         This function fills a window structure from the data given.  The 
  720. window must then be defined and shown.  This function would be used to 
  721. create a window structure 'on the fly'.
  722.  
  723. Return Value: Pointer to the filled window structure (temp)
  724.  
  725. **************************************************************
  726. WINDOW * Z_DefineWindow(WINDOW * pWin)
  727.         pWin    : pointer to window to define
  728.  
  729.         This function fills a new window structure with the data from pWin, 
  730. initializes the window's virtual buffer, and returns the new window 
  731. structure pointer.  This pointer is different from the original pointer, so 
  732. that several windows can be created from the same pWin structure.  The 
  733. window is initially hidden, and must be shown using Z_ShowWindow.  This 
  734. function does not need to be used if Z_OpenWindow is used.
  735.  
  736. Return Value: Pointer to the real window structure
  737.  
  738. **************************************************************
  739. void Z_UnDefineWindow(WINDOW * pWin)
  740.         pWin    : window to undefine
  741.  
  742.         This function removes the window from the linked window list, and 
  743. hides it.  All memory allocated for the window's virtual buffers is freed.
  744.  
  745. Return Value: none
  746.  
  747. **************************************************************
  748. void Z_HideWindow(WINDOW * pWin)
  749.         pWin    : Window to hide
  750.  
  751.         This function makes the window non-displayable, but does not destroy 
  752. it.  The window may still be written to, but it will not be visible until 
  753. Z_ShowWindow is called.
  754.  
  755. Return Value: none
  756.  
  757. **************************************************************
  758. void Z_ShowWindow(WINDOW * pWin)
  759.         pWin    : Window to show
  760.  
  761.         This function causes a hidden window to be displayed, and must be 
  762. called after a new window is defined, as all new windows are initially 
  763. hidden.  If Z_OpenWindow is used, this function does not need to be called.
  764.  
  765. Return Value: none
  766.  
  767. **************************************************************
  768. void Z_PushWindow(WINDOW * pWin)
  769.         pWin    : Window to push
  770.  
  771.         This function pushes a window to the back of the screen, placing it 
  772. behind all other windows.  The window is still visible (except for the parts 
  773. that are covered by other windows), and will still be updated if written to.
  774.  
  775. Return Value: none
  776.  
  777.  
  778. **************************************************************
  779. void Z_PopWindow(WINDOW * pWin)
  780.         pWin    : Window to show
  781.  
  782.         This function pops a window to the front of the screen, placing it 
  783. in front of all other windows.
  784.  
  785. Return Value: none
  786.  
  787. **************************************************************
  788. int Z_GetCharOnTop(WINDOW * pWin, int x, int y)
  789.         pWin    : Window to show
  790.         x       : X-Coordinate of the character
  791.         y       : Y-Coordinate of the character
  792.                                                                   
  793.         This function is used internally to determine what character is 
  794. visible at this physical screen location.  It should never be needed by the 
  795. programmer, but is documented on the chance that someone may find it useful.   
  796. The x and y coordinates are with respect to the window.  The return value is 
  797. the character that the user sees at that position (from the top-most 
  798. window).
  799.  
  800. Return Value: Character/Attribute pair of the top character
  801.  
  802. **************************************************************
  803. void Z_UpdatePhysicalScreen(WINDOW * pWin, int x0, int y0, int Wid, int Ht)
  804.         pWin    : Window to show
  805.         x0      : X-Coordinate of the region
  806.         y0      : Y-Coordinate of the region
  807.         Wid     : Width of the region
  808.         Ht      : Height of the region
  809.                                                                   
  810.         This function is used internally to update the physical display from 
  811. the virtual screen buffers.  It should never be needed by the programmer, 
  812. but is documented on the chance that someone may find it useful.  The 
  813. rectangle defined by x0,y0 and Wid/Ht is displayed on the physical screen 
  814. (x0 and y0 are with respect to the window pWin).  For each character in the 
  815. region, Z_GetCharOnTop is used to find the actual visible character.  
  816.  
  817. Return Value: none
  818.  
  819. **************************************************************
  820. void Z_TextOut(WINDOW *pWin, char * text, int X, int Y,
  821.                int For, int Back)
  822.         pWin    : window pointer to display on
  823.         text    : pointer to text to display
  824.         X       : local window X co-ordinate to display on
  825.         Y       : local window Y co-ordinate to display on
  826.         For     : forground color to use, or attribute byte if Back is -1
  827.         Back    : background color to use, or -1
  828.  
  829.         This function displays the text in 'text' at the co-ordinates (X,Y) 
  830. on the window.  The text is displayed using the foreground and background 
  831. colors given.
  832.  
  833. Return Value: none
  834.  
  835. **************************************************************
  836. void Z_TextOver(WINDOW * pWin, char * text, int LocalX, int LocalY)
  837.         pWin    : window to display text on
  838.         text    : pointer to text
  839.         X       : local X co-ordinate to use
  840.         Y       : local Y co-ordinate to use
  841.  
  842.         This function displays the text in 'text' on the window without 
  843. changing the color or attribute at the position.
  844.  
  845. Return Value: none
  846. **************************************************************
  847. void Z_CharOut(WINDOW *pWin, char text, int X, int Y,
  848.                int For, int Back)
  849.         pWin    : window pointer to display on
  850.         text    : character to display
  851.         X       : local window X co-ordinate to display on
  852.         Y       : local window Y co-ordinate to display on
  853.         For     : forground color to use, or attribute byte if Back is -1
  854.         Back    : background color to use, or -1
  855.  
  856.         This function displays the character in 'text' at the co-ordinates 
  857. (X,Y) on the window.  The text is displayed using the foreground and 
  858. background colors given.
  859.  
  860. Return Value: none
  861. **************************************************************
  862. void Z_CharOver(WINDOW * pWin, char text, int LocalX, int LocalY)
  863.         pWin    : window to display text on
  864.         text    : character to display
  865.         X       : local X co-ordinate to use
  866.         Y       : local Y co-ordinate to use
  867.  
  868.         This function displays the character in 'text' on the window without 
  869. changing the color or attribute at the position.
  870.  
  871. Return Value: none
  872. **************************************************************
  873. void Z_CharOutAtCursor(WINDOW *pWin, char text, int For, int Back)
  874.         pWin    : window pointer to display on
  875.         text    : character to display
  876.         For     : forground color to use, or attribute byte if Back is -1
  877.         Back    : background color to use, or -1
  878.  
  879.         This function displays the character in 'text' at the co-ordinates 
  880. of the cursor.  The cursor must be within the specified window.  The text is 
  881. displayed using the foreground and background colors given.
  882.  
  883. Return Value: none
  884.  
  885. **************************************************************
  886. void Z_CharOverAtCursor(WINDOW * pWin, char text)
  887.         pWin    : window to display text on
  888.         text    : character to display
  889.  
  890.         This function displays the character in 'text' on the window at the 
  891. current cursor position without changing the color or attribute at the 
  892. position.  The cursor must be within the specified window.
  893.  
  894. Return Value: none
  895. **************************************************************
  896. void Z_CharOutTTY(WINDOW *pWin, char text, int For, int Back)
  897.         pWin    : window pointer to display on
  898.         text    : character to display
  899.         For     : forground color to use, or attribute byte if Back is -1
  900.         Back    : background color to use, or -1
  901.  
  902.         This function displays the character in 'text' at the current cursor 
  903. position, then increments the cursor one column to the right.  If the cursor 
  904. has reached the right edge of the window, the cursor is moved to the start 
  905. of the next line.  If the cursor has moved beyond the last row, the window 
  906. is scrolled up one line.  The cursor must be on the specified window.  The 
  907. text is displayed using the foreground and background colors given.
  908.  
  909. Return Value: none
  910. **************************************************************
  911. void Z_CharOverTTY(WINDOW * pWin, char text)
  912.         pWin    : window to display text on
  913.         text    : character to display
  914.  
  915.         This function displays the character in 'text' at the current cursor 
  916. position, then increments the cursor one column to the right.  If the cursor 
  917. has reached the right edge of the window, the cursor is moved to the start 
  918. of the next line.  If the cursor has moved beyond the last row, the window 
  919. is scrolled up one line.  The cursor must be on the specified window. The 
  920. text is displayed without changing the color or attribute at the position.
  921.  
  922. Return Value: none
  923. **************************************************************
  924. void Z_ClearScreen(char Character, char Attribute)
  925.  
  926.         This function clears the screen, filling it with the given character 
  927. at the given attribute.
  928.  
  929. Return Value: none
  930.  
  931. **************************************************************
  932. void Z_GetVideoMode(void)
  933.  
  934.         This function determines the number of rows and columns for the 
  935. current display mode, and puts them in the Z-Forms global variables 
  936. 'Z_ScreenWidth' and 'Z_ScreenHeight'.
  937.  
  938. Return Value: none
  939.  
  940.  
  941. **************************************************************
  942. void Z_SetVideoMode(int Rows, int Cols)
  943.         Rows    : Number of rows to set
  944.         Cols    : Number of columns to set                                      
  945.  
  946.         This function attempts to set the display mode to the number of rows 
  947. and columns specified.  Note that the operating system may not allow the 
  948. row/column count specified.  Regardless of the outcome, the Z-Forms global 
  949. variables 'Z_ScreenWidth' and 'Z_ScreenHeight' will be set to the actual 
  950. number of rows and columns.
  951.  
  952. Return Value: none
  953.  
  954. **************************************************************
  955. void Z_ScrollUp(WINDOW *pWin, int Lines)
  956.         pWin    : pointer to window
  957.         Lines   : Number or lines to scroll
  958.  
  959.         This function scrolls the contents of the specified window up one 
  960. line.
  961.  
  962. Return Value: none
  963.  
  964. **************************************************************
  965. void Z_ScrollDown(WINDOW *pWin, int Lines)
  966.         pWin    : pointer to window
  967.         Lines   : Number or lines to scroll
  968.  
  969.         This function scrolls the contents of the specified window down one 
  970. line.
  971.  
  972. Return Value: none
  973.  
  974. **************************************************************
  975. void Z_ClearWindow(WINDOW *pWin)
  976.         pWin    : pointer to window to clear
  977.  
  978.         This function clears the window by setting all characters to the 
  979. default character.
  980.  
  981. Return Value: none
  982.  
  983. **************************************************************
  984. void Z_Beep(unsigned int Freq, unsigned int Dur)
  985.         Freq    : Frequency of the tone, or 0 for a delay only
  986.         Dur     : Duration of the tone
  987.  
  988.         This function sounds the speaker at the specified frequency, and for 
  989. the specified length of time.
  990.  
  991. Return Value: none
  992.  
  993.  
  994. **************************************************************
  995. void Z_Alert(int Alert)
  996.         Alert   : Identifier of the alert to use
  997.                   ALERT_THREEBEEP
  998.                   ALERT_TWOTONES
  999.                   ALERT_PING
  1000.                   ALERT_WARNING
  1001.  
  1002.         This function sound the speaker with a predefined sequence of tones.
  1003.  
  1004. Return Value: none
  1005.  
  1006. **************************************************************
  1007. void Z_SetCursor(WINDOW *pWin, int X, int Y)
  1008.         pWin    : pointer to window
  1009.         X       : X offset for cursor
  1010.         Y       : Y offset for cursor
  1011.  
  1012.         This function moves the hardware cursor to the position specified by 
  1013. (X,Y) on the designated window.
  1014.  
  1015. Return Value: none
  1016.  
  1017. **************************************************************
  1018. void Z_GetCursor(WINDOW *pWin, int *X, int *Y)
  1019.         pWin    : pointer to window
  1020.         X       : pointer to X offset for cursor
  1021.         Y       : pointer Y offset for cursor
  1022.  
  1023.         This function retrieves the coordinates of the hardware cursor with 
  1024. respect to the specified window.  The values are placed in X and Y.
  1025.  
  1026. Return Value: none
  1027.  
  1028. **************************************************************
  1029. void Z_MoveCursorCol(WINDOW *pWin, int Delta)
  1030.         pWin    : pointer to window
  1031.         Delta   : number of columns to move the cursor
  1032.  
  1033.         This function moves the cursor along the current row by the 
  1034. specified number of columns.  If the cursor would be moved past the edge of 
  1035. the window, it will be set to the edge.
  1036.  
  1037. Return Value: none
  1038.  
  1039. **************************************************************
  1040. int Z_HandleMenu(MENU *pMenu)
  1041.         pMenu   : Pointer to the menu to use
  1042.  
  1043.         This function handles all menu processing for the designated menu.  
  1044. The menu structure is predefined, and includes support for nested menus, 
  1045. vertical menus, and horizontal menus.  For more information, see the MENU 
  1046. structure documentation.  In most cases, this is the only menu function that 
  1047. will need to be called.
  1048.  
  1049. Return Value: none
  1050. **************************************************************
  1051. void Z_DisplayMenuSelection(MENU *pMenu, WINDOW *pWin, int Item, int 
  1052. fHilite)
  1053.         pMenu   : Pointer to the menu to use
  1054.         pWin    : Window that the menu is displayed on
  1055.         Item    : Item number to display
  1056.         fHilite : Flag indicating whether the item is selected
  1057.  
  1058.         This function should not generally be needed by the programmer, but 
  1059. is included in case it turns out to be useful.  The function updates the 
  1060. menu text for the menu item selected by Item.  If fHilite is true, the 
  1061. hilighted colors ase used, otherwise the standard colors are used.
  1062.  
  1063. Return Value: none
  1064.  
  1065. **************************************************************
  1066. int Z_CountMenuItems(MENU *pMenu)
  1067.         pMenu   : Pointer to the menu to use
  1068.  
  1069.         This function returns the number of items in the menu structure 
  1070. pointed to by pMenu.
  1071.  
  1072. Return Value: The number of items in the menu
  1073.  
  1074. **************************************************************
  1075. int Z_HandleDialog(DIALOG * pDialog)
  1076.         pDialog : pointer to dialog box structure
  1077.  
  1078.         This function handles all processing for the dialog box.  The dialog 
  1079. box structure is predefined, and supports buttons and text.  For more 
  1080. information, see the DIALOG structure documentation.
  1081.  
  1082. Return Value: the control number which terminated the dialog box
  1083.  
  1084. **************************************************************
  1085. int Z_InformUser(char * Title, char * Text, char * Button1, char * Button2)
  1086.         Title   : Pointer to the title of the inform box
  1087.         Text    : Pointer to the text to display in the box
  1088.         Button1 : Pointer to the text for Button 1
  1089.         Button2 : Pointer to the text for Button 2, or NULL for
  1090.                     none
  1091.  
  1092.         This function implements a pre-defined dialog box for informing the 
  1093. user or asking a yes/no type question.  The title and text are centered on 
  1094. the window, which is centered on the physical display.  If two buttons are 
  1095. defined, they are displayed against the sides of the box, and if only one 
  1096. button is defined, it is centered.
  1097.  
  1098. Return Value: 1 if Button 1 is pressed, 0 if Button 2 is pressed
  1099.  
  1100.  
  1101. **************************************************************
  1102. int Z_CountDialogItems(DIALOG *pDlg)
  1103.         pDlg    : Pointer to the dialog box structure
  1104.  
  1105.         This function counts the number of dialog items in the dialog box 
  1106. structure.
  1107.  
  1108. Return Value: The number of dialog items
  1109.  
  1110. *************************************************************
  1111. int Z_GetKey(void)
  1112.         This function waits for a key to be pressed, and returns it.  The 
  1113. keys are defined in the header file.  If there is a background function 
  1114. defined, it is called as long as there is no keypress (See 
  1115. Z_SetBackgroundProcess).  The key codes are listed in ZFORMS.H
  1116.  
  1117. Return Value: key pressed
  1118.  
  1119. **************************************************************
  1120. void Z_Delay(int Milli)
  1121.         Milli   : Number of milliseconds to delay
  1122.  
  1123.         This function pauses the program for the specified number of 
  1124. milliseconds.  This function is included for the benefit of DOS programs 
  1125. which do not have DosSleep.
  1126.  
  1127. Return Value: none
  1128.  
  1129. **************************************************************
  1130. int Z_HandleInputs(WINDOW * pWin, WINDOW * pHintWin, 
  1131.         PROMPT * Tmp, int * ExitKeys)
  1132.         pWin    : pointer to window structure to display on
  1133.         pHintwin : pointer to hint window
  1134.         Tmp     : prompt structure
  1135.         ExitKeys : array of keys used to exit
  1136.  
  1137.         This function handles all keyboard input for a prompt structure.  
  1138. The structure is predefined with all prompts and positions, then this 
  1139. funxtion prompts the user to fill all of the fields.  The function exits 
  1140. when one of the keys listed in the ExitKeys list is pressed.  For more 
  1141. information, see the PROMPT structure documentation.
  1142.  
  1143. Return Value: the Exit Key pressed
  1144.  
  1145. **************************************************************
  1146. int Z_SetBackgroundProcess(void (*pFunc)(void), int Milli)
  1147.         pFunc    : pointer to the function to execute
  1148.         Milli    : number of milliseconds to delay
  1149.  
  1150.         This function sets up a background function for execution when the 
  1151. program is waiting for a keystroke.  If the function pointer is NULL, no 
  1152. function is executed (This is the default).
  1153.         
  1154. Return Value: none
  1155.  
  1156.  
  1157. **************************************************************
  1158. int Z_AddPickListItem(PICKLIST *pPickList, char * Text)
  1159.         pPickList : pointer to picklist to use
  1160.         Text      : pointer to text string to add
  1161.  
  1162.         This function handles adds a text string to a picklist.  The string 
  1163. is linked in to the end of the list. 
  1164.  
  1165. Return Value: 1 if the function was successful, 0 otherwise
  1166.  
  1167. **************************************************************
  1168. int Z_RemovePickListItem(PICKLIST *pPickList, char * Text)
  1169.         pPickList : pointer to picklist to use
  1170.         Text      : pointer to text string to remove
  1171.  
  1172.         This function handles removes a text string from a picklist.  The 
  1173. picklist item is found by matching the text to the picklist items.
  1174.  
  1175. Return Value: 1 if the function was successful, 0 otherwise
  1176.  
  1177. **************************************************************
  1178. int Z_RemovePickListEntry(PICKLIST *pPickList, PICKLIST_ITEM **pPLI)
  1179.         pPickList : pointer to picklist to use
  1180.         pPLI      : pointer to the picklist item to remove
  1181.  
  1182.         This function handles removes a picklist item from the list.
  1183.  
  1184. Return Value: 1 if the function was successful, 0 otherwise
  1185.  
  1186. **************************************************************
  1187. void Z_DestroyPickList(PICKLIST *pPickList)
  1188.         pPickList : pointer to picklist to destroy
  1189.  
  1190.         This function destroys all picklist items and frees all memory.
  1191.  
  1192. Return Value: none
  1193.  
  1194. **************************************************************
  1195. void Z_PurgePickList(PICKLIST *pPickList)
  1196.         pPickList : pointer to picklist to purge
  1197.  
  1198.         This function destroys all picklist items, leaving a blank picklist.
  1199.  
  1200. Return Value: none
  1201.  
  1202. **************************************************************
  1203. PICKLIST_ITEM * Z_HandlePickList(PICKLIST *pPickList)
  1204.         pPickList : pointer to picklist to use
  1205.  
  1206.         This function handles a picklist.  The picklist is displayed with 
  1207. the first item highlighted.  The user may use the up and down arrow keys to 
  1208. manuever the list.  Pressing enter causes the list to exit, returning a 
  1209. pointer to the selected item, while pressing escape returns NULL.
  1210.  
  1211. Return Value: a pointer to the selected PICKLIST_ITEM structure if ENTER is 
  1212. pressed, or NULL if ESCAPE is pressed.
  1213.  
  1214. **************************************************************
  1215. void Z_InsertKey(int Key)
  1216.         Key : keyboard character to insert
  1217.  
  1218.         This function causes the character in Key to be inserted into the 
  1219. keyboard stream, as though the user had typed it.  The character may be an 
  1220. ASCII character (such as '0' or 's'), or one of the pre-defined Z-Forms key 
  1221. definitions (such as k_Alt_F6).
  1222.  
  1223. Return Value: none
  1224.  
  1225. **************************************************************
  1226. void Z_InsertKeyString(char *Keys)
  1227.         Keys : pointer to string insert
  1228.  
  1229.         This function causes the characters in the string pointed to by Keys 
  1230. to be inserted into the keyboard stream, as though the user had typed them.  
  1231. The character must be ASCII (such as "Ab23").
  1232.  
  1233. Return Value: none
  1234.  
  1235.  
  1236. REGISTERING Z-FORMS
  1237. ===================
  1238. To register Z-Forms, simply print out this form, fill it in, and mail it 
  1239. along with a check.  Registration is $35 US for the libraries, or $65 for a 
  1240. source code registration (add $1.00 for orders outside the US) made out to 
  1241. "Z-Space".  Checks from Canadian banks must include an extra $5 to cover 
  1242. exchange costs.
  1243.  
  1244.                     Z-Space
  1245.                     4278 W. 223rd Street
  1246.                     Cleveland, Ohio 44126
  1247.  
  1248.     Name:    ____________________________________________
  1249.  
  1250.     Address: ____________________________________________
  1251.  
  1252.              ____________________________________________
  1253.  
  1254.     City/State: _________________________________________
  1255.  
  1256.     Phone (optional)
  1257.            Home: _____________    Work:  ________________
  1258.  
  1259.  
  1260.     EMail addresses:_____________________________________
  1261.  
  1262.     Registration:   [ ] Library ($35)     [ ] Library + Source ($65)
  1263.  
  1264.     Compiler you are using Z-Forms with:_________________
  1265.  
  1266.  
  1267.     Where did you get your copy of Z-Forms?:_____________
  1268.  
  1269.  
  1270.     Are you interested in any other Z-Forms related tools
  1271.    (screen editors, code generators, etc)? Please specify:
  1272.  
  1273.     _____________________________________________________
  1274.  
  1275.  
  1276.  
  1277.     =============================================================
  1278.     Comments or suggestions?  (please print below and/or on back)
  1279.  
  1280.