2
#ifndef _GTKMM_COMBOBOXENTRYTEXT_H
3
#define _GTKMM_COMBOBOXENTRYTEXT_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 Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 2.1 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
* Lesser General Public License for more details.
19
* You should have received a copy of the GNU Lesser 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
#ifndef GTKMM_DISABLE_DEPRECATED
26
#include <gtkmm/comboboxentry.h>
31
//This is a C++ convenience class that is equivalent to the gtk_combo_box_entry_new_text() C convenience function.
32
//This is copy/paste/search/replaced from ComboBoxText, but the only alternative I see is to use multiple inheritance.
34
//In gtkmm-3.0 we simply wrap GtkComboBoxText, which is also in GTK+ 2.24.
35
//But this C++ class was created before GtkComboBoxText existed and we want to avoid changing the ABI.
37
/** This is a specialisation of the ComboBoxEntry which has one column of text (a simple list),
38
* and appropriate methods for setting and getting the text.
40
* You should not call set_model() or attempt to pack more cells into this combo box via its CellLayout base class.
42
* @deprecated Instead use ComboBoxText with has_entry = true.
46
class ComboBoxEntryText
47
: public ComboBoxEntry
49
#ifndef DOXYGEN_SHOULD_SKIP_THIS
52
ComboBoxEntryText(const ComboBoxEntryText&);
53
ComboBoxEntryText& operator=(const ComboBoxEntryText&);
56
explicit ComboBoxEntryText(const Glib::ConstructParams& construct_params);
57
explicit ComboBoxEntryText(GtkComboBoxEntry* castitem);
59
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
64
/** Add an item to the end of the drop-down list.
65
* @param text The text for the item.
67
void append(const Glib::ustring& text);
69
void insert(int position, const Glib::ustring& text);
71
/** Add an item to the beginning of the drop-down list.
72
* @param text The text for the item.
74
void prepend(const Glib::ustring& text);
76
#ifndef GTKMM_DISABLE_DEPRECATED
77
/** Add an item to the end of the drop-down list.
78
* @param text The text for the item.
80
* @deprecated Use append().
82
void append_text(const Glib::ustring& text);
85
* @deprecated Use insert().
87
void insert_text(int position, const Glib::ustring& text);
89
/** Add an item to the beginning of the drop-down list.
90
* @param text The text for the item.
92
* @deprecated Use prepend().
94
void prepend_text(const Glib::ustring& text);
95
#endif //GTKMM_DISABLE_DEPRECATED
97
//@deprecated Use get_entry()->get_text() to get the actual entered text.
98
Glib::ustring get_active_text() const;
100
//@deprecated Use get_entry()->set_text() to set the actual entered text.
101
void set_active_text(const Glib::ustring& text);
103
//There is a clear() method in the CellLayout base class, so this would cause confusion.
104
//TODO: Remove this when we can break API.
105
/// @deprecated See clear_items(). Since 2.8.
108
/** Remove all items from the drop-down menu.
112
/** Remove the specified item if it is in the drop-down menu.
113
* @text The text of the item that should be removed.
115
void remove_text(const Glib::ustring& text);
119
//Tree model columns:
120
//These columns are used by the model that is created by the default constructor
121
class TextModelColumns : public Gtk::TreeModel::ColumnRecord
127
Gtk::TreeModelColumn<Glib::ustring> m_column;
130
TextModelColumns m_text_columns;
136
#endif //GTKMM_DISABLE_DEPRECATED
138
#endif /* _GTKMM_COMBOBOXENTRYTEXT_H */