21
21
#ifndef GLOM_MODE_DESIGN_COMBO_TEXTGLADE_HH
22
22
#define GLOM_MODE_DESIGN_COMBO_TEXTGLADE_HH
24
//#include <gtkmm/comboboxtext.h>
25
#include <gtkmm/combobox.h>
26
#include <libglademm.h>
24
#include <gtkmm/comboboxtext.h>
25
#include <gtkmm/builder.h>
28
27
#include <gtkmm/liststore.h>
33
/** This class should just derive from Gtk::ComboBoxText and provide a constuctor suitable for libglade's get_widget_derived() template.
34
* However, I have reimplemented Gtk::ComboBoxText here temporarily, until the fixes in gtkmm 2.4.3 are widely available.
32
/** This class just derives from Gtk::ComboBoxText and provides a constuctor suitable for libglade's get_widget_derived() template.
36
class Combo_TextGlade : public Gtk::ComboBox
34
class Combo_TextGlade : public Gtk::ComboBoxText
39
Combo_TextGlade(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
40
virtual ~Combo_TextGlade();
42
void append_text(const Glib::ustring& text);
43
void append_separator();
44
void prepend_text(const Glib::ustring& text);
45
Glib::ustring get_active_text() const;
47
//This is not part of ComboBoxText:
49
void set_active_text(const Glib::ustring& text);
51
///This ensures that something is selected:
37
Combo_TextGlade(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
39
///This ensures that something is selected,
52
40
void set_first_active();
56
//This determines whether each row should be shown as a separator.
57
bool on_row_separator(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter);
60
//These columns are used by the model that is created by the default constructor
61
class TextModelColumns : public Gtk::TreeModel::ColumnRecord
65
{ add(m_column); add(m_separator); }
67
Gtk::TreeModelColumn<Glib::ustring> m_column;
68
Gtk::TreeModelColumn<bool> m_separator;
71
TextModelColumns m_text_columns;
72
Glib::RefPtr<Gtk::ListStore> m_model;