~ubuntu-branches/ubuntu/precise/gtkmm3.0/precise

« back to all changes in this revision

Viewing changes to gtk/src/checkbutton.hg

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2011-06-17 00:12:44 UTC
  • Revision ID: james.westby@ubuntu.com-20110617001244-9hl5an15hiaaahi6
Tags: upstream-3.0.1
ImportĀ upstreamĀ versionĀ 3.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
26
namespace 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
 */
 
41
class CheckButton : public ToggleButton
 
42
{
 
43
  _CLASS_GTKOBJECT(CheckButton,GtkCheckButton,GTK_CHECK_BUTTON,Gtk::ToggleButton,GtkToggleButton)
 
44
public:
 
45
 
 
46
  /** Create an empty check button.
 
47
   * With an empty button, you can Gtk::Button::add() a widget such as a
 
48
   * Gtk::Image 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
 
 
63
protected:
 
64
 
 
65
#m4begin
 
66
dnl This extra conversion does the extra reference, often needed by code for vfuncs and signal.
 
67
_CONVERSION(`cairo_t*',`const Cairo::RefPtr<Cairo::Context>&',`Cairo::RefPtr<Cairo::Context>(new Cairo::Context($3, false /* has_reference */))')
 
68
#m4end
 
69
 
 
70
  /** Emited on button redraw to update indicator.
 
71
   * Triggered when the button is redrawn (e.g.after being toggled)
 
72
   * Overload this signal if you want to implement your own check button
 
73
   * look. Otherwise, you most likely don't care about it.
 
74
   * The GdkRectangle specifies the area of the widget which will get
 
75
   * redrawn.
 
76
   */
 
77
  _WRAP_VFUNC(void draw_indicator(const Cairo::RefPtr<Cairo::Context>& cr), "draw_indicator")
 
78
 
 
79
};
 
80
 
 
81
 
 
82
} /* namespace Gtk */