summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 21f7bf7)
raw | patch | inline | side by side (parent: 21f7bf7)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 10 Feb 2009 22:57:06 +0000 (22:57 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 10 Feb 2009 22:57:06 +0000 (22:57 +0000) |
src/ui/widget/combo-enums.h | patch | blob | history |
index 11777e0b577a19f8ba5e1aa1f2ce858533e0db89..4f70c9d2827b6ca1384047fc7ce28a0715adc479 100644 (file)
return an.compare(bn);
}
+ bool _sort;
+
public:
- ComboBoxEnum(E default_value, const Util::EnumDataConverter<E>& c, const SPAttributeEnum a = SP_ATTR_INVALID)
+ ComboBoxEnum(E default_value, const Util::EnumDataConverter<E>& c, const SPAttributeEnum a = SP_ATTR_INVALID, bool sort = true)
: AttrWidget(a, (unsigned int)default_value), setProgrammatically(false), _converter(c)
{
+ _sort = sort;
+
signal_changed().connect(signal_attr_changed().make_slot());
_model = Gtk::ListStore::create(_columns);
set_active_by_id(default_value);
// Sort the list
- _model->set_default_sort_func(sigc::mem_fun(*this, &ComboBoxEnum<E>::on_sort_compare));
- _model->set_sort_column(_columns.label, Gtk::SORT_ASCENDING);
+ if (sort) {
+ _model->set_default_sort_func(sigc::mem_fun(*this, &ComboBoxEnum<E>::on_sort_compare));
+ _model->set_sort_column(_columns.label, Gtk::SORT_ASCENDING);
+ }
}
- ComboBoxEnum(const Util::EnumDataConverter<E>& c, const SPAttributeEnum a = SP_ATTR_INVALID)
+ ComboBoxEnum(const Util::EnumDataConverter<E>& c, const SPAttributeEnum a = SP_ATTR_INVALID, bool sort = true)
: AttrWidget(a, (unsigned int) 0), setProgrammatically(false), _converter(c)
{
+ _sort = sort;
+
signal_changed().connect(signal_attr_changed().make_slot());
_model = Gtk::ListStore::create(_columns);
set_active(0);
// Sort the list
- _model->set_default_sort_func(sigc::mem_fun(*this, &ComboBoxEnum<E>::on_sort_compare));
- _model->set_sort_column(_columns.label, Gtk::SORT_ASCENDING);
+ if (_sort) {
+ _model->set_default_sort_func(sigc::mem_fun(*this, &ComboBoxEnum<E>::on_sort_compare));
+ _model->set_sort_column(_columns.label, Gtk::SORT_ASCENDING);
+ }
}
virtual Glib::ustring get_as_attribute() const