Debian Codegraph @

gtk/src/popovermenu.hg

raw
1 /* Copyright (C) 2015 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 <http://www.gnu.org/licenses/>.
15 */
16
17 #include <gtkmm/popover.h>
18
19 _DEFS(gtkmm,gtk)
20 _PINCLUDE(gtkmm/private/popover_p.h)
21
22 namespace Gtk
23 {
24 /** A Popover to use as a menu.
25 *
26 * PopoverMenu is a subclass of Popover that treats its
27 * childen like menus and allows switching between them. It is
28 * meant to be used primarily together with ModelButton, but
29 * any widget can be used, such as SpinButton or Scale.
30 * In this respect, PopoverMenu is more flexible than popovers
31 * that are created from a Gio::MenuModel.
32 *
33 * To add a child as a submenu, set the child_property_submenu()
34 * to the name of the submenu. To let the user open
35 * this submenu, add a ModelButton whose ModelButton::property_menu_name()
36 * is set to the name you've given to the submenu.
37 *
38 * By convention, the first child of a submenu should be a ModelButton
39 * to switch back to the parent menu. Such a button should use
40 * ModelButton::property_inverted() and ModelButton::property_centered()
41 * to achieve a title-like appearance and place the submenu indicator
42 * at the opposite side. To switch back to the main menu, use "main"
43 * as the menu name.
44 *
45 * @newin{3,18}
46 *
47 * @ingroup Widgets
48 * @ingroup Containers
49 * @ingroup Menus
50 */
51 class GTKMM_API PopoverMenu : public Popover
52 {
53 _CLASS_GTKOBJECT(PopoverMenu, GtkPopoverMenu, GTK_POPOVER_MENU, Gtk::Popover, GtkPopover, , , GTKMM_API)
54
55 public:
56 _CTOR_DEFAULT
57
58 _WRAP_METHOD(void open_submenu(const Glib::ustring& name), gtk_popover_menu_open_submenu)
59
60 _WRAP_PROPERTY("visible-submenu", Glib::ustring)
61
62 _WRAP_CHILD_PROPERTY("submenu", Glib::ustring)
63 _WRAP_CHILD_PROPERTY("position", int)
64
65 // PopoverMenu has no signals nor vfuncs.
66 };
67
68 } //namespace Gtk