~ubuntu-branches/ubuntu/precise/gtkmm3.0/precise

« back to all changes in this revision

Viewing changes to gtk/src/comboboxtext.hg

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2011-06-17 00:12:44 UTC
  • Revision ID: james.westby@ubuntu.com-20110617001244-9hl5an15hiaaahi6
Tags: upstream-3.0.1
ImportĀ upstreamĀ versionĀ 3.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* comboboxtext.h
 
2
 *
 
3
 * Copyright (C) 2010 The gtkmm Development Team
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
18
 */
 
19
 
 
20
#include <gtkmm/combobox.h>
 
21
 
 
22
_DEFS(gtkmm,gtk)
 
23
_PINCLUDE(gtkmm/private/combobox_p.h)
 
24
 
 
25
 
 
26
namespace Gtk
 
27
{
 
28
 
 
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().
 
31
 *
 
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().
 
34
 *
 
35
 * You should not call set_model() or attempt to pack more cells into this combo box via its CellLayout base class.
 
36
 *
 
37
 * @ingroup Widgets
 
38
 */
 
39
class ComboBoxText
 
40
: public ComboBox
 
41
{
 
42
  _CLASS_GTKOBJECT(ComboBoxText, GtkComboBoxText, GTK_COMBO_BOX_TEXT, ComboBox, GtkComboBox)
 
43
public:
 
44
 
 
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.
 
47
   */
 
48
  explicit ComboBoxText(bool has_entry = false);
 
49
  _IGNORE(gtk_combo_box_text_new_with_entry)
 
50
 
 
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)
 
57
 
 
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)
 
60
 
 
61
  _WRAP_METHOD(void remove_all(), gtk_combo_box_text_remove_all)
 
62
 
 
63
  //TODO: Add a C function
 
64
  void set_active_text(const Glib::ustring& text);
 
65
};
 
66
 
 
67
 
 
68
} // namespace Gtk