home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / education / a / biology1 / !Biology1 / h / Input < prev    next >
Text File  |  1991-11-23  |  2KB  |  75 lines

  1. /* Input.h */
  2.  
  3. #ifndef __wimp_h
  4.  #include "wimp.h"
  5. #endif
  6.  
  7. #ifndef __input_h
  8. #define __input_h
  9.  
  10.  
  11. typedef struct {int maxlen; char *str;} string;
  12.  
  13. /* concat is intended to be one of the routines I supply,
  14.    finish would be an application routine.
  15.    It is passed it's handle (if applicable), and the string
  16.    which has been input, and the final input char which caused a
  17.    finish (eg maybe return, or escape etc)
  18. */
  19.  
  20. typedef BOOL (*concat_proc) (void *hand, string, int c);
  21. typedef void (*finish_proc) (void *hand, string, int term_c);
  22.  
  23. void input_start (wimp_w wnd, string str,
  24.                   concat_proc concat, void *concat_hand,
  25.                   finish_proc finish, void *finish_hand
  26.                  );
  27.  
  28. void input_key_pressed (wimp_w w, int c);
  29.  
  30.  
  31. /* Wake up routines can be called before starting input to
  32.    pass concat routines extra info (eg what icons to use)
  33. */
  34. void *concat_YNTF_wakeup (wimp_w wnd, wimp_i pos, wimp_i neg);
  35.  
  36. BOOL concat_YN (void *hand, string str, int c);
  37.  
  38. BOOL concat_TF (void *hand, string str, int c);
  39.  
  40. void *concat_string_wakeup (wimp_w wnd, wimp_i icon, string str, int res_type);
  41.  
  42. BOOL concat_string (void *hand, string str, int c);
  43.  
  44. void *concat_ok_wakeup (wimp_w wnd, wimp_i pos);
  45.  
  46. BOOL concat_ok (void *hand, string str, int c);
  47.                                                     
  48. void *concat_choice_wakeup (wimp_w wnd, wimp_i i[], int no);
  49.  
  50. BOOL concat_choice (void *hand, string str, int c);
  51.  
  52. /* Now for a mechanism that enables a click on an icon to produce a 'keypress' */
  53.  
  54. /* Associate the keypress with the icon in question */
  55. void input_icon (wimp_w w, wimp_i i, wimp_i text_i, int keypress);
  56.  
  57. /* Call this routine when there is a click on an icon which may have
  58.    a keypress associated with it. (It doesn't matter if it doesn't)
  59.    Eg maybe call this every time an icon is clicked in a particular window
  60. */
  61. void input_click (wimp_w w, wimp_i i);
  62.  
  63.  
  64. /* Housekeeping, If you've told me about windows & icons, I must be told
  65.    when they die. ( I don't mind being told about deaths of objects I
  66.    don't know about, so no need to check)
  67. */
  68. void input_delete_icon (wimp_w w, wimp_i i);
  69.  
  70. void input_delete_wind (wimp_w w);
  71.  
  72. void input_delete_icons (wimp_w w);
  73.  
  74. #endif
  75.