Debian Codegraph @

gtk/src/imagemenuitem.hg

raw
1 /* Copyright (C) 1998-2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 // To exclude this file from the documentation when build-deprecated-api=false.
18 _CONFIGINCLUDE(gtkmmconfig.h)
19
20 #include <gtkmm/menuitem.h>
21 #include <gtkmm/stockid.h>
22 #include <gtkmm/accelgroup.h>
23 _DEFS(gtkmm,gtk)
24 _PINCLUDE(gtkmm/private/menuitem_p.h)
25
26 #m4 _PUSH(SECTION_CC_PRE_INCLUDES)
27 #undef GTK_DISABLE_DEPRECATED
28 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
29 #m4 _POP()
30
31 _IS_DEPRECATED // This whole file is deprecated.
32
33 namespace Gtk
34 {
35
36 /** A menu item with an icon.
37 *
38 * A GtkImageMenuItem is a menu item which has an icon next to the text label. Note that the
39 * user can disable display of menu icons, so make sure to still fill in the text label.
40 *
41 * @deprecated Use Gtk::MenuItem instead.
42 *
43 * @ingroup Menus
44 * @ingroup Widgets S
45 */
46 class GTKMM_API ImageMenuItem : public MenuItem
47 {
48 _CLASS_GTKOBJECT(ImageMenuItem,GtkImageMenuItem,GTK_IMAGE_MENU_ITEM,Gtk::MenuItem,GtkMenuItem,,,GTKMM_API)
49 public:
50
51 _CTOR_DEFAULT
52 explicit ImageMenuItem(Widget& image,
53 const Glib::ustring& label, bool mnemonic = false);
54 explicit ImageMenuItem(const Glib::ustring& label, bool mnemonic = false);
55 explicit ImageMenuItem(const StockID& id);
56
57 _WRAP_METHOD(void set_always_show_image(bool always_show = true), gtk_image_menu_item_set_always_show_image)
58 _WRAP_METHOD(bool get_always_show_image() const, gtk_image_menu_item_get_always_show_image)
59
60 _WRAP_METHOD(void set_image(Widget& image), gtk_image_menu_item_set_image)
61 _WRAP_METHOD(Widget* get_image(), gtk_image_menu_item_get_image)
62 _WRAP_METHOD(const Widget* get_image() const, gtk_image_menu_item_get_image, constversion)
63
64 _WRAP_METHOD(void set_use_stock(bool use_stock = true), gtk_image_menu_item_set_use_stock)
65 _WRAP_METHOD(bool get_use_stock() const, gtk_image_menu_item_get_use_stock)
66 _WRAP_METHOD(void set_accel_group(const Glib::RefPtr<AccelGroup>& accel_group), gtk_image_menu_item_set_accel_group)
67
68 _WRAP_PROPERTY("image", Widget*)
69 _WRAP_PROPERTY("use-stock", bool)
70 _WRAP_PROPERTY("accel-group", Glib::RefPtr<AccelGroup>)
71 _WRAP_PROPERTY("always-show-image", bool)
72
73 };
74
75 } //namespace Gtk