2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_CHECKMENUITEM_H
4 #define _GTKMM_CHECKMENUITEM_H
13 * Copyright (C) 1998-2002 The gtkmm Development Team
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <gtkmm/menuitem.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkCheckMenuItem GtkCheckMenuItem;
35 typedef struct _GtkCheckMenuItemClass GtkCheckMenuItemClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 { class CheckMenuItem_Class; } // namespace Gtk
44 /** A menu item that maintains the state of a boolean value in addition to a Gtk::MenuItem's usual role in activating application code.
45 * A check box indicating the state of the boolean value is displayed at the left side of the Gtk::MenuItem.
46 * Activating the Gtk::MenuItem toggles the value.
51 class CheckMenuItem : public MenuItem
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55 typedef CheckMenuItem CppObjectType;
56 typedef CheckMenuItem_Class CppClassType;
57 typedef GtkCheckMenuItem BaseObjectType;
58 typedef GtkCheckMenuItemClass BaseClassType;
59 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
61 virtual ~CheckMenuItem();
63 #ifndef DOXYGEN_SHOULD_SKIP_THIS
66 friend class CheckMenuItem_Class;
67 static CppClassType checkmenuitem_class_;
70 CheckMenuItem(const CheckMenuItem&);
71 CheckMenuItem& operator=(const CheckMenuItem&);
74 explicit CheckMenuItem(const Glib::ConstructParams& construct_params);
75 explicit CheckMenuItem(GtkCheckMenuItem* castitem);
77 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
80 #ifndef DOXYGEN_SHOULD_SKIP_THIS
81 static GType get_type() G_GNUC_CONST;
82 static GType get_base_type() G_GNUC_CONST;
85 ///Provides access to the underlying C GtkObject.
86 GtkCheckMenuItem* gobj() { return reinterpret_cast<GtkCheckMenuItem*>(gobject_); }
88 ///Provides access to the underlying C GtkObject.
89 const GtkCheckMenuItem* gobj() const { return reinterpret_cast<GtkCheckMenuItem*>(gobject_); }
93 //C++ methods used to invoke GTK+ virtual functions:
94 #ifdef GLIBMM_VFUNCS_ENABLED
95 #endif //GLIBMM_VFUNCS_ENABLED
98 //GTK+ Virtual Functions (override these to change behaviour):
99 #ifdef GLIBMM_VFUNCS_ENABLED
100 #endif //GLIBMM_VFUNCS_ENABLED
102 //Default Signal Handlers::
103 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
104 virtual void on_toggled();
105 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
114 explicit CheckMenuItem(const Glib::ustring& label, bool mnemonic = false);
117 void set_active(bool state = true);
119 /** Return value: <tt>true</tt> if the menu item is checked.
120 * @return <tt>true</tt> if the menu item is checked.
122 bool get_active() const;
128 /** If the user has selected a range of elements (such as some text or
129 * spreadsheet cells) that are affected by a boolean setting, and the
130 * current values in that range are inconsistent, you may want to
131 * display the check in an "in between" state. This function turns on
132 * "in between" display. Normally you would turn off the inconsistent
133 * state again if the user explicitly selects a setting. This has to be
134 * done manually, set_inconsistent() only affects
135 * visual appearance, it doesn't affect the semantics of the widget.
136 * @param setting <tt>true</tt> to display an "inconsistent" third state check.
138 void set_inconsistent(bool setting = true);
140 /** Retrieves the value set by set_inconsistent().
141 * @return <tt>true</tt> if inconsistent.
143 bool get_inconsistent() const;
146 /** Sets whether @a check_menu_item is drawn like a Gtk::RadioMenuItem
149 * @param draw_as_radio Whether @a check_menu_item is drawn like a Gtk::RadioMenuItem.
151 void set_draw_as_radio(bool draw_as_radio = true);
153 /** Return value: Whether @a check_menu_item looks like a Gtk::RadioMenuItem
154 * @return Whether @a check_menu_item looks like a Gtk::RadioMenuItem
158 bool get_draw_as_radio() const;
160 /** Triggered when the item changes state
161 * (Note : changing the item's state with set_active() will also trigger
165 * <tt>void on_my_%toggled()</tt>
168 Glib::SignalProxy0< void > signal_toggled();
171 #ifdef GLIBMM_PROPERTIES_ENABLED
172 /** Whether the menu item is checked.
174 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
175 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
176 * the value of the property changes.
178 Glib::PropertyProxy<bool> property_active() ;
179 #endif //#GLIBMM_PROPERTIES_ENABLED
181 #ifdef GLIBMM_PROPERTIES_ENABLED
182 /** Whether the menu item is checked.
184 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
185 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
186 * the value of the property changes.
188 Glib::PropertyProxy_ReadOnly<bool> property_active() const;
189 #endif //#GLIBMM_PROPERTIES_ENABLED
191 #ifdef GLIBMM_PROPERTIES_ENABLED
192 /** Whether to display an inconsistent state.
194 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
195 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
196 * the value of the property changes.
198 Glib::PropertyProxy<bool> property_inconsistent() ;
199 #endif //#GLIBMM_PROPERTIES_ENABLED
201 #ifdef GLIBMM_PROPERTIES_ENABLED
202 /** Whether to display an inconsistent state.
204 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
205 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
206 * the value of the property changes.
208 Glib::PropertyProxy_ReadOnly<bool> property_inconsistent() const;
209 #endif //#GLIBMM_PROPERTIES_ENABLED
211 #ifdef GLIBMM_PROPERTIES_ENABLED
212 /** Whether the menu item looks like a radio menu item.
214 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
215 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
216 * the value of the property changes.
218 Glib::PropertyProxy<bool> property_draw_as_radio() ;
219 #endif //#GLIBMM_PROPERTIES_ENABLED
221 #ifdef GLIBMM_PROPERTIES_ENABLED
222 /** Whether the menu item looks like a radio menu item.
224 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
225 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
226 * the value of the property changes.
228 Glib::PropertyProxy_ReadOnly<bool> property_draw_as_radio() const;
229 #endif //#GLIBMM_PROPERTIES_ENABLED
233 /** Triggered when the item is redrawn (e.g.after being toggled)
234 * Overload this signal if you want to implement your own check item
235 * look. Otherwise, you most likely don't care about it.
236 * The GdkRectangle specifies the area of the widget which will get
239 #ifdef GLIBMM_VFUNCS_ENABLED
240 virtual void draw_indicator_vfunc(GdkRectangle* area);
241 #endif //GLIBMM_VFUNCS_ENABLED
246 } /* namespace Gtk */
251 /** A Glib::wrap() method for this object.
253 * @param object The C instance.
254 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
255 * @result A C++ instance that wraps this C instance.
257 * @relates Gtk::CheckMenuItem
259 Gtk::CheckMenuItem* wrap(GtkCheckMenuItem* object, bool take_copy = false);
263 #endif /* _GTKMM_CHECKMENUITEM_H */