Debian Codegraph @

gtk/src/checkbutton.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/togglebutton.h>
18 _DEFS(gtkmm,gtk)
19 _PINCLUDE(gtkmm/private/togglebutton_p.h)
20
21 namespace Gtk
22 {
23
24 /** Create widgets with a discrete toggle button.
25 *
26 * A Gtk::CheckButton places a discrete Gtk::ToggleButton next to a widget,
27 * (usually a Gtk::Label). See Gtk::ToggleButton widgets for more
28 * information about toggle/check buttons. The important signal,
29 * signal_toggled() is also inherited from Gtk::ToggleButton.
30 *
31 * The CheckButton widget looks like this:
32 * @image html checkbutton1.png
33 *
34 * @ingroup Widgets
35 */
36 class GTKMM_API CheckButton : public ToggleButton
37 {
38 _CLASS_GTKOBJECT(CheckButton,GtkCheckButton,GTK_CHECK_BUTTON,Gtk::ToggleButton,GtkToggleButton,,,GTKMM_API)
39 public:
40
41 /** Create an empty check button.
42 * With an empty button, you can Gtk::Button::add() a widget such as a
43 * Gtk::Image or Gtk::Box.
44 *
45 * If you just wish to add a Gtk::Label, you may want to use the
46 * Gtk::CheckButton(const Glib::ustring& label) constructor directly
47 * instead.
48 */
49 _CTOR_DEFAULT
50
51 /** Create a check button with a label.
52 * You won't be able to add a widget to this button since it already
53 * contains a Gtk::Label
54 */
55 explicit CheckButton(const Glib::ustring& label, bool mnemonic = false);
56
57
58 protected:
59
60 #m4begin
61 dnl This extra conversion does the extra reference, often needed by code for vfuncs and signal.
62 _CONVERSION(`cairo_t*',`const ::Cairo::RefPtr< ::Cairo::Context>&',`::Cairo::RefPtr< ::Cairo::Context>(new ::Cairo::Context($3, false /* has_reference */))')
63 #m4end
64
65 /** Emited on button redraw to update indicator.
66 * Triggered when the button is redrawn (e.g.after being toggled)
67 * Overload this signal if you want to implement your own check button
68 * look. Otherwise, you most likely don't care about it.
69 * The GdkRectangle specifies the area of the widget which will get
70 * redrawn.
71 */
72 _WRAP_VFUNC(void draw_indicator(const ::Cairo::RefPtr< ::Cairo::Context>& cr), "draw_indicator")
73
74 };
75
76 } //namespace Gtk