| 1316 | |
| 1317 | template<typename T> |
| 1318 | bool 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 | |
| 1344 | bool ImGui::CheckboxFlags(const char* label, int* flags, int flags_value) |
| 1345 | { |
nothing calls this directly
no outgoing calls
no test coverage detected