1/* $Id: checkbutton.hg,v 1.2 2004/01/19 19:48:44 murrayc Exp $ */
2
3/* checkbutton.h
4 *
5 * Copyright (C) 1998-2002 The gtkmm Development Team
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#include <gtkmm/togglebutton.h>
23_DEFS(gtkmm,gtk)
24_PINCLUDE(gtkmm/private/togglebutton_p.h)
25
26namespace Gtk
27{
28
29/** Create widgets with a discrete toggle button.
30 *
31 * A Gtk::CheckButton places a discrete Gtk::ToggleButton next to a widget,
32 * (usually a Gtk::Label).  See Gtk::ToggleButton widgets for more
33 * information about toggle/check buttons.  The important signal,
34 * signal_toggled() is also inherited from Gtk::ToggleButton.
35 *
36 * The CheckButton widget looks like this:
37 * @image html checkbutton1.png
38 *
39 * @ingroup Widgets
40 */
41class CheckButton : public ToggleButton
42{
43  _CLASS_GTKOBJECT(CheckButton,GtkCheckButton,GTK_CHECK_BUTTON,Gtk::ToggleButton,GtkToggleButton)
44public:
45
46  /** Create an empty check button.
47   * With an empty button, you can Gtk::Button::add() a widget such as a
48   * Gtk::Pixmap or Gtk::Box.
49   *
50   * If you just wish to add a Gtk::Label, you may want to use the
51   * Gtk::CheckButton(const Glib::ustring &label) constructor directly
52   * instead.
53   */
54  _CTOR_DEFAULT
55
56  /** Create a check button with a label.
57   * You won't be able to add a widget to this button since it already
58   * contains a Gtk::Label
59   */
60  explicit CheckButton(const Glib::ustring& label, bool mnemonic = false);
61
62
63protected:
64  /** Emited on button redraw to update indicator.
65   * Triggered when the button is redrawn (e.g.after being toggled)
66   * Overload this signal if you want to implement your own check button
67   * look. Otherwise, you most likely don't care about it.
68   * The GdkRectangle specifies the area of the widget which will get
69   * redrawn.
70   */
71  _WRAP_VFUNC(void draw_indicator(GdkRectangle* area), "draw_indicator")
72
73};
74
75
76} /* namespace Gtk */
77
78