home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / LVSWIN31.ZIP / LVSMENU.HPP < prev    next >
C/C++ Source or Header  |  1992-02-24  |  2KB  |  79 lines

  1. /*
  2.  *            LVS Windows
  3.  *      The Window Class System
  4.  *
  5.  *        Copyright 1991 (c), Lake View Software
  6.  *                            4321 Harborough Rd.
  7.  *                            Columbus, OH 43220
  8.  *        All rights reserved.
  9.  */
  10.  
  11. #ifndef LVSMENU_HPP
  12. #define LVSMENU_HPP
  13.  
  14. #include "LVSwin.HPP"
  15.  
  16. struct Menu_Selection_s
  17. {
  18.     char *str;      // selection string
  19.     int y,x;        // position
  20.     int ret_val;    // return value
  21.     int *check_ptr; // pointer to check variable  WinCheck
  22.     char key;       // User key
  23.     char *message;  //
  24.     class WinMenu *sub_menu;
  25.     Menu_Selection_s *Next, *Prev;
  26. };
  27.  
  28. enum Menu_Types {
  29.     MENU_VERT,
  30.     MENU_HORZ,
  31.     MENU_POPUP,
  32.     MENU_SUB,
  33.     MENU_LOTUS,
  34. };
  35.  
  36. class WinMenu:public WinObj
  37. {
  38.     protected:
  39.         Menu_Selection_s *First, *Last, *Current;
  40.         int my_type;
  41.         int selections;
  42.         int bar_attr;
  43.         int key_attr;
  44.         int m_line;
  45.         int m_attr;
  46.         int map[4];
  47.         int menu_active;
  48.         int exit_status;
  49.         int last_position;
  50.         WinMenu *active_sub;
  51.         WinObj *m_win;
  52.         void show_get (Menu_Selection_s *sel, int highlight);
  53.         void mouse_routine (int y, int x);
  54.         void hide_submenu (WinMenu *m);
  55.         int search_sub (WinMenu *start_menu, int look_for);
  56.     public:
  57.         WinMenu ();
  58.         ~WinMenu ();
  59.  
  60.         void set_type (int type);
  61.         int prompt (int y,int x,int ret_val,char *str,char *message=NULL,
  62.                 char hot_key=0);
  63.         int prompt (int y, int x, int ret_val, char *str, char hot_key);
  64.         int prompt(int y, int x, WinMenu *sub, char *str, char *message=NULL,
  65.                    char key=0);
  66.         int prompt (int y, int x, WinMenu *sub, char *str, char key);
  67.         void hide_chain ();                     // hide entire chain
  68.         int read (int start_sel = -1);          // get menu
  69.         void reset ();                          // reset the menu system
  70.         void close ();
  71.         int set_barattr (int attr);             // returns old value
  72.         int set_keyattr (int attr);             // sets hot key attr
  73.         int message_line (int new_line_no);     // returns old value
  74.         int message_attr (int new_attr);        // returns old value
  75. };
  76.  
  77.  
  78. #endif
  79.