home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / CONTRIB / MBASE / MBASE51.TAR / mbase51 / src / input.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-04  |  2.6 KB  |  101 lines

  1. /*
  2.  * METALBASE 5.1
  3.  *
  4.  * Released January 1st, 1993 by Huan-Ti [ t-richj@microsoft.com ]
  5.  *
  6.  */
  7.  
  8. #ifndef INPUT_H
  9. #define INPUT_H
  10.  
  11.  
  12. /*
  13.  * OPTIONS --------------------------------------------------------------------
  14.  *
  15.  * If you want the field to be accepted (as with a down arrow) automatically
  16.  * when the user has filled it completely, define ADVANCE_AT_END as below.
  17.  * This makes DE feel a bit more natural to some.  Otherwise, comment out this
  18.  * line.
  19.  *
  20.  */
  21.  
  22. #define ADVANCE_AT_END
  23.  
  24. /*
  25.  * If you have usleep(), and your arrows act up (don't respond or give
  26.  * garbage), define TROUBLE when you compile this module.
  27.  *
  28.  */
  29.  
  30. /* #define TROUBLE */
  31.  
  32. /*
  33.  * Choose a default editor for multi-length character fields.  By default,
  34.  * MB will choose "edit" for MS-DOS systems, and "vi" for anything else.
  35.  * Just replace this whole thing...
  36.  *
  37.  */
  38.  
  39. #ifdef MSDOS
  40. #define DEFAULT_EDITOR "edit"
  41. #else
  42. #define DEFAULT_EDITOR "vi"
  43. #endif
  44.  
  45.  
  46. /*
  47.  * CURSES DECLARATIONS --------------------------------------------------------
  48.  *
  49.  */
  50.  
  51. #include <curses.h>
  52.  
  53. #ifdef MSDOS          /*                                                     */
  54. #ifdef KEY_RIGHT      /* If this is defined in curses.h, the curses package  */
  55. #define USE_CURKEY    /* supports keypad mode, and can trap our keys itself. */
  56. #endif                /* Otherwise, we have to use our own esc-sequences.    */
  57. #endif                /*                                                     */
  58.  
  59. #define movech(c,y,x)  move(y,x);  refresh();  c=getarr();
  60.  
  61. #define AR_UP    (char)129  /* Arrows for input.c */
  62. #define AR_DOWN  (char)130
  63. #define AR_LEFT  (char)131
  64. #define AR_RIGHT (char)132
  65. #define AR_INS   (char)133  /* Insert, Delete, Home, End, PgUp, PgDn */
  66. #define AR_DEL   (char)134
  67. #define AR_HOME  (char)135
  68. #define AR_END   (char)136
  69. #define AR_PGUP  (char)137
  70. #define AR_PGDN  (char)138
  71.  
  72. extern WINDOW *win;
  73. extern char    editorname[128];
  74.  
  75. /*
  76.  * FUNCTION PROTOTYPES --------------------------------------------------------
  77.  *
  78.  * Most curses packages include a typedef for bool; if so, strip ours out.
  79.  * Note that, if your curses package uses 'int' for booleans instead of
  80.  * 'char' (as MetalBase would usually do), you'll need to modify "mbase.h"
  81.  * to use 'int' for booleans, and recompile your library.
  82.  *
  83.  */
  84.  
  85. #ifndef NO_BOOL
  86. #define NO_BOOL
  87. #endif
  88.  
  89. #ifndef MBASE_H
  90. #include <mbase.h>
  91. #endif
  92.  
  93.    void       init_curses    XARGS( (void) );
  94.    void       exit_curses    XARGS( (void) );
  95.    void       display        XARGS( (dataptr, int, int) );
  96.    char       getarr         XARGS( (void) );
  97.    char       input          XARGS( (dataptr, int, int) );
  98.  
  99. #endif  /* INPUT_H */
  100.  
  101.