home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / gamesystem / includes / gs_menu.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-09  |  1.5 KB  |  73 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    gsCMenu
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    12/03/00
  8. //
  9. // Base:    gsCObject
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_GS_MENU_H
  16. #define _INCLUDE_GS_MENU_H
  17.  
  18. #include "gs_object.h"
  19. #include "gs_list.h"
  20. #include "gs_point.h"
  21. #include "gs_font.h"
  22. #include "gs_menuitem.h"
  23.  
  24. //-------------------------------------------------------------
  25.  
  26. class gsCMenu : public gsCObject
  27. {
  28.     private:
  29.         gsCList<gsCMenuItem *> m_item_list;
  30.  
  31.         gsCPoint m_position;
  32.         gsCPoint m_spacing;
  33.  
  34.         gsCFont *m_font;
  35.  
  36.         int m_current_item;        // -1 = no item selected
  37.  
  38.         bool m_wrap;
  39.  
  40.         void destroy();
  41.  
  42.     public:
  43.         gsCMenu();
  44.         ~gsCMenu();
  45.  
  46.         void clear();
  47.  
  48.         void setFont(gsCFont *font);
  49.         void setPosition(const gsCPoint& position);
  50.         void setSpacing(const gsCPoint& spacing);
  51.         void setWrap(bool state);
  52.  
  53.         void addSelection(const char *name);
  54.         void __cdecl addOptionList(const char *name,const char *option,...);
  55.         void addSlider(const char *name,int size,int min,int max);
  56.         void addSeperator(const char *name = 0);
  57.         int getNumItems();
  58.  
  59.         void setCurrentItem(int item);
  60.         int getCurrentItem();
  61.         void scroll(int direction);
  62.  
  63.         bool setValue(int item,int value);
  64.         int getValue(int item);
  65.         const char *getName(int item);
  66.  
  67.         bool draw();
  68. };
  69.  
  70. //-------------------------------------------------------------
  71.  
  72. #endif
  73.