65bool EnumCombo(
const char* label, T& enumeration1, T& enumeration2,
const char* previewAppendix =
"")
68 std::string previewText = enumeration1 == enumeration2
69 ? fmt::format(
"{}{}",
NAV::to_string(enumeration1), previewAppendix)
71 if (ImGui::BeginCombo(label, previewText.c_str()))
73 for (
size_t i = 0; i < static_cast<size_t>(T::COUNT); i++)
75 const bool is_selected = (
static_cast<size_t>(enumeration1) == i);
76 if (ImGui::Selectable(
NAV::to_string(
static_cast<T
>(i)), is_selected))
78 enumeration1 =
static_cast<T
>(i);
79 enumeration2 =
static_cast<T
>(i);
86 ImGui::SetItemDefaultFocus();
bool EnumCombo(const char *label, T &enumeration, size_t startIdx=0)
Combo representing an enumeration.
Definition EnumCombo.hpp:30