home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ti2_099d.zip / TI2.ZIP / INCLUDE / TI2.H
C/C++ Source or Header  |  1995-05-16  |  47KB  |  1,062 lines

  1. /* Filename : TI2.H                                                           *
  2.  * Description : Text Interface/2 Precompiled Header                          *
  3.  * Target : TI2.LIB                                                           *
  4.  * Portability : OS/2, DOS                                                    *
  5.  * Creation date : 10/25/94                                                   *
  6.  * Last modified : 04/29/95                                                   */
  7.  
  8. /* Display error message if they try to used this module in a non-C++ program */
  9.  
  10. #ifndef __cplusplus
  11. #error TI/2 is a C++ module.  Please use C++ compilation.
  12. #endif
  13.  
  14. #ifndef _TI2_H_
  15. #define _TI2_H_
  16.  
  17. /****************************
  18.  * System dependant defines *
  19.  ****************************/
  20.  
  21. /* MS-DOS Compilers */
  22. #ifdef __MSDOS__
  23.     /* Define functions and pointers for the correct memory model */
  24. #if defined (__HUGE__) || defined(__LARGE__) || defined(__COMPACT__)
  25. #define FAR                 far
  26. #define FARMALLOC        farmalloc
  27. #define FARCALLOC        farcalloc
  28. #define FARREALLOC     farrealloc
  29.  
  30. #define FARFREE(ptr)                            \
  31.     {                                                                \
  32.         if (ptr != NULL) {                        \
  33.             farfree(ptr);               \
  34.             ptr = NULL;                                    \
  35.         }                                                            \
  36.     }
  37.  
  38. #define FARMEMMOVE    _fmemmove
  39. #define FARMEMSET        _fmemset
  40. #define FARMEMCPY        _fmemcpy
  41.  
  42. #define FREE(ptr)                                    \
  43.     {                                                                \
  44.         if (ptr != NULL) {                        \
  45.             free(ptr);                       \
  46.             ptr = NULL;                                    \
  47.         }                                                            \
  48.     }
  49.  
  50. #else
  51. #define FAR
  52. #define FARMALLOC        malloc
  53. #define FARCALLOC        calloc
  54. #define FARREALLOC    realloc
  55.  
  56. #define FARFREE(ptr)                            \
  57.     {                                                                \
  58.         if (ptr != NULL) {                        \
  59.             free(ptr);                       \
  60.             ptr = NULL;                                    \
  61.         }                                                            \
  62.     }
  63.  
  64. #define FARMEMMOVE    memmove
  65. #define FARMEMSET        memset
  66. #define FARMEMCPY        memcpy
  67.  
  68. #define FREE(ptr)                                    \
  69.     {                                                                \
  70.         if (ptr != NULL) {                        \
  71.             free(ptr);                       \
  72.             ptr = NULL;                                    \
  73.         }                                                            \
  74.     }
  75.  
  76. #endif
  77.  
  78. #endif
  79.  
  80. /* OS/2 Compilers */
  81. #ifdef __OS2__
  82.     /* Define functions and pointers for unsegmented memory */
  83.     #define FAR
  84.     #define FARMALLOC        malloc
  85.     #define FARCALLOC        calloc
  86.     #define FARREALLOC    realloc
  87.  
  88.     #define FARFREE(ptr)                            \
  89.         {                                                                \
  90.             if (ptr != NULL) {                        \
  91.                 free(ptr);                       \
  92.                 ptr = NULL;                                    \
  93.             }                                                            \
  94.         }
  95.  
  96.     #define FARMEMMOVE    memmove
  97.     #define FARMEMSET        memset
  98.     #define FARMEMCPY        memcpy
  99.  
  100.     #define FREE(ptr)                                    \
  101.         {                                                                \
  102.             if (ptr != NULL) {                        \
  103.                 free(ptr);                       \
  104.                 ptr = NULL;                                    \
  105.             }                                                            \
  106.         }
  107.  
  108. #endif
  109.  
  110. /******************
  111.  * Window Defines *
  112.  ******************/
  113.                                                                          /* Miscellaneous attributes for a window */
  114. #define WIN_ACTIVE       (1<<0)      // Window is active
  115. #define WIN_HIDDEN       (1<<1)      // Window is hidden
  116. #define WIN_TITLE_LEFT   (1<<2)      // Left justify title
  117. #define WIN_TITLE_CENTER (1<<3)      // Center title
  118. #define WIN_TITLE_RIGHT  (1<<4)      // Right justify title
  119. #define WIN_TITLE_BOTTOM (1<<5)             // Place title on bottom of window instead of top
  120. #define WIN_TEXT_NO_WRAP (1<<6)      // Don't wrap text output from win_printf to next line.
  121. #define WIN_VSCROLL_BAR  (1<<7)      // Has a vertical scroll bar
  122. #define WIN_HSCROLL_BAR  (1<<8)      // Has a horizontal scroll bar
  123. #define WIN_HORIZ_CNTR   (1<<9)             // Makes window the same height and width as specified, but is centered on screen
  124. #define WIN_VERT_CNTR    (1<<10)         // Makes window the same height and width as specified, but is centered on screen
  125. #define WIN_SCROLL            (1<<11)         // Scrolling on.  Default is off
  126. #define WIN_CURSOR            (1<<12)         // Cursor on. Default off
  127. #define WIN_SEETHRU             (1<<13)         // Window is see thru.
  128. #define WIN_EXPLODE             (1<<14)         // Window explodes when opened
  129. #define WIN_IMPLODE             (1<<15)         // Window implodes when closed
  130.  
  131.                                                                          /* Frame types */
  132. #define WIN_FRAME_NONE         0       // Window has no frame
  133. #define WIN_FRAME_DOUBLEBOX  1
  134. #define WIN_FRAME_SINGLEBOX  2
  135. #define WIN_FRAME_MIXEDBOX1     3
  136. #define WIN_FRAME_MIXEDBOX2  4
  137. #define WIN_FRAME_HATCHBOX1     5
  138. #define WIN_FRAME_DOTTEDLINE 6
  139. #define WIN_FRAME_HATCHBOX2     7
  140. #define WIN_FRAME_HATCHBOX3     8
  141. #define WIN_FRAME_SOLIDBOX1     9
  142. #define WIN_FRAME_SOLIDBOX2     10
  143. #define WIN_FRAME_BLANKBOX     11
  144.                                                                          /* Old window frame defines kept for compatibility */
  145. #define WIN_FRAME_SS           2       // Single line on both sides
  146. #define WIN_FRAME_DD         1       // Double line on both sides
  147. #define WIN_FRAME_DS           4       // Double line on side and single on top
  148. #define WIN_FRAME_SD           3       // Single line on side and double on top
  149.  
  150.                                                                          /* Shadow types */
  151. #define WIN_SHADOW_NONE   0          // No shadow
  152. #define WIN_SHADOW_RIGHT  1          // Shadow on bottom and right side
  153. #define WIN_SHADOW_LEFT   2          // Shadow on top and left side
  154.  
  155. #define TOP                                                    1
  156. #define BOTTOM                                            2
  157. #define LEFT                                                3
  158. #define RIGHT                                                4
  159.  
  160. /********************
  161.  * General Typedefs *
  162.  ********************/
  163.  
  164. typedef unsigned char uchar;
  165. typedef unsigned short int ushort;
  166. typedef unsigned int uint;
  167. typedef unsigned long int ulong;
  168. typedef uchar * puchar;
  169.  
  170. #ifndef _SWDEFS_H
  171.     typedef struct {                /* Fidonet Address */
  172.                                      ushort zone;
  173.                                      ushort net;
  174.                                      ushort node;
  175.                                      ushort point;
  176.                                  } faddr_t;
  177. #endif
  178.  
  179. /***********************
  180.  * Function Prototypes *
  181.  ***********************/
  182.  
  183. #ifdef _EXTPDL_
  184.  
  185. void error_msg                                      (uchar *func_name, uchar *error_msg);
  186. void fatal_error_msg                        (uchar *func_name, uchar *error_msg);
  187.  
  188. #else
  189.  
  190. #define error_msg(func_name, error_msg)    \
  191.         {                                                                        \
  192.             if(func_name || error_msg) {}            \
  193.         }
  194.  
  195. #define fatal_error_msg(func_name, error_msg)    \
  196.         {                                                                        \
  197.             if(func_name || error_msg) {}            \
  198.         }
  199.  
  200. #endif
  201.  
  202.  
  203. /*******************
  204.  * Debug Functions *
  205.  *******************/
  206.  
  207. void  ti2_debug_init        (void);
  208. void  ti2_debug_deinit    (void);
  209. void  ti2_debug_printf    (char *fmt, ...);
  210.  
  211. /**************************
  212.  * Debug Global Variables *
  213.  **************************/
  214.  
  215. extern FILE *ti2_debug_file;                // Stream for debug information file
  216.  
  217. /********************
  218.  * Window Functions *
  219.  ********************/
  220.  
  221. void     win_deinit                (void);
  222. uchar win_init                    (void);
  223. void  win_redraw_all        (void);
  224. void     win_text_mode            (int newmode);
  225. uchar win_xyxy_in_xyxy    (uchar x1, uchar y1, uchar x2, uchar y2, uchar x3, uchar y3, uchar x4, uchar y4);
  226.  
  227. /***************************
  228.  * Window Class Definition *
  229.  ***************************/
  230.  
  231. typedef struct {
  232.                                  uchar                          handle;                // Handle for this window.  The class will also have the same value in handle
  233.                                  uchar                          topxpos,       // X & Y positions of window on screen including
  234.                                                                      topypos,       // border etc. in it
  235.                                                                      botxpos,
  236.                                                                      botypos;
  237.                                  uchar                          frametopxpos,  // Position of frame corners
  238.                                                                      frametopypos,
  239.                                                                      framebotxpos,
  240.                                                                      framebotypos;
  241.                                  uchar                          texttopxpos,   // Position of text part of window
  242.                                                                      texttopypos,
  243.                                                                      textbotxpos,
  244.                                                                      textbotypos;
  245.                                  uchar FAR * FAR * text;                     // Buffer that holds window image. A copy of everything is stored here
  246.                                  uchar                          shadow;        // Shadow type: 0=none, 1=bottem&right, 2=top&left
  247.                                  ushort                      attr;          // Miscellaneous attributes for window.  See below for more information
  248.                                  uchar                          frame;         // Type of frame.  See WIN_FRAME_ below for more information
  249.                              } win_t;
  250.  
  251. class win_c {                                    /* Window Class */
  252.                             private:
  253.                                 /*************
  254.                                  * Variables *
  255.                                  *************/
  256.                                 uchar   handle;                                         // Handle for this window
  257.                                 int     pos;                                             // Position in the window array
  258.                                 uchar   f_fcolor,                    // Current foreground and background color of frame
  259.                                                 f_bcolor;
  260.                                 uchar   t_fcolor,                    // Current foreground and background color of text
  261.                                                 t_bcolor;
  262.                                 uchar * title,                           // Title
  263.                                                 title_fcolor,                // Current foreground and background color of title
  264.                                                 title_bcolor;
  265.                                 uchar   scroll_fcolor,                  // Foreground and background colors for scroll bars
  266.                                                 scroll_bcolor;
  267.                                 uchar   input_norm_fcolor,              // Colors used by all input functions
  268.                                                 input_norm_bcolor,
  269.                                                 input_high_fcolor,
  270.                                                 input_high_bcolor,
  271.                                                 input_blank_fcolor,
  272.                                                 input_blank_bcolor,
  273.                                                 input_text_fcolor,
  274.                                                 input_text_bcolor;
  275.                                 uchar   curr_fcolor,
  276.                                                 curr_bcolor;                             // Current foreground and background colors
  277.                                 uchar   curr_x,                         // Where X position is in window
  278.                                                 curr_y;                         // Where Y position is in window
  279.                                 uchar   scroll_mode;                             // True scrolling is on, False scrolling off
  280.                                 uchar   cursor_mode;                             // True cursor is on, False cursor is off
  281.                                 ushort  vscroll_cur,                    // Numbers that determine scroll bar display
  282.                                                 vscroll_max;                    // Number that determines the maximum value for vscroll_max
  283.                                 ushort  hscroll_cur,
  284.                                                 hscroll_max;
  285.                                 /*************
  286.                                  * Functions *
  287.                                  *************/
  288.                                 uchar  completely_visible                        (void);
  289.                                 void      display_buffer_ch            (uchar *scrn_buffer, uchar x, uchar y, uchar ch_type, uchar visibility);
  290.                                 void   display_ch                                        (uchar x, uchar y, uchar ch_type, uchar visibility);
  291.                                 void   display_part                             (uchar part);
  292.                                 void   focus                                (void);
  293.                                 uchar  get_handle                                        (void);
  294.                                 void      get_hidden_ch                                (uchar x, uchar y, uchar ch_type, uchar *buffer);
  295.                                 void   redraw                                                (void);
  296.                                 void   unhide_buffer_ch             (uchar *scrn_buffer, uchar x, uchar y, uchar ch_type);
  297.                                 void      unhide_ch                    (uchar x, uchar y, uchar ch_type);
  298.                                 uchar  visible_ch                                        (uchar x, uchar y, uchar ch_type);
  299.                                 void   get_pos                                            (void);
  300.                             public:
  301.                                 /*************
  302.                                  * Functions *
  303.                                  *************/
  304.                                 void   center                           (ushort type);
  305.                                 void      clr_eoc                                                (void);
  306.                                 void   clr_eol                              (void);
  307.                                 void   clr_region                       (uchar x1, uchar y1, uchar x2, uchar y2);
  308.                                 void   clr_scr                              (void);
  309.                                 void   cntr_printf                                         (uchar y, char *fmt, ...);
  310.                                 void   col_cntr_printf                  (uchar x, uchar y, char *fmt, ...);
  311.                                 uchar  create                                             (uchar new_topx, uchar new_topy, uchar new_botx, uchar new_boty, uchar new_f_fcolor,
  312.                                                                                                              uchar new_f_bcolor, uchar new_t_fcolor, uchar new_t_bcolor, uchar *new_title,
  313.                                                                                                              uchar new_title_fcolor, uchar new_title_bcolor, uchar new_frame, uchar new_shadow,
  314.                                                                                                              ushort new_attr);
  315.                                 void   cursor_off                                             (void);
  316.                                 void   cursor_on                                            (void);
  317.                                 void   destroy                                 (void);
  318.                                 void   explode                                                (uchar x1, uchar y1, uchar x2, uchar y2);
  319.                                 void   fill                                    (uchar ch);
  320.                                 void   fill_col                                                (uchar col, uchar ch);
  321.                                 void   fill_row                                                (uchar row, uchar ch);
  322.                                 void   frame_change                            (uchar new_frame_type);
  323.                                 void   frame_textbackground             (uchar new_f_bcolor);
  324.                                 void   frame_textcolor                  (uchar new_f_fcolor);
  325.                                 uchar  frame_x_relative               (uchar abs_x);
  326.                                 uchar  frame_y_relative               (uchar abs_y);
  327.                                 ushort get_attr                                                 (void);
  328.                                 void   goto_xy                              (uchar x, uchar y);
  329.                                 void   hide                                    (void);
  330.                                 void   hscroll_create                          (uchar scroll_fcolor, uchar scroll_bcolor, ushort hscroll_cur, ushort hscroll_max);
  331.                                 void   hscroll_destroy                         (void);
  332.                                 uchar  hscroll_left                             (ushort num);
  333.                                 ushort hscroll_mouse_move                            (void);
  334.                                 uchar  hscroll_right                           (ushort num);
  335.                                 void   hscroll_update                          (void);
  336.                                 void   hscroll_update_cur                             (ushort new_hscroll_cur);
  337.                                 void   hscroll_update_cur_and_max            (ushort new_hscroll_cur, ushort new_hscroll_max);
  338.                                 void   hscroll_update_max                             (ushort new_hscroll_max);
  339.                                 void   implode                                                (void);
  340.                                 void   make_normal                                        (void);
  341.                                 void   make_seethru                                        (void);
  342.                                 void   move                                    (uchar newx, uchar newy);
  343.                                 void   nd_printf                          (char *fmt, ...);
  344.                                 void   nd_putch                           (char ch);
  345.                                 void   nd_puts                                                (char *s);
  346.                                 void   popup                                                    (void);
  347.                                 void   redisplay                                            (void);
  348.                                 void     redisplay_text                                    (void);
  349.                                 void   resize                           (uchar side, uchar width);
  350.                                 void   scroll_down                             (void);
  351.                                 void   scroll_left                             (void);
  352.                                 void   scroll_off                                            (void);
  353.                                 void   scroll_on                                            (void);
  354.                                 void   scroll_part_down                                 (uchar topx, uchar topy, uchar botx, uchar boty);
  355.                                 void   scroll_part_left                                 (uchar topx, uchar topy, uchar botx, uchar boty);
  356.                                 void   scroll_part_right                             (uchar topx, uchar topy, uchar botx, uchar boty);
  357.                                 void   scroll_part_up                                     (uchar topx, uchar topy, uchar botx, uchar boty);
  358.                                 void   scroll_right                            (void);
  359.                                 void   scroll_up                               (void);
  360.                                 void   set_attr                                                (ushort new_attr);
  361.                                 void   set_pos                                                (uchar new_pos);
  362.                                 void   slide                            (uchar newx, uchar newy);
  363.                                 void   read_attr                        (uchar *buffer, uchar x, uchar y, ushort len);
  364.                                 void   read_char                        (uchar *buffer, uchar x, uchar y, ushort len);
  365.                                 void   read_char_and_attr               (uchar *buffer, uchar x, uchar y, ushort len);
  366.                                 void   rj_printf                          (uchar x, uchar y, char *fmt, ...);
  367.                                 void   text_background                      (uchar new_t_bcolor);
  368.                                 void   text_color                           (uchar new_t_fcolor);
  369.                                 uchar  text_height                                         (void);
  370.                                 uchar  text_width                                              (void);
  371.                                 uchar  text_x_relative                (uchar abs_x);
  372.                                 uchar  text_y_relative                (uchar abs_y);
  373.                                 void   title_change                                        (uchar *new_title);
  374.                                 void   title_textbackground             (uchar new_title_bcolor);
  375.                                 void   title_textcolor                  (uchar new_title_fcolor);
  376.                                 void   unhide                                  (void);
  377.                                 void   vscroll_create                          (uchar new_scroll_fcolor, uchar new_scroll_bcolor, ushort new_vscroll_cur, ushort new_vscroll_max);
  378.                                 void   vscroll_destroy                         (void);
  379.                                 uchar  vscroll_down                            (ushort num);
  380.                                 ushort vscroll_mouse_move                            (void);
  381.                                 uchar  vscroll_up                              (ushort num);
  382.                                 void   vscroll_update                          (void);
  383.                                 void   vscroll_update_cur                             (ushort new_vscroll_cur);
  384.                                 void   vscroll_update_cur_and_max            (ushort new_vscroll_cur, ushort new_vscroll_max);
  385.                                 void   vscroll_update_max                             (ushort new_vscroll_max);
  386.                                 uchar  where_win_x                                        (void);
  387.                                 uchar  where_win_y                                        (void);
  388.                                 uchar  where_x                                                 (void);
  389.                                 uchar  where_y                                                 (void);
  390.                                 void   width_printf                                        (uchar width, char *fmt, ...);
  391.                                 void   wprintf                              (char *fmt, ...);
  392.                                 void   wputch                               (char ch);
  393.                                 void   wputctrlch                                            (char ch);
  394.                                 void   wputs                                                    (char *s);
  395.                                 uchar  write_text_to_file                  (uchar *filename, uchar newline);
  396.  
  397.  
  398.  
  399.                                 void   input_4d_addr                                       (uchar x, uchar y, faddr_t *addr);
  400.                                 void   input_byte                                              (uchar x, uchar y, uchar *num, uchar min, uchar max);
  401.                                 void   input_frmt_string                              (uchar x, uchar y, uchar *str, uchar *ctrl_str);
  402.                                 void   input_hhmmss                                         (uchar x, uchar y, ulong *t);
  403.                                 void   input_init                                          (uchar new_input_norm_fcolor, uchar new_input_norm_bcolor,
  404.                                                                                                              uchar new_input_high_fcolor, uchar new_input_high_bcolor,
  405.                                                                                                              uchar new_input_blank_fcolor, uchar new_input_blank_bcolor,
  406.                                                                                                              uchar new_input_text_fcolor, uchar new_input_text_bcolor);
  407.                                 void   input_string                                       (uchar x, uchar y, char *s, uchar max_len);
  408.                                 void   input_toggle_uchar_bit_yes_no     (uchar x, uchar y, uchar *toggle, uchar bit);
  409.                                 void   input_toggle_uchar_yes_no             (uchar x, uchar y, uchar *toggle);
  410.                                 void   input_toggle_ulong_bit_yes_no     (uchar x, uchar y, ulong *toggle, ulong bit);
  411.                                 void   input_toggle_ushort_bit_yes_no (uchar x, uchar y, ushort *toggle, ushort bit);
  412.                                 void   input_ulong                                         (uchar x, uchar y, ulong *num, ulong min, ulong max);
  413.                                 void      input_upcase_string                          (uchar x, uchar y, char *s, uchar max_len);
  414.                                 void   input_ushort                                         (uchar x, uchar y, ushort *num, ushort min, ushort max);
  415.                         };
  416.  
  417. /***************************
  418.  * Window Global Variables *
  419.  ***************************/
  420.  
  421. extern win_t FAR * FAR * ti2_windows;          // Array of windows
  422. extern uchar                          ti2_num_windows; // Total number of windows in the array
  423. extern uchar             ti2_destroy_all; // True if win_deinit function is running
  424. extern win_c                          desktop;             // Desktop window.  Has no frame and covers the whole screen.
  425.  
  426. /*****************
  427.  * Menu Typedefs *
  428.  *****************/
  429.  
  430. typedef struct {                                /* Menu command */
  431.                                  ushort  id;                    // Unique ID number for this menu command
  432.                                  uchar * title;                   // Title of menu cmd
  433.                                  uchar   hotkey;                // Hotkey of this command
  434.                                  uchar   active;                // Active menucommand
  435.                                  uchar   type;                  // 0=menucmd, 1=sperator, 2=submenu
  436.                                  ushort  submenu;               // Number of submenu
  437.                              } menucmd_t;
  438.  
  439. typedef struct {                                        /* Submenu */
  440.                                  ushort             parent_id;                        // Unique ID number of submenu which this submenu is under
  441.                                  ushort             id;                   // Unique ID number of submenu
  442.                                  uchar              title_pos;            // Position on menu bar to put title
  443.                                  uchar              active;               // Active submenu
  444.                                  win_c              win;                  // Window to draw submenu in
  445.                                  uchar              menucmd_cur;          // Current menu command
  446.                                  uchar            menucmd_max;          // Maximum number of menucmds in this submenu
  447.                                  ushort FAR * menucmd;                   // Array of menucmd ids that are in this submenu
  448.                                  uchar            longest_menucmd_name; // Length of longest menu command name
  449.                                  uchar *          title;                   // Title of submenu
  450.                                  uchar            hotkey;
  451.                              } submenu_t;
  452.  
  453. typedef struct {                                /* Menu command index */
  454.                                  ushort id;                     // Unique ID of menucmd
  455.                                  ushort pos;                    // Position in menu->menucmds array
  456.                              } menucmds_idx_t;
  457.  
  458. typedef struct {                                /* Submenu index */
  459.                                  ushort id;                     // Unique ID of submenu
  460.                                  ushort pos;                    // Position in menu->submenus array
  461.                              } submenus_idx_t;
  462.  
  463. /*************************
  464.  * Menu Class Definition *
  465.  *************************/
  466.  
  467. class menu_c {                                                                                     /* Menu Class */
  468.                              private:
  469.                                 /*************
  470.                                  * Variables *
  471.                                  *************/
  472.                                  uchar                               line;             // Line menu bar is on
  473.                                  win_c                               title_bar;                // Window for titlebar
  474.                                  uchar                               submenu_cur;      // Current submenu
  475.                                  uchar                               submenu_max;      // Maximum number of sub menus
  476.                                  ushort FAR *                  submenu;          // Array of submenu->id which are directly off of the menu bar
  477.                                  uchar                                pulldown;         // Wether menu is pulled down or just scrolling titles
  478.                                  uchar                               reloading;                // True if reloading menu after a menu command has run
  479.                                  ushort                           result;                        // Menu command id
  480.                                  uchar                               hotkey_fcolor;    // Color of hotkey (character immediately after ~ in title)
  481.                                  uchar                               norm_fcolor;      // Normal foreground and background color
  482.                                  uchar                               norm_bcolor;
  483.                                  uchar                               high_fcolor;      // Highlighted foreground and background color
  484.                                  uchar                               high_bcolor;
  485.                                  uchar                               inactive_fcolor;  // Inactive foreground and background color
  486.                                  uchar                               inactive_bcolor;
  487.                                  uchar                               frame_fcolor;            // Frame color
  488.                                  uchar                               frame_bcolor;
  489.                                  menucmd_t FAR *      menucmds;           // Array of menu commands
  490.                                  ushort               menucmds_max;     // Total number of menucmds for this menu
  491.                                  menucmds_idx_t FAR * menucmds_idx;          // Index of all the menucmds
  492.                                  ushort                       menucmds_idx_max;    // Total number of menucmds indexes
  493.                                  submenu_t             FAR * submenus;           // Array of submenus
  494.                                  ushort                     submenus_max;     // Total number of submenus for this menu
  495.                                  submenus_idx_t FAR * submenus_idx;          // Index of all the submenus
  496.                                  ushort                       submenus_idx_max; // Total number of submenus indexes
  497.                                 /*************
  498.                                  * Functions *
  499.                                  *************/
  500.                                  void  bar_redraw                     (void);
  501.                                  void  next_submenu                   (uchar direction);
  502.                                  int   hotkey                         (uchar key);
  503.                                  void  submenu_redraw_menucmds        (submenu_t FAR *curr_submenu);
  504.                                  void  next_menucmd                   (submenu_t FAR *curr_submenu, uchar direction);
  505.                                  uchar submenu_clicked                        (void);
  506.                                  uchar submenu_or_menucmd_clicked    (submenu_t FAR *curr_submenu, uchar *num);
  507.                                  void  goto_submenu                 (uchar submenu_num);
  508.                                  void  goto_menucmd                 (submenu_t FAR *curr_submenu, uchar menucmd_num);
  509.                                  int   submenu_hotkey                 (submenu_t FAR *curr_submenu, uchar key);
  510.                                  uchar load_submenu                   (submenu_t FAR *curr_submenu, uchar x, uchar y, uchar leftright);
  511.                              public:
  512.                                 /*************
  513.                                  * Functions *
  514.                                  *************/
  515.                                  void   add_menucmd_func           (ushort parent_submenu_id, ushort new_id, uchar *new_title,
  516.                                                                                                  uchar new_hotkey);
  517.                                  void   add_menucmd_separator      (ushort parent_submenu_id, ushort new_id);
  518.                                  void   add_menucmd_submenu            (ushort parent_submenu_id, ushort new_id, ushort new_submenu_id,
  519.                                                                                                  uchar *new_title, uchar new_hotkey);
  520.                                  void   add_submenu                            (ushort new_id, uchar new_title_pos, uchar *new_title, uchar new_hotkey);
  521.                                  void   create                     (uchar new_line, uchar new_hotkey_fcolor,
  522.                                                                                                  uchar new_norm_fcolor, uchar new_norm_bcolor,
  523.                                                                                                  uchar new_high_fcolor, uchar new_high_bcolor,
  524.                                                                                                  uchar new_inactive_fcolor, uchar new_inactive_bcolor,
  525.                                                                                                  uchar new_frame_fcolor, uchar new_frame_bcolor);
  526.                                  void   destroy                    (void);
  527.                                  ushort load                           (void);
  528.                                  void   menucmd_active                     (ushort id);
  529.                                  void   menucmd_inactive                 (ushort id);
  530.                                  void   submenu_active                     (ushort id);
  531.                                  void   submenu_inactive                 (ushort id);
  532.                          };
  533.  
  534. /*****************
  535.  * Form Typedefs *
  536.  *****************/
  537.  
  538. typedef struct {
  539.                                  ushort         id;                        // Unique ID of field
  540.                                  uchar          active;                // Wether this field is active
  541.                                  uchar          type;                    // Type of field.  See FIELD_ defines.
  542.                                  void FAR * data;                    // Point to unique data for this field
  543.                              } form_field_t;
  544.  
  545. typedef struct {
  546.                                  ushort id;                                // Unique ID for field
  547.                                  uchar  ch;                    // Character code to respond to
  548.                                  uchar  extended;                    // Character is an extended character
  549.                                  uchar  active;
  550.                              } form_char_t;
  551.  
  552. typedef struct {
  553.                                  uchar   x;                                // Coordinates inside window for button
  554.                                  uchar   y;
  555.                                  uchar * title;                        // Title of button
  556.                                  uchar   down;                        // True if button depressed
  557.                              } field_button_t;
  558.  
  559. typedef struct {
  560.                                  uchar title_x;
  561.                                  uchar title_y;
  562.                                  uchar *title;
  563.                                  uchar entry_x;
  564.                                  uchar entry_y;
  565.                                  uchar entry_width;        // Width excluding leading and trailing space for input field
  566.                                  uchar *num;
  567.                                  uchar min_num;
  568.                                  uchar max_num;
  569.                              } field_byte_t;
  570.  
  571. typedef struct {
  572.                                  uchar title_x;
  573.                                  uchar title_y;
  574.                                  uchar *title;
  575.                                  uchar entry_x;
  576.                                  uchar entry_y;
  577.                                  uchar entry_width;        // Width excluding leading and trailing space for input field
  578.                                  ushort *num;
  579.                                  ushort min_num;
  580.                                  ushort max_num;
  581.                              } field_ushort_t;
  582.  
  583. typedef struct {
  584.                                  uchar title_x;
  585.                                  uchar title_y;
  586.                                  uchar *title;
  587.                                  uchar entry_x;
  588.                                  uchar entry_y;
  589.                                  uchar entry_width;        // Width excluding leading and trailing space for input field
  590.                                  ulong *num;
  591.                                  ulong min_num;
  592.                                  ulong max_num;
  593.                              } field_ulong_t;
  594.  
  595. typedef struct {
  596.                                  uchar title_x;
  597.                                  uchar title_y;
  598.                                  uchar *title;
  599.                                  uchar entry_x;
  600.                                  uchar entry_y;
  601.                                  uchar entry_width;        // Width excluding leading and trailing space for input field
  602.                                  char *num;
  603.                                  char min_num;
  604.                                  char max_num;
  605.                              } field_char_t;
  606.  
  607. typedef struct {
  608.                                  uchar title_x;
  609.                                  uchar title_y;
  610.                                  uchar *title;
  611.                                  uchar entry_x;
  612.                                  uchar entry_y;
  613.                                  uchar entry_width;        // Width excluding leading and trailing space for input field
  614.                                  int *num;
  615.                                  int min_num;
  616.                                  int max_num;
  617.                              } field_int_t;
  618.  
  619. typedef struct {
  620.                                  uchar title_x;
  621.                                  uchar title_y;
  622.                                  uchar *title;
  623.                                  uchar entry_x;
  624.                                  uchar entry_y;
  625.                                  uchar entry_width;        // Width excluding leading and trailing space for input field
  626.                                  long *num;
  627.                                  long min_num;
  628.                                  long max_num;
  629.                              } field_long_t;
  630.  
  631. typedef struct {
  632.                                  uchar id;
  633.                                  uchar *title;
  634.                                  uchar x;
  635.                                  uchar y;
  636.                                  uchar checked;
  637.                              } field_checkbox_entry_t;
  638.  
  639. typedef struct {
  640.                                  uchar title_x;                       // Coordinates for title
  641.                                  uchar title_y;
  642.                                  uchar *title;                            // Title
  643.                                  uchar boxtopx;                            // Coordinates for box where entries are
  644.                                  uchar boxtopy;
  645.                                  uchar boxbotx;
  646.                                  uchar boxboty;
  647.                                  field_checkbox_entry_t FAR *entrys;    // Array of entries
  648.                                  uchar num_entrys;                    // Number of entries
  649.                                  uchar cur_entrys;                    // Current entry highlighted
  650.                              } field_checkbox_t;
  651.  
  652. typedef struct {
  653.                                  uchar id;
  654.                                  uchar *title;
  655.                                  uchar x;
  656.                                  uchar y;
  657.                              } field_radiobutton_entry_t;
  658.  
  659. typedef struct {
  660.                                  uchar title_x;                       // Coordinates for title
  661.                                  uchar title_y;
  662.                                  uchar *title;                            // Title
  663.                                  uchar boxtopx;                            // Coordinates for box where entries are
  664.                                  uchar boxtopy;
  665.                                  uchar boxbotx;
  666.                                  uchar boxboty;
  667.                                  field_radiobutton_entry_t FAR *entrys;    // Array of entries
  668.                                  uchar num_entrys;                    // Number of entries
  669.                                  uchar cur_entrys;                    // Current entry highlighted
  670.                              } field_radiobutton_t;
  671.  
  672. typedef struct {
  673.                                  uchar title_x;
  674.                                  uchar title_y;
  675.                                  uchar *title;
  676.                                  uchar entry_x;
  677.                                  uchar entry_y;
  678.                                  uchar *str;
  679.                                  uchar view_len;
  680.                                  uchar max_len;
  681.                              } field_string_t;
  682.  
  683. typedef struct {
  684.                                  uchar title_x;
  685.                                  uchar title_y;
  686.                                  uchar *title;
  687.                                  uchar entry_x;
  688.                                  uchar entry_y;
  689.                                  uchar *str;
  690.                                  uchar *ctrl_str;
  691.                                  uchar view_len;
  692.                                  uchar max_len;
  693.                              } field_control_string_t;
  694.  
  695. typedef struct {
  696.                                  uchar title_x;
  697.                                  uchar title_y;
  698.                                  uchar *title;
  699.                                  uchar entry_x;
  700.                                  uchar entry_y;
  701.                                  faddr_t *addr;
  702.                                  uchar view_len;
  703.                              } field_faddr_t;
  704.  
  705. typedef struct {
  706.                                  uchar title_x;
  707.                                  uchar title_y;
  708.                                  uchar *title;
  709.                                  uchar entry_x;
  710.                                  uchar entry_y;
  711.                                  ulong *t;
  712.                              } field_hhmmss_t;
  713.  
  714. typedef struct {
  715.                                  uchar title_x;
  716.                                  uchar title_y;
  717.                                  uchar *title;
  718.                                  uchar entry_x;
  719.                                  uchar entry_y;
  720.                                  ulong *d;
  721.                              } field_mmddyyyy_t;
  722.  
  723. typedef struct {
  724.                                  uchar title_x;
  725.                                  uchar title_y;
  726.                                  uchar *title;
  727.                                  uchar entry_x;
  728.                                  uchar entry_y;
  729.                                  uchar *str;
  730.                                  uchar *ctrl_str;
  731.                                  uchar max_len;
  732.                                  uchar curr_pos;
  733.                                  uchar min_pos;
  734.                                  uchar max_pos;
  735.                              } field_frmt_string_t;
  736.  
  737. typedef struct {
  738.                                  uchar title_x;
  739.                                  uchar title_y;
  740.                                  uchar *title;
  741.                                  uchar entry_x;
  742.                                  uchar entry_y;
  743.                                  uchar *t;
  744.                              } field_toggle_uchar_t;
  745.  
  746. typedef struct {
  747.                                  uchar title_x;
  748.                                  uchar title_y;
  749.                                  uchar *title;
  750.                                  uchar entry_x;
  751.                                  uchar entry_y;
  752.                                  uchar *t;
  753.                                  uchar bit;
  754.                              } field_toggle_uchar_bit_t;
  755.  
  756. typedef struct {
  757.                                  uchar title_x;
  758.                                  uchar title_y;
  759.                                  uchar *title;
  760.                                  uchar entry_x;
  761.                                  uchar entry_y;
  762.                                  ushort *t;
  763.                                  ushort bit;
  764.                              } field_toggle_ushort_bit_t;
  765.  
  766. typedef struct {
  767.                                  uchar title_x;
  768.                                  uchar title_y;
  769.                                  uchar *title;
  770.                                  uchar entry_x;
  771.                                  uchar entry_y;
  772.                                  ulong *t;
  773.                                  ulong bit;
  774.                              } field_toggle_ulong_bit_t;
  775.  
  776. typedef union {                                                        // Pointers to data type specific information
  777.                                 field_button_t                            FAR * button;
  778.                                 field_string_t                        FAR * string;
  779.                                 field_frmt_string_t              FAR * frmt_string;
  780.                                 field_byte_t                               FAR * field_byte;
  781.                                 field_ushort_t                          FAR * field_ushort;
  782.                                 field_ulong_t                           FAR * field_ulong;
  783.                                 field_checkbox_t                       FAR * checkbox;
  784.                                 field_radiobutton_t              FAR * radiobutton;
  785.                                 field_faddr_t                              FAR * field_faddr;
  786.                                 field_hhmmss_t                         FAR * field_hhmmss;
  787.                                 field_mmddyyyy_t                     FAR * field_mmddyyyy;
  788.                                 field_toggle_uchar_t             FAR * field_toggle_uchar;
  789.                                 field_toggle_uchar_bit_t     FAR * field_toggle_uchar_bit;
  790.                                 field_toggle_ushort_bit_t FAR * field_toggle_ushort_bit;
  791.                                 field_toggle_ulong_bit_t     FAR * field_toggle_ulong_bit;
  792.                                 field_char_t                             FAR * field_char;
  793.                                 field_int_t                             FAR * field_int;
  794.                                 field_long_t                             FAR * field_long;
  795.                                 field_control_string_t         FAR * control_string;
  796.                             } field_ptr_t;
  797.  
  798. /****************
  799.  * Form Defines *
  800.  ****************/
  801.  
  802. #define FIELD_BUTTON                     1
  803. #define FIELD_STRING                  2
  804. #define FIELD_UPCASE_STRING         3
  805. #define FIELD_FORMAT_STRING         4
  806. #define FIELD_BYTE                            5
  807. #define FIELD_USHORT                        6
  808. #define FIELD_ULONG                            7
  809. #define FIELD_CHECKBOX                    8
  810. #define FIELD_RADIOBUTTON                9
  811. #define FIELD_4D_ADDR                        10
  812. #define FIELD_HHMMSS                        11
  813. #define FIELD_MMDDYYYY                    12
  814. #define FIELD_TOGGLE_UCHAR            13
  815. #define FIELD_TOGGLE_UCHAR_BIT     14
  816. #define FIELD_TOGGLE_USHORT_BIT    15
  817. #define FIELD_TOGGLE_ULONG_BIT    16
  818. #define FIELD_CHAR                            17
  819. #define FIELD_INT                                18
  820. #define FIELD_LONG                            19
  821. #define FIELD_CONTROL_STRING        20
  822.  
  823. /*******************************
  824.  * Entry Form Class Definition *
  825.  *******************************/
  826.  
  827. class form_c {
  828.                              private:
  829.                                 /*************
  830.                                  * Variables *
  831.                                  *************/
  832.                                  ushort                           fields_cur;         // Current highlighted field
  833.                                  ushort                           fields_max;        // Total number of fields
  834.                                  ushort                           chars_max;            // Total number of characters
  835.                                  form_field_t FAR *  fields;                // Array of fields;
  836.                                  form_char_t FAR *   chars;                    // Array of characters that will be responded to
  837.                                  uchar                             button_norm_fcolor;
  838.                                  uchar                             button_norm_bcolor;
  839.                                  uchar                             button_high_fcolor;
  840.                                  uchar                             button_high_bcolor;
  841.                                  uchar                              button_inactive_fcolor;
  842.                                  uchar                             button_inactive_bcolor;
  843.                                  uchar                             button_shadow_fcolor;
  844.                                  uchar                             button_shadow_bcolor;
  845.                                  uchar                             field_norm_fcolor;
  846.                                  uchar                             field_norm_bcolor;
  847.                                  uchar                             field_high_fcolor;
  848.                                  uchar                             field_high_bcolor;
  849.                                  uchar                             field_inactive_fcolor;
  850.                                  uchar                             field_inactive_bcolor;
  851.                                  uchar                             string_norm_fcolor;
  852.                                  uchar                             string_norm_bcolor;
  853.                                  uchar                             string_high_fcolor;
  854.                                  uchar                             string_high_bcolor;
  855.                                  uchar                             string_inactive_fcolor;
  856.                                  uchar                             string_inactive_bcolor;
  857.                                  uchar                             number_norm_fcolor;
  858.                                  uchar                             number_norm_bcolor;
  859.                                  uchar                             number_high_fcolor;
  860.                                  uchar                             number_high_bcolor;
  861.                                  uchar                             number_inactive_fcolor;
  862.                                  uchar                             number_inactive_bcolor;
  863.                                  uchar                              checkbox_norm_fcolor;
  864.                                  uchar                             checkbox_norm_bcolor;
  865.                                  uchar                             checkbox_high_fcolor;
  866.                                  uchar                             checkbox_high_bcolor;
  867.                                  uchar                             checkbox_inactive_fcolor;
  868.                                  uchar                             checkbox_inactive_bcolor;
  869.                                  uchar                             checkbox_box_bcolor;
  870.                                  uchar                              radiobutton_norm_fcolor;
  871.                                  uchar                             radiobutton_norm_bcolor;
  872.                                  uchar                             radiobutton_high_fcolor;
  873.                                  uchar                             radiobutton_high_bcolor;
  874.                                  uchar                             radiobutton_inactive_fcolor;
  875.                                  uchar                             radiobutton_inactive_bcolor;
  876.                                  uchar                             radiobutton_box_bcolor;
  877.                                  win_c FAR *                 win;
  878.                                  ushort                          result;
  879.                                 /*************
  880.                                  * Functions *
  881.                                  *************/
  882.                                  void   button_click                         (ushort field_num);
  883.                                  void   button_unclick                    (ushort field_num);
  884.                                  ushort check_user_def_char            (uchar ch, uchar ext);
  885.                                  void   draw_checkbox_entry            (ushort field_num, uchar entry_num, uchar highlight);
  886.                                  void   draw_radiobutton_entry    (ushort field_num, uchar entry_num, uchar highlight);
  887.                                  void   draw_field                            (ushort field_num, uchar button_down, uchar draw_data);
  888.                                  ushort field_clicked                        (void);
  889.                                  void     goto_checkbox_entry            (ushort field_num, uchar entry_num);
  890.                                  void     goto_radiobutton_entry    (ushort field_num, uchar entry_num);
  891.                                  void     goto_field                            (ushort field_num, uchar button_down);
  892.                                  uchar  load_4d_addr                        (void);
  893.                                  uchar  load_button                            (void);
  894.                                  uchar    load_byte                                (void);
  895.                                  uchar    load_char                                (void);
  896.                                  uchar     load_checkbox                      (void);
  897.                                  uchar  load_control_string            (void);
  898.                                  uchar  load_format_string            (void);
  899.                                  uchar  load_hhmmss                            (void);
  900.                                  uchar    load_int                                (void);
  901.                                  uchar    load_long                                (void);
  902.                                  uchar  load_mmddyyyy                        (void);
  903.                                  uchar  load_radiobutton                (void);
  904.                                  uchar     load_string                            (void);
  905.                                  uchar    load_toggle_uchar                (void);
  906.                                  uchar    load_toggle_uchar_bit        (void);
  907.                                  uchar    load_toggle_ushort_bit    (void);
  908.                                  uchar    load_toggle_ulong_bit        (void);
  909.                                  uchar    load_ulong                            (void);
  910.                                  uchar  load_upcase_string            (void);
  911.                                  uchar    load_ushort                          (void);
  912.                                  void     next_checkbox_entry            (ushort field_num, uchar direction);
  913.                                  void     next_radiobutton_entry    (ushort field_num, uchar direction);
  914.                                  void   next_field                            (uchar direction);
  915.                              public:
  916.                                 /*************
  917.                                  * Functions *
  918.                                  *************/
  919.                                  void   add_4d_addr                                (ushort new_id, uchar new_title_x, uchar new_title_y,
  920.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  921.                                                                                                      uchar new_view_len);
  922.                                  void   add_button                                 (ushort new_id, uchar new_x, uchar new_y, uchar *new_title);
  923.                                  void   add_byte                                    (ushort new_id, uchar new_title_x, uchar new_title_y,
  924.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  925.                                                                                                      uchar new_min_num, uchar new_max_num);
  926.                                  void     add_char                                    (ushort new_id, uchar new_title_x, uchar new_title_y,
  927.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  928.                                                                                                      char new_min_num, char new_max_num);
  929.                                  void   add_checkbox                            (ushort new_id, uchar new_title_x, uchar new_title_y,
  930.                                                                                                      uchar *new_title, uchar new_boxtopx, uchar new_boxtopy,
  931.                                                                                                      uchar new_boxbotx, uchar new_boxboty);
  932.                                  void   add_checkbox_entry              (ushort checkbox_id, uchar new_id, uchar new_x,
  933.                                                                                                      uchar new_y, uchar *new_title, uchar new_checked);
  934.                                  void   add_control_string                (ushort new_id, uchar new_title_x, uchar new_title_y,
  935.                                                                                                      uchar *new_title, uchar *new_ctrl_str, uchar new_entry_x, uchar new_entry_y,
  936.                                                                                                      uchar new_view_len, uchar new_max_len);
  937.                                  void   add_format_string                    (ushort new_id, uchar new_title_x, uchar new_title_y,
  938.                                                                                                      uchar *new_title, uchar *new_ctrl_str, uchar new_entry_x, uchar new_entry_y);
  939.                                  void   add_hhmmss                                (ushort new_id, uchar new_title_x, uchar new_title_y,
  940.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y);
  941.                                  void     add_int                                        (ushort new_id, uchar new_title_x, uchar new_title_y,
  942.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  943.                                                                                                      int new_min_num, int new_max_num);
  944.                                  void     add_long                                    (ushort new_id, uchar new_title_x, uchar new_title_y,
  945.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  946.                                                                                                      long new_min_num, long new_max_num);
  947.                                  void   add_mmddyyyy                            (ushort new_id, uchar new_title_x, uchar new_title_y,
  948.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y);
  949.                                  void   add_radiobutton                        (ushort new_id, uchar new_title_x, uchar new_title_y,
  950.                                                                                                      uchar *new_title, uchar new_boxtopx, uchar new_boxtopy,
  951.                                                                                                      uchar new_boxbotx, uchar new_boxboty);
  952.                                  void   add_radiobutton_entry            (ushort radiobutton_id, uchar new_id, uchar new_x,
  953.                                                                                                      uchar new_y, uchar *new_title, uchar new_cur);
  954.                                  void     add_string                                (ushort new_id, uchar new_title_x, uchar new_title_y,
  955.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  956.                                                                                                      uchar new_view_len, uchar new_max_len);
  957.                                  void   add_toggle_uchar                    (ushort new_id, uchar new_title_x, uchar new_title_y,
  958.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y);
  959.                                  void     add_toggle_uchar_bit            (ushort new_id, uchar new_title_x, uchar new_title_y,
  960.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  961.                                                                                                      uchar new_bit);
  962.                                  void     add_toggle_ulong_bit            (ushort new_id, uchar new_title_x, uchar new_title_y,
  963.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  964.                                                                                                      ulong new_bit);
  965.                                  void     add_toggle_ushort_bit            (ushort new_id, uchar new_title_x, uchar new_title_y,
  966.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  967.                                                                                                      ushort new_bit);
  968.                                  void     add_ulong                                    (ushort new_id, uchar new_title_x, uchar new_title_y,
  969.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  970.                                                                                                      ulong new_min_num, ulong new_max_num);
  971.                                  void   add_upcase_string                    (ushort new_id, uchar new_title_x, uchar new_title_y,
  972.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  973.                                                                                                      uchar new_view_len, uchar new_max_len);
  974.                                  void   add_user_def_char                    (ushort new_id, uchar new_ch, uchar new_ext);
  975.                                  void     add_ushort                                (ushort new_id, uchar new_title_x, uchar new_title_y,
  976.                                                                                                      uchar *new_title, uchar new_entry_x, uchar new_entry_y,
  977.                                                                                                      ushort new_min_num, ushort new_max_num);
  978.                                  void   button_colors                         (uchar new_button_norm_fcolor, uchar new_button_norm_bcolor,
  979.                                                                                                      uchar new_button_high_fcolor, uchar new_button_high_bcolor,
  980.                                                                                                      uchar new_button_inactive_fcolor, uchar new_button_inactive_bcolor,
  981.                                                                                                      uchar new_button_shadow_fcolor, uchar new_button_shadow_bcolor);
  982.                                  void   checkbox_colors                        (uchar new_checkbox_norm_fcolor, uchar new_checkbox_norm_bcolor,
  983.                                                                                                      uchar new_checkbox_high_fcolor, uchar new_checkbox_high_bcolor,
  984.                                                                                                      uchar new_checkbox_inactive_fcolor, uchar new_checkbox_inactive_bcolor,
  985.                                                                                                      uchar new_checkbox_box_bcolor);
  986.                                  uchar  checkbox_entry_status            (ushort field_id, uchar entry_id);
  987.                                  void   create                                         (win_c FAR *new_win);
  988.                                  void   destroy                                         (void);
  989.                                  void   display                                         (void);
  990.                                  void   field_colors                            (uchar new_field_norm_fcolor, uchar new_field_norm_bcolor,
  991.                                                                                                      uchar new_field_high_fcolor, uchar new_field_high_bcolor,
  992.                                                                                                      uchar new_field_inactive_fcolor, uchar new_field_inactive_bcolor);
  993.                                  ushort get_cur_field                            (void);
  994.                                  ushort load                                            (void);
  995.                                  void   number_colors                            (uchar new_number_norm_fcolor, uchar new_number_norm_bcolor,
  996.                                                                                                      uchar new_number_high_fcolor, uchar new_number_high_bcolor,
  997.                                                                                                      uchar new_number_inactive_fcolor, uchar new_number_inactive_bcolor);
  998.                                  void     radiobutton_colors                (uchar new_radiobutton_norm_fcolor, uchar new_radiobutton_norm_bcolor,
  999.                                                                                                      uchar new_radiobutton_high_fcolor, uchar new_radiobutton_high_bcolor,
  1000.                                                                                                      uchar new_radiobutton_inactive_fcolor, uchar new_radiobutton_inactive_bcolor,
  1001.                                                                                                      uchar new_radiobutton_box_bcolor);
  1002.                                  uchar  radiobutton_status                (ushort field_id);
  1003.                                  void      set_4d_addr_var                         (ushort new_id, faddr_t *new_addr, uchar edit);
  1004.                                  void     set_char_var                            (ushort new_id, char *new_num, uchar edit);
  1005.                                  void   set_control_string_var        (ushort new_id, uchar *new_str, uchar edit);
  1006.                                  void   set_byte_var                            (ushort new_id, uchar *new_num, uchar edit);
  1007.                                  void   set_format_string_var            (ushort new_id, uchar *new_str, uchar edit);
  1008.                                  void     set_hhmmss_var                        (ushort new_id, ulong *new_t, uchar edit);
  1009.                                  void     set_int_var                                (ushort new_id, int *new_num, uchar edit);
  1010.                                  void     set_long_var                            (ushort new_id, long *new_num, uchar edit);
  1011.                                  void     set_mmddyyyy_var                    (ushort new_id, ulong *new_d, uchar edit);
  1012.                                  void     set_string_var                        (ushort new_id, uchar *new_str, uchar edit);
  1013.                                  void     set_toggle_uchar_var            (ushort new_id, uchar *new_t, uchar edit);
  1014.                                  void     set_toggle_uchar_bit_var    (ushort new_id, uchar *new_t, uchar edit);
  1015.                                  void     set_toggle_ulong_bit_var    (ushort new_id, ulong *new_t, uchar edit);
  1016.                                  void     set_toggle_ushort_bit_var    (ushort new_id, ushort *new_t, uchar edit);
  1017.                                  void   set_ulong_var                            (ushort new_id, ulong *new_num, uchar edit);
  1018.                                  void   set_upcase_string_var            (ushort new_id, uchar *new_str, uchar edit);
  1019.                                  void   set_ushort_var                        (ushort new_id, ushort *new_num, uchar edit);
  1020.                                  void   string_colors                            (uchar new_string_norm_fcolor, uchar new_string_norm_bcolor,
  1021.                                                                                                      uchar new_string_high_fcolor, uchar new_string_high_bcolor,
  1022.                                                                                                      uchar new_string_inactive_fcolor, uchar new_string_inactive_bcolor);
  1023.                              };
  1024.  
  1025.  
  1026.  
  1027. /*****************
  1028.  * Mouse Defines *
  1029.  *****************/
  1030.  
  1031. #define BUTTON_CLICKED 1
  1032. #define BUTTON_DOWN      2
  1033.  
  1034. /**************************
  1035.  * Mouse Global Variables *
  1036.  **************************/
  1037.  
  1038. extern uchar mouse_exist;            // True if mouse exists and is initialized
  1039. extern uchar mouse_left;            // True if left button pressed
  1040. extern uchar mouse_center;        // True if center button pressed
  1041. extern uchar mouse_right;            // True if right button pressed
  1042. extern uchar mouse_row;                // Current row of mouse pointer
  1043. extern uchar mouse_col;              // Current columnb of mouse pointer
  1044.  
  1045. /*******************
  1046.  * Mouse Functions *
  1047.  *******************/
  1048.  
  1049. void mouse_init(void);
  1050. void mouse_on(void);
  1051. void mouse_off(void);
  1052. uchar mouse_read_event(void);
  1053. void mouse_deinit(void);
  1054.  
  1055. /************************
  1056.  * Time Slice Functions *
  1057.  ************************/
  1058. void init_timeslice(void);
  1059. void timeslice(void);
  1060.  
  1061. #endif /* Add nothing after this line */
  1062.