home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c161 / 1.ddi / TCPP / H / W4.H < prev   
Encoding:
C/C++ Source or Header  |  1992-04-13  |  9.3 KB  |  255 lines

  1. /*  w4.h   (c)Copyright Sequiter Software Inc., 1987-1990.  All rights reserved.  */
  2.  
  3.    #define  F_BLUE      1L
  4.    #define  F_GREEN     2L
  5.    #define  F_RED       4L
  6.    #define  F_CYAN      3L
  7.    #define  F_MAGENTA   5L
  8.    #define  F_YELLOW    6L
  9.    #define  F_WHITE     7L
  10.    #define  F_INTENSE   8L
  11.    #define  B_BLUE   0x10L
  12.    #define  B_GREEN  0x20L
  13.    #define  B_RED    0x40L
  14.    #define  B_CYAN     0x30L
  15.    #define  B_MAGENTA  0x50L
  16.    #define  B_YELLOW   0x60L
  17.    #define  B_WHITE  0x70L
  18.    #define  B_BLINK  0x80L
  19.    #define  SINGLE     "⌐ñ⌐ñ⌐ª⌐ª⌐░⌐┤⌐╕⌐╝"
  20.    #define  DOUBLE     "⌐Ñ⌐Ñ⌐º⌐º⌐│⌐╖⌐╗⌐┐"
  21.    #define  DOUBLE_TOP "⌐Ñ⌐Ñ⌐ª⌐ª⌐▒⌐╡⌐╣⌐╜"
  22.    #define  DOUBLE_SID "⌐ñ⌐ñ⌐º⌐º⌐▓⌐╢⌐║⌐╛"
  23.    #define  PANEL      "⌐¡⌐¡⌐»⌐»⌐│⌐╖⌐╗⌐┐"
  24.  
  25. #define  MAX_GET_WIDTH    258
  26. #define  DEFAULT_DATE    "CCYY/MM/DD"
  27.  
  28. extern  int  v4default_window ;
  29. extern  char v4default_date[] ;
  30.  
  31. typedef int  ACTION(int) ;
  32.  
  33. typedef struct cb_window_st
  34. {
  35.    int   next, prev ;
  36.  
  37.    /* Window Information */
  38.    int   hand ;                  /* A negative handle means use 'screen_ptr' */
  39.    int   start_row ;             /* The windows Origin Row */
  40.    int   start_col ;             /* The windows Origin Column */
  41.    int   row ;                   /* The current Row */
  42.    int   col ;                   /* The current Column */
  43.    int   width ;                 /* Number of characters in screen width */
  44.    int   display_bytes ;         /* Number of bytes on the screen */
  45.    int   height ;                /* The number of rows per page */
  46.    int   active ;                /* True if the window has been displayed */
  47.    char *border_chars ;          /* Border Characters; (char *) 0 if none */
  48.    long  border_attribute ;      /* Border Attribute Character */
  49.    long  attribute ;             /* The Current Attribute */
  50.  
  51.    /* Some Extra Curses Definitions */
  52.    char *data ;                  /* A memory copy of the screen data */
  53.    char *old_screen ;            /* The old Screen Information for Popups */
  54.  
  55.    int   title_row ;
  56.    int   title_col ;
  57.    char *title ;
  58.    long  title_attribute ;
  59.  
  60.    /* Get Information */
  61.    int   first_get ;             /* A Reference to the First Get */
  62.    int   last_get ;              /* A Reference to the Last Get */
  63.    int   release ;               /* True if Gets are Released after Use */
  64.    char  get_delimiter[2] ;
  65.    long  get_attribute ;
  66.  
  67.    /* Menu Information */
  68.    int   first_menu ;            /* Reference to the first menu item reference */
  69.    int   last_menu ;             /* Reference to the last menu item reference */
  70.    int   start_item ;            /* The starting menu item reference */
  71.    int   horizontal ;            /* True if Horizontal Menu */
  72.    int   item_width ;            /* Column Distance between Menu Items */
  73.    int   key_read ;              /* 1 - Single Char; 2 - String Compare */
  74.    int   ignore_case ;           /* 1 - Ignore case of key */
  75.    long  menu_attribute ;        /* Default normal menu item attribute */
  76.    long  menu_att_active ;       /* Selected menu item attribute */
  77.    int   force_refresh ;         /* Refresh the menu window */
  78.    int   arrow_exit ;            /* TRUE if opposite arrow keys cause
  79.                     'n4activate' to exit */
  80.    int   up_key ;                /* A key to move the menu system up one */
  81.    int   exit_key ;              /* A key to exit the menu system */
  82.    int   return_start ;          /* A range of keys which exit the menu system */
  83.    int   return_end ;
  84. }  CB_WINDOW ;
  85.  
  86.  
  87. typedef struct menu_st
  88. {
  89.    int    next, prev ;
  90.  
  91.    int    row ;           /* Specific row of menu item */
  92.    int    col ;           /* Specific column of menu item */
  93.  
  94.    int    window_ref ;    /* Corresponding window reference number */
  95.  
  96.    char  *item_ptr ;      /* Menu Item text */
  97.    int    skip_over ;     /* True if the this Menu Item may not be chosen */
  98.  
  99.    int    key_value ;     /* A key to move to and/or activate the menu item */
  100.    int    key_activate ;  /* Non-zero if the key press activates the menu item */
  101.    int    key_highlight_pos ;  /* -1 if there is no highlighting of special key */
  102.  
  103.    char  *message ;       /* Displayed with routine 'n4message_do' */
  104.    long   attribute ;     /* Attribute for the menu item (When Not Selected) */
  105.  
  106.    ACTION *action ;
  107.    ACTION *reaction ;
  108.    int    parm_data ;     /* Parameter for the action/reaction routine. */
  109.    void  *ptr_data ;      /* Pointer data. */
  110.    int    int_data ;      /* Extra integer data. */
  111. }  MENU ;
  112.  
  113.  
  114. typedef struct get_st
  115. {
  116.    int   next, prev ;
  117.  
  118.    int   row ;              /* Row of the entry area */
  119.    int   col ;              /* Column of the entry area */
  120.    int   width_scr ;        /* Width of the Screen */
  121.  
  122.    int   window_ref ;       /* The Window Reference Number */
  123.  
  124.    char *picture ;          /* A picture entry template */
  125.    int   num_decimals ;     /* The number of decimals for numeric entries */
  126.    int   upper_convert ;    /* TRUE if complete Upper Case Conversion */
  127.  
  128.    int (*valid)(struct get_st *) ;
  129.    int (*call)(struct get_st *, char *, int) ;
  130.  
  131.    int   call_data ;        /* Some data to be passed to the call routine */
  132.    char  type ;             /* C (Character), D (Date), L (Logical),
  133.                                N (Numeric),   d (double), l (long), i (int) */
  134.    void *data ;             /* Pointer to the Data Buffer */
  135.    int   width_data ;       /* The number of bytes pointed to by 'data' */
  136.    long  attribute ;        /* The attribute to be used for the 'GET' */
  137.    char  delimiter[2] ;     /* Up to two delimeter characters */
  138.    char *message ;          /* A message displayed by 'g4message_do' */
  139.  
  140. }  GET ;
  141.  
  142. typedef  int GET_ROUTINE( GET *, char *, int ) ;
  143.  
  144. GET     *g4alloc( int, int, void *, char ) ;
  145. void     g4( int, int, char * ) ;
  146. long     g4attribute( long ) ;
  147. void     g4bell( void) ;
  148. int      g4bell_set( int ) ;
  149. void     g4call( GET_ROUTINE *, int ) ;
  150. int      g4char( void) ;
  151. void     g4date( int, int, char * ) ;
  152. void     g4delimiter( char * ) ;
  153. void     g4double( int, int, double * ) ;
  154. void     g4display( void) ;
  155. void     g4field( int, int, long ) ;
  156. void     g4int( int, int, int * ) ;
  157. void     g4logical( int, int, int * ) ;
  158. void     g4long( int, int, long * ) ;
  159. int      g4menu( GET *, char *, int ) ;
  160. int      g4menu_help( GET *, char *, int ) ;
  161. void     g4message( char * ) ;
  162. void     g4message_do( char * ) ;
  163. void     g4numeric( int, int, char * ) ;
  164. void     g4picture( char * ) ;
  165. int      g4read( void) ;
  166. int      g4release( int ) ;
  167. void     g4upper( void) ;
  168. void     g4valid( int (*)(GET *)) ; /* g3valid has a routine as a parameter */
  169. void     g4width( int, int ) ;
  170.  
  171. int      n4( char * ) ;
  172. void     n4action( ACTION * ) ;
  173. int      n4activate( int ) ;
  174. void     n4arrow_exit( void ) ;
  175. void     n4attribute( long, long ) ;
  176. void     n4attribute_item( int, long ) ;
  177. void     n4calc( int, int, int ) ;
  178. int      n4char(void) ;
  179. void     n4char_routine( int (*)(void) ) ;
  180. int      n4sub_menu( int ) ;
  181. void     n4get_calc( int ) ;
  182. void     n4horizontal( void) ;
  183. int      n4int_get( int ) ;
  184. void     n4int_save( int ) ;
  185. int      n4item( int, int, char * ) ;
  186. char    *n4item_text( int ) ;
  187. void     n4item_width( int ) ;
  188. void     n4key( int, int, int ) ;
  189. void     n4key_set( int, int ) ;
  190. void     n4key_special( int, int, int, int ) ;
  191. void     n4lotus( int ) ;
  192. void     n4message( char *) ;
  193. void     n4message_do( char * ) ;
  194. void     n4parm( int ) ;
  195. void    *n4ptr_get( int ) ;
  196. void     n4ptr_save( void * ) ;
  197. void     n4pulldown( int ) ;
  198. void     n4reaction( ACTION * ) ;
  199. void     n4refresh( int ) ;
  200. int      n4search( char * ) ;
  201. int      n4skip_over( int, int ) ;
  202. void     n4start_item( int ) ;
  203.  
  204. void     w4( int, int, char * ) ;
  205. void     w4activate( int ) ;
  206. long     w4attribute( long ) ;
  207. void     w4border( char *, long ) ;
  208. void     w4box( char *, int, int, int, int) ;
  209. void     w4centre( int, char *) ;
  210. void     w4clear( int ) ;
  211. void     w4close( int ) ;
  212. int      w4col( void) ;
  213. void     w4cursor( int, int ) ;
  214. void     w4cursor_size( int, int ) ;
  215. void     w4deactivate( int ) ;
  216. int      w4define( int, int, int, int ) ;
  217. #ifdef MSC
  218. int  cdecl w4display( char *, ... ) ;
  219. #else
  220. int      w4display( char *, ... ) ;
  221. #endif
  222. void     w4double( int, int, double, int, int ) ;
  223. void     w4eject( void) ;
  224. void     w4enlarge(void) ;
  225. void     w4exit(int) ;
  226. void     w4field( int, int, long ) ;
  227. int      w4handle( int ) ;
  228. int      w4height( int ) ;
  229. int      w4init( int, int, int ) ;
  230. void     w4init_undo(void) ;
  231. void     w4int( int, int, int, int ) ;
  232. void     w4long( int,  int, long, int ) ;
  233. void     w4memory( void) ;
  234. void     w4num( int, int, char *, int ) ;
  235. void     w4num_att( int, int, char *, int, long ) ;
  236. void     w4out( char * ) ;
  237. void     w4popup(void) ;
  238. void     w4position( int, int ) ;
  239. void     w4position_set( int, int ) ;
  240. void     w4read( int, int, char *, int ) ;
  241. void     w4read_window( int, char * ) ;
  242. void     w4repeat( int, int, char, int ) ;
  243. int      w4row( void) ;
  244. void     w4scroll( int ) ;
  245. int      w4select( int ) ;
  246. void     w4shrink(void) ;
  247. void     w4title( int, int, char *, long ) ;
  248. int      w4width( int ) ;
  249. void     w4write( int, int, char *, int ) ;
  250. void     w4write_att( int, int, char *, int, long ) ;
  251. void     w4write_window( int, char * ) ;
  252. void     w4gotoxy( int, int ) ;
  253. int      w4even( int ) ;
  254.  
  255.