Ardour  8.7-14-g57a6773833
comboboxentrytext.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 #ifndef _GTKMM_COMBOBOXENTRYTEXT_H
3 #define _GTKMM_COMBOBOXENTRYTEXT_H
4 
5 /* comboboxentrytext.h
6  *
7  * Copyright (C) 2003 The gtkmm Development Team
8  *
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.
13  *
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.
18  *
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.
22  */
23 
24 #ifndef GTKMM_DISABLE_DEPRECATED
25 
26 #include <gtkmm/comboboxentry.h>
27 
28 namespace Gtk
29 {
30 
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.
33 //murrayc.
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.
36 
47 : public ComboBoxEntry
48 {
49 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 private:
51  // noncopyable
53  ComboBoxEntryText& operator=(const ComboBoxEntryText&);
54 
55 protected:
56  explicit ComboBoxEntryText(const Glib::ConstructParams& construct_params);
57  explicit ComboBoxEntryText(GtkComboBoxEntry* castitem);
58 
59 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
60 
61 public:
63 
67  void append(const Glib::ustring& text);
68 
69  void insert(int position, const Glib::ustring& text);
70 
74  void prepend(const Glib::ustring& text);
75 
76 #ifndef GTKMM_DISABLE_DEPRECATED
82  void append_text(const Glib::ustring& text);
83 
87  void insert_text(int position, const Glib::ustring& text);
88 
94  void prepend_text(const Glib::ustring& text);
95 #endif //GTKMM_DISABLE_DEPRECATED
96 
97  //@deprecated Use get_entry()->get_text() to get the actual entered text.
98  Glib::ustring get_active_text() const;
99 
100  //@deprecated Use get_entry()->set_text() to set the actual entered text.
101  void set_active_text(const Glib::ustring& text);
102 
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.
106  void clear();
107 
110  void clear_items();
111 
115  void remove_text(const Glib::ustring& text);
116 
117 protected:
118 
119  //Tree model columns:
120  //These columns are used by the model that is created by the default constructor
122  {
123  public:
125  { add(m_column); }
126 
128  };
129 
131 };
132 
133 
134 } // namespace Gtk
135 
136 #endif //GTKMM_DISABLE_DEPRECATED
137 
138 #endif /* _GTKMM_COMBOBOXENTRYTEXT_H */
139 
Gtk::TreeModelColumn< Glib::ustring > m_column
void insert(int position, const Glib::ustring &text)
Glib::ustring get_active_text() const
void set_active_text(const Glib::ustring &text)
void prepend(const Glib::ustring &text)
void remove_text(const Glib::ustring &text)
void prepend_text(const Glib::ustring &text)
void append_text(const Glib::ustring &text)
void insert_text(int position, const Glib::ustring &text)
void append(const Glib::ustring &text)
TextModelColumns m_text_columns
void add(TreeModelColumnBase &column)
Definition: ardour_ui.h:188