Debian Codegraph @

gtk/src/buttonbox.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 #include <gtkmm/box.h>
18 _DEFS(gtkmm,gtk)
19 _PINCLUDE(gtkmm/private/box_p.h)
20
21
22 namespace Gtk
23 {
24
25 // This is a #define in GTK+, and unrelated to the GtkButtonBoxStyle enum.
26 /** @ingroup gtkmmEnums */
27 enum { BUTTONBOX_DEFAULT_SPACING = -1 };
28
29
30 /** A container for arranging buttons.
31 *
32 * A button box should be used to provide a consistent layout of buttons
33 * throughout your application. The layout/spacing can be altered by the
34 * programmer, or if desired, by the user to alter the 'feel' of a
35 * program to a small degree.
36 *
37 * get_layout() et_layout() retrieve and
38 * alter the method used to spread the buttons in a button box across the
39 * container, respectively.
40 *
41 * The main purpose of ButtonBox is to make sure the children have all the
42 * same size. ButtonBox gives all children the same size, but it does allow
43 * 'outliers' to keep their own larger size. To force all children to be
44 * strictly the same size without exceptions, you can set the
45 * homogeneous property to true.
46 *
47 * To excempt individual children from homogeneous sizing regardless of their
48 * 'outlier' status, you can set the non-homogeneous child
49 * property.
50 */
51 class GTKMM_API ButtonBox
52 : public Box
53 {
54 _CLASS_GTKOBJECT(ButtonBox,GtkButtonBox,GTK_BUTTON_BOX,Gtk::Box,GtkBox,,,GTKMM_API)
55 public:
56 //Note that we try to use the same defaul parameter value as the default property value.
57 _WRAP_CTOR(ButtonBox(Orientation orientation = ORIENTATION_HORIZONTAL), gtk_button_box_new)
58
59 _WRAP_METHOD(ButtonBoxStyle get_layout() const, gtk_button_box_get_layout)
60 _WRAP_METHOD(void set_layout(ButtonBoxStyle layout_style), gtk_button_box_set_layout)
61
62 _WRAP_METHOD(void set_child_secondary(Widget& child, bool is_secondary = true), gtk_button_box_set_child_secondary)
63 _WRAP_METHOD(bool get_child_secondary(const Gtk::Widget& child) const, gtk_button_box_get_child_secondary)
64
65 _WRAP_METHOD(bool get_child_non_homogeneous(const Gtk::Widget& child) const, gtk_button_box_get_child_non_homogeneous )
66
67 _WRAP_METHOD(void set_child_non_homogeneous(Gtk::Widget& child, bool non_homogeneous = true), gtk_button_box_set_child_non_homogeneous)
68
69 _WRAP_PROPERTY("layout-style", ButtonBoxStyle)
70 };
71
72 } // namespace Gtk
73
74 #ifndef GTKMM_DISABLE_DEPRECATED
75 //Include the deprecated header,
76 //whose classes were previously in this header,
77 //to preserve the "API" of the includes.
78 #include <gtkmm/hvbuttonbox.h>
79 #endif // GTKMM_DISABLE_DEPRECATED