3
* Copyright (C) 2010 The gtkmm Development Team
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free
17
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
#include <gtkmm/combobox.h>
23
_PINCLUDE(gtkmm/private/combobox_p.h)
29
/** This is a simple variant of ComboBox that hides the model-view complexity for simple text-only use cases.
30
* You can add items to a ComboBoxText with append(), insert() or prepend() and remove items with remove_text().
32
* If the ComboBoxText contains an entry (via the 'has_entry' property), its contents can be retrieved using
33
* get_active_text(). The entry itself can be accessed by calling ComboBox::get_entry() or ComboBox::get_entry_text().
35
* You should not call set_model() or attempt to pack more cells into this combo box via its CellLayout base class.
42
_CLASS_GTKOBJECT(ComboBoxText, GtkComboBoxText, GTK_COMBO_BOX_TEXT, ComboBox, GtkComboBox)
45
/** Creates a new empty ComboBoxText, optionally with an entry.
46
* @param has_entry If this is true then this will have an Entry widget.
48
explicit ComboBoxText(bool has_entry = false);
49
_IGNORE(gtk_combo_box_text_new_with_entry)
51
_WRAP_METHOD(void append(const Glib::ustring& text), gtk_combo_box_text_append_text)
52
_WRAP_METHOD(void append(const Glib::ustring& id, const Glib::ustring& text), gtk_combo_box_text_append)
53
_WRAP_METHOD(void insert(int position, const Glib::ustring& text), gtk_combo_box_text_insert_text)
54
_WRAP_METHOD(void insert(int position, const Glib::ustring& id, const Glib::ustring& text), gtk_combo_box_text_insert)
55
_WRAP_METHOD(void prepend(const Glib::ustring& text), gtk_combo_box_text_prepend_text)
56
_WRAP_METHOD(void prepend(const Glib::ustring& id, const Glib::ustring& text), gtk_combo_box_text_prepend)
58
_WRAP_METHOD(void remove_text(int position), gtk_combo_box_text_remove)
59
_WRAP_METHOD(Glib::ustring get_active_text() const, gtk_combo_box_text_get_active_text)
61
_WRAP_METHOD(void remove_all(), gtk_combo_box_text_remove_all)
63
//TODO: Add a C function
64
void set_active_text(const Glib::ustring& text);