3
* Copyright (C) 2001-2004 Murray Cumming
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2 of the
8
* License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* General Public License for more details.
15
* You should have received a copy of the GNU General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
21
#ifndef ADDDEL_CELLRENDERERLIST_H
22
#define ADDDEL_CELLRENDERERLIST_H
24
#include <gtkmm/cellrenderercombo.h>
25
#include <gtkmm/liststore.h>
31
void c_callback_CellRendererList_on_editing_started(GtkCellRenderer* /* self */, GtkCellEditable* cell_editable, const gchar* /* path */, void* data);
33
class CellRendererList : public Gtk::CellRendererCombo
37
virtual ~CellRendererList();
39
void remove_all_list_items();
40
void append_list_item(const Glib::ustring& text, const Glib::ustring& extra = Glib::ustring());
42
///Whether the second column will be shown.
43
void set_use_second(bool use_second = true);
45
void set_restrict_values_to_list(bool val = true);
47
void on_editing_started(Gtk::CellEditable* cell_editable, const Glib::ustring& path);
49
friend void c_callback_CellRendererList_on_editing_started(GtkCellRenderer* /* self */, GtkCellEditable* cell_editable, const gchar* /* path */, void* data);
53
//Tree model columns for the Combo CellRenderer in the TreeView column:
54
class ModelColumns : public Gtk::TreeModel::ColumnRecord
59
{ add(m_col_choice); add(m_col_extra); }
61
Gtk::TreeModelColumn<Glib::ustring> m_col_choice;
62
Gtk::TreeModelColumn<Glib::ustring> m_col_extra;
65
ModelColumns m_model_columns;
67
Glib::RefPtr<Gtk::ListStore> m_refModel;
73
#endif //ADDDEL_CELLRENDERERLIST_H