home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 97 / CD-ROM 97 / CD-ROM 97.iso / jogos / spherical / Code / Library / menu.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-07-13  |  2.2 KB  |  67 lines

  1.  
  2. // Copyright (C) 2002 by Luigi Pino.  All Rights Reserved.
  3.  
  4. /***************************************************************************/
  5.  
  6. class Sub_Menu_Class {
  7.     public:
  8.         Sub_Menu_Class();                                                                    // Constructor
  9.         ~Sub_Menu_Class();                                                                // Deconstructor
  10.  
  11.         bool    Add_Choice(int option_index, char *new_info);
  12.         bool    Add_Option(char *new_info);
  13.         int        Choice_Size(int option_index);
  14.         bool    Get_Access_Option(int option_index);
  15.         char*    Get_Choice_Info(int option_index);
  16.         char*    Get_Option_Info(int option_index);
  17.         int        Get_Current_Choice(int option_index);
  18.         int        Get_Current_Option();
  19.         void    Next_Choice(int option_index);
  20.         void    Next_Option();
  21.         int        Option_Size();
  22.         void    Previous_Choice(int option_index);
  23.         void    Previous_Option();
  24.         void    Rename_Choice(int option_index, int choice_index, char *update);
  25.         void    Rename_Option(int option_index, char *update);
  26.         void    Set_Access_Choice(int option_index, int choice_index, bool value);
  27.         void    Set_Access_Option(int option_index, bool value);
  28.         void    Set_Current_Choice(int option_index, int value);
  29.         void    Set_Current_Option(int value);
  30.  
  31.     private:
  32.         typedef struct {
  33.             bool    access;                                                                        // Availability
  34.             char    info[30];                                                                    // Information
  35.         } Menu_Info_Struct;
  36.  
  37.         typedef struct {
  38.             Menu_Info_Struct    *data;                                                // Data
  39.             int                                current;                                            // Current position
  40.             int                                size;                                                    // Size of list
  41.         } Menu_Choice_Struct;
  42.  
  43.         Menu_Choice_Struct    *choices;                                            // Choices data
  44.         Menu_Info_Struct        *data;                                                // Option data
  45.         int                                    current;                                            // Current position
  46.         int                                    size;                                                    // Size of list
  47. };
  48.  
  49. /***************************************************************************/
  50.  
  51. class Main_Menu_Class {
  52.     public:
  53.         Main_Menu_Class();                                                                // Constructor
  54.         ~Main_Menu_Class();                                                                // Deconstructor
  55.  
  56.         bool                        Enter_Pressed();
  57.         bool                        Escape_Pressed();
  58.         Sub_Menu_Class    *Get_Current();
  59.         void                        Set_Current(Sub_Menu_Class *menu);
  60.         void                        Update();
  61.  
  62.     private:
  63.         Controller_Class    input;
  64.         Sub_Menu_Class        *current;
  65. };
  66.  
  67. /***************************************************************************/