2 #ifndef _GTKMM_COMBOBOXTEXT_H
3 #define _GTKMM_COMBOBOXTEXT_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/combobox.h>
29 //This is a C++ convenience class that is equivalent to the gtk_combo_box_new_text() C convenience function.
31 /** This is a specialisation of the ComboBox which has one column of text (a simple list),
32 * and appropriate methods for setting and getting the text.
34 * Note that you can not use this class with Gnome::Glade::Xml::get_widget_derived() to wrap a GtkComboBox added
35 * in the Glade user interface designer, because Glade adds its own TreeModel instead of using the TreeModel from
36 * this class. You could use a normal Gtk::ComboBox instead, though you can not use Glade to add rows to a TreeModel
37 * that is defined in your C++ code.
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48 ComboBoxText(const ComboBoxText&);
49 ComboBoxText& operator=(const ComboBoxText&);
52 explicit ComboBoxText(const Glib::ConstructParams& construct_params);
53 explicit ComboBoxText(GtkComboBox* castitem);
55 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
60 void append_text(const Glib::ustring& text);
62 void insert_text(int position, const Glib::ustring& text);
64 void prepend_text(const Glib::ustring& text);
66 Glib::ustring get_active_text() const;
67 void set_active_text(const Glib::ustring& text);
74 //These columns are used by the model that is created by the default constructor
75 class TextModelColumns : public Gtk::TreeModel::ColumnRecord
81 Gtk::TreeModelColumn<Glib::ustring> m_column;
84 TextModelColumns m_text_columns;
91 #endif /* _GTKMM_COMBOBOXTEXT_H */