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
#include "comboentry_currency.h"
22
#include <gtk/gtkcomboboxentry.h>
23
#include <glom/mode_design/iso_codes.h>
28
ComboEntry_Currency::ComboEntry_Currency(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& /* builder */)
29
: Gtk::ComboBoxEntry(cobject)
31
m_model = Gtk::ListStore::create(m_model_columns);
34
const IsoCodes::type_list_currencies list_currencies = IsoCodes::get_list_of_currency_symbols();
35
for(IsoCodes::type_list_currencies::const_iterator iter = list_currencies.begin(); iter != list_currencies.end(); ++iter)
37
Gtk::TreeModel::iterator tree_iter = m_model->append();
38
Gtk::TreeModel::Row row = *tree_iter;
40
const IsoCodes::Currency& currency = *iter;
41
row[m_model_columns.m_symbol] = currency.m_symbol;
42
row[m_model_columns.m_name] = currency.m_name;
46
set_text_column(m_model_columns.m_symbol);
49
pack_start(m_model_columns.m_name);
53
ComboEntry_Currency::~ComboEntry_Currency()