menuitems.h

Go to the documentation of this file.
00001 
00007 /*
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Lesser General Public
00010     License as published by the Free Software Foundation; either
00011     version 2.1 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public
00019     License along with this library; if not, write to the Free Software
00020     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00021 */
00022 
00023 #ifndef OMGUI_MENUITEMS_H
00024 #define OMGUI_MENUITEMS_H
00025 
00026 #include <omgui/object.h>
00027 
00028 namespace omgui {
00029 
00050 class OMGUI_API MenuItem : public Object
00051 {
00052 public:
00053     typedef omgui::api::MenuItem api_type;
00054 
00058     static MenuItem *create(object_id obj_id, menu_id id, const string &label);
00059 
00064     static MenuItem *create(menu_id id, const string &label)
00065     {
00066         return create(OBJECT_ID_ANY, id, label);
00067     }
00068 
00069     void add_ref() { }
00070     void release() { }
00071 
00075     string get_label() const;
00076 
00080     void set_label(const string &label);
00081 
00086     void enable(bool value = true);
00087     
00091     void disable() { enable(false); }
00092 
00096     bool enabled() const;
00097 
00101     menu_id get_id() const;
00102 
00103 protected:
00107     MenuItem(object_id obj_id, menu_id id, const string &label);
00108     MenuItem(object_id id, api_type *impl);
00109     
00110 private:
00111     api_type *m_impl;
00112 
00113 public:
00114     api_type *get_impl() const;
00115 
00116     ~MenuItem();
00117 };
00118 
00125 class OMGUI_API Separator : public MenuItem
00126 {
00127 public:
00128     typedef omgui::api::Separator api_type;
00129 
00133     static Separator *create();
00134 
00135 protected:
00139     Separator();
00140 };
00141 
00142 } // omgui
00143 
00144 #endif

doxygen SourceForge.net Logo