1/* $Id: cellrenderertoggle.hg,v 1.5 2006/05/10 20:59:27 murrayc Exp $ */ 2 3/* cellrenderertoggle.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/cellrenderer.h> 23_DEFS(gtkmm,gtk) 24_PINCLUDE(gtkmm/private/cellrenderer_p.h) 25 26 27namespace Gtk 28{ 29 30/** Renders a toggle button in a cell. 31 * The button is drawn as a radio- or checkbutton, depending on the radio property. When activated, it 32 * emits the toggled signal. 33 * 34 * @ingroup TreeView 35 */ 36class CellRendererToggle : public CellRenderer 37{ 38 _CLASS_GTKOBJECT(CellRendererToggle,GtkCellRendererToggle,GTK_CELL_RENDERER_TOGGLE,Gtk::CellRenderer,GtkCellRenderer) 39public: 40 41 _CTOR_DEFAULT 42 43 44 _WRAP_METHOD(bool get_radio() const, gtk_cell_renderer_toggle_get_radio) 45 _WRAP_METHOD(void set_radio(bool radio = true), gtk_cell_renderer_toggle_set_radio) 46 _WRAP_METHOD(bool get_active() const, gtk_cell_renderer_toggle_get_active) 47 _WRAP_METHOD(void set_active(bool setting = true), gtk_cell_renderer_toggle_set_active) 48 _WRAP_METHOD(bool get_activatable() const, gtk_cell_renderer_toggle_get_activatable) 49 _WRAP_METHOD(void set_activatable(bool setting = true), gtk_cell_renderer_toggle_set_activatable) 50 51 52#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING) 53 //TODO: Maybe the parameter should be a TreePath. 54 /** The toggled signal is emitted when the cell is toggled. 55 * 56 * @param path string representation of TreePath describing the event location 57 */ 58 _WRAP_SIGNAL(void toggled(const Glib::ustring& path), "toggled") 59 60 _WRAP_PROPERTY("activatable", bool) 61 _WRAP_PROPERTY("active", bool) 62 _WRAP_PROPERTY("inconsistent", bool) 63 _WRAP_PROPERTY("radio", bool) 64 _WRAP_PROPERTY("indicator-size", int) 65 66 virtual Glib::PropertyProxy_Base _property_renderable(); 67}; 68 69} /* namespace Gtk */ 70 71