home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pctech / hlsrc / winmenu.h < prev   
C/C++ Source or Header  |  1988-09-09  |  2KB  |  62 lines

  1. /*+
  2.     Name:    winmenu.h
  3.     Date:    06-Jun-1988
  4.     Author:    Kent J. Quirk
  5.         (c) Copyright 1988 Ziff Communications Co.
  6.     Abstract:    Contains header information for those using either
  7.         HLWIN.C or HLMENU.C.
  8. -*/    
  9.  
  10. typedef struct Window {
  11.     char *scrnbuf;            /* old data below window */
  12.     short bufsize;            /* size of the window data */
  13.     struct rccoord oldcpos;     /* previous cursor position */
  14.     short r1, c1, r2, c2;        /* the corners */
  15.     char attr;            /* the base attribute */
  16.     char x;             /* filler */
  17.     struct rccoord cpos;        /* current cursor position */
  18. } WINDOW;
  19.  
  20. WINDOW *open_window(short r1, short c1, short r2, short c2, char attr);
  21. int close_window(WINDOW *w);
  22. void activate_window(WINDOW *w);
  23. void deactivate_window(WINDOW *w);
  24. void fill_screen(FILE *f);
  25. struct rccoord bios_getcur();
  26. struct rccoord bios_setcur(short r, short c);
  27.  
  28. char *select_1_file(char *afn);
  29.  
  30. #define UP 0x148
  31. #define LEFT 0x14B
  32. #define RIGHT 0x14D
  33. #define DOWN 0x150
  34. #define BACKTAB 0x10F
  35. #define TAB 0x09
  36. #define DOIT 0x0D
  37. #define ENTER 0x0D
  38. #define ESC 0x1B
  39. #define INS 0x152
  40. #define DEL 0x153
  41. #define HOME 0x147
  42. #define END 0x14F
  43. #define PGUP 0x149
  44. #define PGDN 0x151
  45. #define F10  0x144
  46. #define UNDO 0x7F               /* control-Backspace */
  47.  
  48. int xgetch(void );
  49. void draw_text(int row, int col, char *menu[], int nrows, int width);
  50. WINDOW *draw_menu(char *menu[], char *toptitle, char *bottitle, 
  51.         int nrows, int toprow, int leftcol, int maxlen);
  52. int scroll_menu(char *menu[], char *toptitle, char *bottitle, 
  53.         int toprow, int leftcol, int nrows, int allow_select);
  54. int do_menu(char *menu[], char *toptitle, char *bottitle, int sel);
  55. int edit_line(char *text, int len, int row, int col);
  56. int pop_error(char *s);
  57.  
  58. /* user-supplied functions (required) */
  59. void (*menu_init)();
  60. void (*menu_exit)();
  61. void (*menu_line)(char *text, int item);
  62.