12#ifndef INKSCAPE_UI_WIDGET_COMBO_ENUMS_H
13#define INKSCAPE_UI_WIDGET_COMBO_ENUMS_H
15#include <glibmm/i18n.h>
16#include <glibmm/refptr.h>
17#include <glibmm/ustring.h>
18#include <gtkmm/liststore.h>
19#include <gtkmm/stringlist.h>
20#include <gtkmm/stringobject.h>
21#include <gtkmm/treemodel.h>
41 const char* translation_context =
nullptr)
42 :
ComboBoxEnum{
c, a, sort, translation_context, static_cast<unsigned>(default_value)}
49 const char *
const translation_context =
nullptr)
60 return get_selected();
73 SPAttr const a,
bool const sort,
74 const char *
const translation_context,
75 unsigned const default_value)
83 bool separator =
false;
85 for (
unsigned int i = 0; i <
_converter._length; ++i) {
87 if (
data.key ==
"-") {
92 Glib::ustring translated = translation_context ?
93 g_dpgettext2(
nullptr, translation_context,
data.label.c_str()) :
94 gettext(
data.label.c_str());
100 std::sort(begin(
_enums),
end(
_enums), [](
const auto& a,
const auto& b){
return a.label < b.label; });
115 auto pos = get_selected();
116 if (pos <
_enums.size()) {
134 auto pos = get_selected();
135 if (pos <
_enums.size()) {
159 auto it = std::find_if(begin(
_enums),
end(
_enums), [
id](
const auto& el){
return el.id == id; });
175 Glib::ustring
const &tooltip,
177 Glib::ustring
const &icon = {},
178 bool const mnemonic =
true,
179 bool const sort =
true)
@ INVALID
Must have value 0.
Simplified management of enumerations of svg items with UI labels.
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Simple DropDown widget presenting popup list of string items to choose from.
static cairo_user_data_key_t key