Ardour  9.0-pre0-384-ga76afae0e9
comboboxtext.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 #ifndef _GTKMM_COMBOBOXTEXT_H
3 #define _GTKMM_COMBOBOXTEXT_H
4 
5 /* comboboxtext.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 #include <gtkmm/combobox.h>
25 
26 namespace Gtk
27 {
28 
29 //This is a C++ convenience class that is equivalent to the gtk_combo_box_new_text() C convenience function.
30 //In gtkmm-3.0 we simply wrap GtkComboBoxText, which is also in GTK+ 2.24.
31 //But this C++ class was created before GtkComboBoxText existed and we want to avoid changing the ABI.
32 
54 : public ComboBox
55 {
56 #ifndef DOXYGEN_SHOULD_SKIP_THIS
57 private:
58  // noncopyable
59  ComboBoxText(const ComboBoxText&);
60  ComboBoxText& operator=(const ComboBoxText&);
61 
62 protected:
63  explicit ComboBoxText(const Glib::ConstructParams& construct_params);
64  explicit ComboBoxText(GtkComboBox* castitem);
65 
66 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
67 
68 public:
69 
73 
77  explicit ComboBoxText(bool has_entry); //In gtkmm 3.0 has_entry has a default value but we already have a default constructor here.
78 
82  void append(const Glib::ustring& text);
83 
84  void insert(int position, const Glib::ustring& text);
85 
89  void prepend(const Glib::ustring& text);
90 
91 #ifndef GTKMM_DISABLE_DEPRECATED
97  void append_text(const Glib::ustring& text);
98 
102  void insert_text(int position, const Glib::ustring& text);
103 
109  void prepend_text(const Glib::ustring& text);
110 
115  void clear_items();
116 #endif //GTKMM_DISABLE_DEPRECATED
117 
121  Glib::ustring get_active_text() const;
122 
126  void set_active_text(const Glib::ustring& text);
127 
128  //There is a clear() method in the CellLayout base class, so this would cause confusion.
129  //TODO: Remove this when we can break API.
131  void clear();
132 
135  void remove_all();
136 
140  void remove_text(const Glib::ustring& text);
141 
142 protected:
143 
144  //Tree model columns:
145  //These columns are used by the model that is created by the default constructor
147  {
148  public:
150  { add(m_column); }
151 
153  };
154 
156 };
157 
158 
159 } // namespace Gtk
160 
161 
162 #endif /* _GTKMM_COMBOBOXTEXT_H */
163 
Gtk::TreeModelColumn< Glib::ustring > m_column
Definition: comboboxtext.h:152
ComboBoxText(bool has_entry)
void prepend_text(const Glib::ustring &text)
TextModelColumns m_text_columns
Definition: comboboxtext.h:155
void insert_text(int position, const Glib::ustring &text)
void prepend(const Glib::ustring &text)
void set_active_text(const Glib::ustring &text)
void append_text(const Glib::ustring &text)
Glib::ustring get_active_text() const
void insert(int position, const Glib::ustring &text)
void append(const Glib::ustring &text)
void remove_text(const Glib::ustring &text)
void add(TreeModelColumnBase &column)
Definition: ardour_ui.h:187