Debian Codegraph @

gtk/src/cellrenderertoggle.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/cellrenderer.h>
18 _DEFS(gtkmm,gtk)
19 _PINCLUDE(gtkmm/private/cellrenderer_p.h)
20
21
22 namespace Gtk
23 {
24
25 /** Renders a toggle button in a cell.
26 * The button is drawn as a radio- or checkbutton, depending on the radio property. When activated, it
27 * emits the toggled signal.
28 *
29 * @ingroup TreeView
30 */
31 class GTKMM_API CellRendererToggle : public CellRenderer
32 {
33 _CLASS_GTKOBJECT(CellRendererToggle,GtkCellRendererToggle,GTK_CELL_RENDERER_TOGGLE,Gtk::CellRenderer,GtkCellRenderer,,,GTKMM_API)
34 public:
35
36 _CTOR_DEFAULT
37
38
39 _WRAP_METHOD(bool get_radio() const, gtk_cell_renderer_toggle_get_radio)
40 _WRAP_METHOD(void set_radio(bool radio = true), gtk_cell_renderer_toggle_set_radio)
41 _WRAP_METHOD(bool get_active() const, gtk_cell_renderer_toggle_get_active)
42 _WRAP_METHOD(void set_active(bool setting = true), gtk_cell_renderer_toggle_set_active)
43 _WRAP_METHOD(bool get_activatable() const, gtk_cell_renderer_toggle_get_activatable)
44 _WRAP_METHOD(void set_activatable(bool setting = true), gtk_cell_renderer_toggle_set_activatable)
45
46
47 #m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
48 //TODO: Maybe the parameter should be a TreePath.
49 _WRAP_SIGNAL(void toggled(const Glib::ustring& path), "toggled")
50
51 _WRAP_PROPERTY("activatable", bool)
52 _WRAP_PROPERTY("active", bool)
53 _WRAP_PROPERTY("inconsistent", bool)
54 _WRAP_PROPERTY("radio", bool)
55 _WRAP_PROPERTY("indicator-size", int,
56 deprecated "Use the min-width/min-height CSS properties of the check/radio node instead.")
57
58 Glib::PropertyProxy_Base _property_renderable() override;
59 };
60
61 } //namespace Gtk