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_borderwidth.h"
22
#include <gtk/gtkcomboboxentry.h>
23
#include <sstream> //For stringstream.
28
ComboEntry_BorderWidth::ComboEntry_BorderWidth(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& /* refGlade */)
29
: Gtk::ComboBoxEntry(cobject)
31
m_model = Gtk::ListStore::create(m_model_columns);
34
Gtk::TreeModel::iterator iter = m_model->append();
35
(*iter)[m_model_columns.m_value] = string_for_number(0.05);
36
iter = m_model->append();
37
(*iter)[m_model_columns.m_value] = string_for_number(0.1);
38
iter = m_model->append();
39
(*iter)[m_model_columns.m_value] = string_for_number(0.2);
40
iter = m_model->append();
41
(*iter)[m_model_columns.m_value] = string_for_number(0.5);
42
iter = m_model->append();
43
(*iter)[m_model_columns.m_value] = string_for_number(1.0);
46
set_text_column(m_model_columns.m_value);
50
ComboEntry_BorderWidth::~ComboEntry_BorderWidth()
55
Glib::ustring ComboEntry_BorderWidth::string_for_number(double number)
57
std::stringstream the_stream;
58
the_stream.imbue(std::locale("")); //The current locale.
60
return the_stream.str();