MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / CheckboxFlagsT

Method CheckboxFlagsT

include/imgui/imgui_widgets.cpp:1318–1342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1316
1317template<typename T>
1318bool ImGui::CheckboxFlagsT(const char* label, T* flags, T flags_value)
1319{
1320 bool all_on = (*flags & flags_value) == flags_value;
1321 bool any_on = (*flags & flags_value) != 0;
1322 bool pressed;
1323 if (!all_on && any_on)
1324 {
1325 ImGuiContext& g = *GImGui;
1326 g.NextItemData.ItemFlags |= ImGuiItemFlags_MixedValue;
1327 pressed = Checkbox(label, &all_on);
1328 }
1329 else
1330 {
1331 pressed = Checkbox(label, &all_on);
1332
1333 }
1334 if (pressed)
1335 {
1336 if (all_on)
1337 *flags |= flags_value;
1338 else
1339 *flags &= ~flags_value;
1340 }
1341 return pressed;
1342}
1343
1344bool ImGui::CheckboxFlags(const char* label, int* flags, int flags_value)
1345{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected