home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 327_01 / help4.txt < prev    next >
Text File  |  1991-10-09  |  4KB  |  102 lines

  1. +                        PROGRAMMING WITH PANELS
  2.  
  3.  
  4.     Only a few Panel routines are needed to do complete screen level I/O
  5.     with your application program.  What follows here and on subsequent pages
  6.     is a description of each routine available to link with your program.
  7.  
  8. +   void pan_init();
  9.  
  10.     This function performs miscellaneous initialization tasks and must
  11.     be the first panel function called by the application program.
  12.  
  13. +   void pan_activate(char *fn);
  14.  
  15.     This routine will paint the screen using the panel defined in the text
  16.     file <fn>.pan.  Memory is allocated for a panel variable table.  If
  17.     a panel was previously active it will exist behind the new panel.
  18.     Optionally, the character string fn may be a complete panel definition.
  19.     The activate function determines whether the string is a file name or
  20.     a panel definition by the presence or absence of a newline character
  21.     within the string.  A file name will not have a newline character in it.
  22.  
  23. +   unsigned pan_execute(char *name, int sub, int alarm);
  24.  
  25.     Positions the cursor to the named field or first unprotected field if
  26.     name is null.  Sub is the subscript of name field.  A bell will sound
  27.     if alarm is true.  Control will return from this routine when a response
  28.     key is pressed.  The response key code (as defined in keys.h ) is the
  29.     return value.
  30.  
  31.     The following is a list of global variables assigned values by the
  32.     pan_execute function:
  33.  
  34.        pan_row         Indicates the row on which the cursor was placed
  35.                        prior to detecting a response key from the user.
  36.  
  37.        pan_col         Indicates the column on which the cursor was placed
  38.                        prior to detecting a response key from the user.
  39.  
  40.        pan_field_name  Indicates the current field name under the cursor
  41.                        when the user pressed a response key.
  42.  
  43.        pan_field_sub   Indicates the current field subscript under the
  44.                        cursor when the user pressed a response key.
  45.  
  46.  
  47. +   void pan_destroy();
  48.  
  49.     This routine frees memory occupied by the panel variable table and
  50.     restores the panel behind the active panel if present.
  51.  
  52. +   void pan_field_attr(char *name, int sub, char *attr);
  53.  
  54.     Changes the screen attributes of the named panel field after the
  55.     panel has been activated.  Useful for indicating an error to the user
  56.     by highlighting or blinking the contents of the erronious field.
  57.  
  58. +   void pan_put_field(char *name, int sub, char *value);
  59.  
  60.     This routine transfers value to the named panel field.
  61.  
  62.  
  63. +   void pan_get_field(char *name, int sub, char *value);
  64.  
  65.     This routine transfers the named panel field to  value .
  66.  
  67. +   void pan_sound(int freq, int dur);
  68.  
  69.     Produces a sound of freq frequency and at least dur duration on the
  70.     speaker.  The duration is in hundreths of a second.
  71.  
  72. +   void pan_delay(int dur);
  73.  
  74.     Wait for at least dur hundreths of a second to elapse.
  75.  
  76. +   unsigned pan_get_key();
  77.  
  78.     Wait for a keystroke from the user and return the key code as defined
  79.     within the KEYS.H header file.
  80.  
  81. +   void pan_idle_func(int (*func)());
  82.  
  83.     Sets up a user supplied function to be called while pan_execute or
  84.     pan_get_key is waiting for a keystroke from the user.  func is a
  85.     pointer to a function which returns an integer value.  The NULLF
  86.     value, defined within panel.h may be used to disable an idle
  87.     function call.
  88.  
  89. +   void pan_error(16, int line, char *msg);
  90.  
  91.     Abort the application program by cleaning up any active panels.  This
  92.     function then displays the msg parameter and line number if not zero.
  93.  
  94. +   void pan_resp_keys(unsigned resp_keys[]);
  95.  
  96.     This function allows the programmer to override the default set of
  97.     response keys.  The argument is a table to key codes terminated
  98.     with a zero entry.
  99.  
  100.  
  101.                            *** END OF TOPIC ***
  102.