1 #ifndef _GTKMM_CELLRENDERER_GENERATION_H
2 #define _GTKMM_CELLRENDERER_GENERATION_H
5 /* cellrenderer_generation.h
7 * Copyright(C) 2003 The gtkmm Development Team
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or(at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the Free
21 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <gtkmm/cellrenderertext.h>
25 #include <gtkmm/cellrendererpixbuf.h>
26 #include <gtkmm/cellrenderertoggle.h>
27 #include <gtkmm/cellrendereraccel.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 namespace CellRenderer_Generation
36 template<class T_ModelColumnType> //e.g. bool or Glib::ustring.
37 CellRenderer* generate_cellrenderer(bool editable = false)
39 CellRendererText* pCellRenderer = new CellRendererText(); //the default - template specializations will use other renderers.
40 //CellRendererText can render both strings and numerical values.
42 #ifdef GLIBMM_PROPERTIES_ENABLED
43 pCellRenderer->property_editable() = editable;
45 pCellRenderer->set_property("editable", editable);
51 #if !defined(__GNUC__) || __GNUC__ > 2
52 // gcc 2.95.x fails in TreeView::append_column_editable if the
53 // following specializations are declared in the header.
55 CellRenderer* generate_cellrenderer<bool>(bool editable);
58 CellRenderer* generate_cellrenderer< Glib::RefPtr<Gdk::Pixbuf> >(bool editable);
61 CellRenderer* generate_cellrenderer<AccelKey>(bool editable);
65 } //CellRenderer_Generation
66 #endif //DOXYGEN_SHOULD_SKIP_THIS
71 #endif /* _GTKMM_CELLRENDERER_GENERATION_H */