#include "vendor-imgui-ext.hpp" #include "imgui_internal.h" // copy-pasted // TODO submit PR so this isn't necessary template bool ImGui::CheckboxFlagsT(const char* label, T* flags, T flags_value) { bool all_on = (*flags & flags_value) == flags_value; bool any_on = (*flags & flags_value) != 0; bool pressed; if (!all_on && any_on) { ImGuiContext& g = *GImGui; g.NextItemData.ItemFlags |= ImGuiItemFlags_MixedValue; pressed = Checkbox(label, &all_on); } else { pressed = Checkbox(label, &all_on); } if (pressed) { if (all_on) *flags |= flags_value; else *flags &= ~flags_value; } return pressed; } bool ImGui::CheckboxFlags(const char* label, long int* flags, long int flags_value) { return CheckboxFlagsT(label, flags, flags_value); } bool ImGui::CheckboxFlags(const char* label, unsigned long int* flags, unsigned long int flags_value) { return CheckboxFlagsT(label, flags, flags_value); }