From 88751013c436beeb04e6f3d51cc6a8c3efdf55f3 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 11 Feb 2012 20:54:53 +0000 Subject: Replace old ComboText with Gtk::ComboBoxText (bzr r10960) --- src/ui/widget/combo-text.cpp | 92 -------------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 src/ui/widget/combo-text.cpp (limited to 'src/ui/widget/combo-text.cpp') diff --git a/src/ui/widget/combo-text.cpp b/src/ui/widget/combo-text.cpp deleted file mode 100644 index 43428adb8..000000000 --- a/src/ui/widget/combo-text.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* Glom - * - * Copyright (C) 2001-2004 Murray Cumming - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "combo-text.h" -#include - -ComboText::ComboText() - : Gtk::ComboBox() -{ - m_model = Gtk::ListStore::create(m_text_columns); - set_model(m_model); - pack_start(m_text_columns.m_column); -} - - -ComboText::~ComboText() -{ - -} - -void ComboText::append_text(const Glib::ustring& text) -{ - gtk_combo_box_append_text(gobj(), text.c_str()); -} - -void ComboText::insert_text(int position, const Glib::ustring& text) -{ - gtk_combo_box_insert_text(gobj(), position, text.c_str()); -} - -void ComboText::prepend_text(const Glib::ustring& text) -{ - gtk_combo_box_prepend_text(gobj(), text.c_str()); -} - -Glib::ustring ComboText::get_active_text() const -{ - Glib::ustring result; - - //Get the active row: - Gtk::TreeModel::iterator active_row = get_active(); - if(active_row) - { - Gtk::TreeModel::Row row = *active_row; - result = row[m_text_columns.m_column]; - } - - return result; -} - -void ComboText::clear_text() -{ - m_model->clear(); -} - -void ComboText::set_active_text(const Glib::ustring& text) -{ - for(Gtk::TreeModel::iterator iter = m_model->children().begin(); iter != m_model->children().end(); ++iter) - { - Glib::ustring this_text = (*iter)[m_text_columns.m_column]; - - if(this_text == text) - { - set_active(iter); - return; //success - } - } - - //Not found, so mark it as blank: - unset_active(); -} -- cgit v1.2.3