~mc.../inkscape/inkscape

« back to all changes in this revision

Viewing changes to src/ui/widget/combo-text.h

  • Committer: mental
  • Date: 2006-01-16 02:36:01 UTC
  • Revision ID: mental@users.sourceforge.net-20060116023601-wkr0h7edl5veyudq
moving trunk for module inkscape

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Glom
 
2
 *
 
3
 * Copyright (C) 2001-2004 Murray Cumming
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License as
 
7
 * published by the Free Software Foundation; either version 2 of the
 
8
 * License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful, but
 
11
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public
 
16
 * License along with this program; if not, write to the
 
17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
18
 * Boston, MA 02111-1307, USA.
 
19
 */
 
20
 
 
21
#ifndef GLOM_MODE_DESIGN_COMBO_TEXTGLADE_HH
 
22
#define GLOM_MODE_DESIGN_COMBO_TEXTGLADE_HH
 
23
 
 
24
#include <gtkmm/combobox.h>
 
25
 
 
26
#include <gtkmm/liststore.h>
 
27
 
 
28
/** This class should just derive from Gtk::ComboBoxText and provide a
 
29
 * constuctor suitable for libglade's get_widget_derived() template.
 
30
 * However, I have reimplemented Gtk::ComboBoxText here temporarily,
 
31
 * until the fixes in gtkmm 2.4.3 are widely available.
 
32
 */
 
33
class ComboText : public Gtk::ComboBox
 
34
{
 
35
 public:
 
36
    ComboText();
 
37
    virtual ~ComboText();
 
38
 
 
39
    void append_text(const Glib::ustring& text);
 
40
    void insert_text(int position, const Glib::ustring& text);
 
41
    void prepend_text(const Glib::ustring& text);
 
42
    Glib::ustring get_active_text() const;
 
43
 
 
44
    //This is not part of ComboBoxText:
 
45
    void clear_text();
 
46
    void set_active_text(const Glib::ustring& text);
 
47
  
 
48
 protected:
 
49
 
 
50
    //Tree model columns:
 
51
    //These columns are used by the model that is created by the default constructor
 
52
    class TextModelColumns : public Gtk::TreeModel::ColumnRecord
 
53
        {
 
54
        public:
 
55
            TextModelColumns()
 
56
                { add(m_column); }
 
57
 
 
58
            Gtk::TreeModelColumn<Glib::ustring> m_column;
 
59
        };
 
60
 
 
61
    TextModelColumns m_text_columns;
 
62
    Glib::RefPtr<Gtk::ListStore> m_model;
 
63
  
 
64
};
 
65
 
 
66
#endif //GLOM_MODE_DESIGN_COMBO_TEXTGLADE_HH