home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / FACETV.ZIP / TVYESNO.H < prev    next >
C/C++ Source or Header  |  1993-12-09  |  3KB  |  117 lines

  1. /************************************************************************
  2. **
  3. ** @(#)tvyesno.h    04/29/92    Chris Ahlstrom
  4. **
  5. **    C++ version, depends upon Turbo Vision, too.
  6. **
  7. **    Simply defines a static array that describes a very
  8. ** simply set of radio-buttons:  yes or no buttons.
  9. **
  10. **    Note the "Not Applicable" entry is no longer in service.
  11. **
  12. **    Note that it is sometimes better to use a CheckBox instead, as
  13. ** shown in the following two alternatives:
  14. **
  15. **    1.  Radio buttons:
  16. **
  17. **        Save the File?
  18. **        ( ) No
  19. **        (.) Yes
  20. **
  21. **    2.  Check box:
  22. **
  23. **        [X] Save the File
  24. **
  25. **    In either case, the YesNoType enum describes all possible
  26. ** values.
  27. **
  28. *************************************************************************/
  29.  
  30. #if !defined(TVYESNO_h)                /* { TVYESNO_h        */
  31. #define TVYESNO_h
  32.  
  33. #define Uses_TCheckBoxes
  34. #define Uses_TRadioButtons
  35. #include <tv.h>                    /* Turbo Vision code    */
  36.  
  37.  
  38. /************************************************************************
  39. ** YesNoType, YesNoCheck, (mod_type.h) and YesNoButtons
  40. **
  41. **    Selections for simple YES/NO radio-buttons.  Be sure to keep
  42. ** these structures in synchrony.
  43. **
  44. **    Note that we add 6 to the width of the widest option, to hold
  45. ** the place of the " ( ) " in the option list, plus one more space on
  46. ** the right of the option list.
  47. **
  48. **    XX is just a placeholder to make it visually obvious that
  49. ** the data is filled in by the program.
  50. **
  51. **    Any program that wants to define the static should
  52. ** #define USE_YES_NO_BUTTONS.  For backward compatibility, we've left
  53. ** in the option to define YES_NO_BUTTONS to fake the header file
  54. ** into thinking the static has already been defined.
  55. **
  56. **    The best policy is to #define USE_YES_NO_BUTTONS at the
  57. ** earliest possible point in the the main program.
  58. **
  59. **    Now, sometimes it's more compact to display a Yes/No options
  60. ** as a one-liner Checkbox.  So, we define an enumeration for that
  61. ** type of box, too.
  62. **
  63. *************************************************************************/
  64.  
  65. typedef enum
  66. {
  67.     NO    = 0,                        /* "no"        */
  68.     YES                            /* "yes"    */
  69.  
  70. } YesNoType;
  71.  
  72. typedef enum
  73. {
  74.     CHECK_NO    = 0,                /* no            */
  75.     CHECK_YES                    /* yes            */
  76.  
  77. } YesNoCheck;
  78.  
  79. #if defined(USE_YES_NO_BUTTONS) && !defined(YES_NO_BUTTONS)
  80. #define YES_NO_BUTTONS            /* { USE_YES_NO_BUTTONS        */
  81.  
  82. #define XX    0                /* "to be filled in"    */
  83.  
  84. #if defined(DEUTSCHE)                    /* { DEUTSCHE    */
  85.  
  86. static char *YesNoButtons[] =
  87. {
  88.     "~N~ein",
  89.     "~J~a",
  90.     NULL
  91. };
  92.  
  93. #else                            /* }{ DEUTSCHE    */
  94.  
  95. static char *YesNoButtons[] =
  96. {
  97.     "~N~o",
  98.     "~Y~es",
  99.     NULL
  100. };
  101.  
  102. #endif                            /* } DEUTSCHE    */
  103.  
  104. const int YesNo_size = (sizeof(YesNoButtons)/sizeof(char *)-1);
  105. const int YesNo_L    = (3+6);            /* length of largest    */
  106.  
  107. #else                    /* }{ USE_YES_NO_BUTTONS    */
  108.  
  109. //extern const int YesNo_size;
  110. //extern const int YesNo_L;
  111.  
  112. #endif                    /* } USE_YES_NO_BUTTONS        */
  113.  
  114.  
  115. #endif                        /* } TVYESNO_h        */
  116.  
  117.