Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

menudata.h

Go to the documentation of this file.
00001 /*
00002         ClanGUI, copyrights by various people. Have a look in the CREDITS file.
00003         
00004         This sourcecode is distributed using the Library GNU Public Licence,
00005         version 2 or (at your option) any later version. Please read LICENSE
00006         for details.
00007 */
00008 
00010 
00011 #ifndef header_menudata
00012 #define header_menudata
00013 
00014 #include <string>
00015 
00016 class CL_MenuItem;
00017 
00018 class CL_MenuData
00019 {
00020 public:
00021         CL_MenuData();
00022         virtual ~CL_MenuData();
00023 
00024         int insert_item(const std::string &text, int id = -1, int index = -1);
00025         int insert_separator(int id = -1, int index = -1);
00026 
00027         unsigned int count() const;
00028         //: Return number of items
00029 
00030         void remove_item(int id);
00031         //: Remove item
00032 
00033         void remove_item_at(int index);
00034         //: Remove item as position index
00035 
00036         void clear();
00037         //: Remove all items
00038 
00039         const std::string &get_text(int id) const;
00040         //: Return item text
00041 
00042         void change_item(const std::string &text, int id);
00043         //: Change item text
00044 
00045         bool is_item_enabled(int id) const;
00046         void enable_item(int id, bool enable);
00047         bool is_item_checked(int id) const;
00048         void check_item(int id, bool check);
00049 
00050         int get_index(int id) const;
00051         //: Returns item position
00052 
00053         int get_id(int index) const;
00054         //: Returns item id
00055 
00056         void set_id(int index, int id);
00057         //: Sets item id
00058 
00059 private:
00060         int generate_id(int id);
00061         // Returns a new available ID
00062         // Doesn't generate a new id if (id == -1)
00063 };  
00064 
00065 #endif

Generated at Wed Apr 4 19:54:01 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001