MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / SetNextItemSelectionUserData

Method SetNextItemSelectionUserData

include/imgui/imgui_widgets.cpp:8115–8134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8113}
8114
8115void ImGui::SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data)
8116{
8117 // Note that flags will be cleared by ItemAdd(), so it's only useful for Navigation code!
8118 // This designed so widgets can also cheaply set this before calling ItemAdd(), so we are not tied to MultiSelect api.
8119 ImGuiContext& g = *GImGui;
8120 g.NextItemData.SelectionUserData = selection_user_data;
8121 g.NextItemData.FocusScopeId = g.CurrentFocusScopeId;
8122
8123 if (ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect)
8124 {
8125 // Auto updating RangeSrcPassedBy for cases were clipper is not used (done before ItemAdd() clipping)
8126 g.NextItemData.ItemFlags |= ImGuiItemFlags_HasSelectionUserData | ImGuiItemFlags_IsMultiSelect;
8127 if (ms->IO.RangeSrcItem == selection_user_data)
8128 ms->RangeSrcPassedBy = true;
8129 }
8130 else
8131 {
8132 g.NextItemData.ItemFlags |= ImGuiItemFlags_HasSelectionUserData;
8133 }
8134}
8135
8136// In charge of:
8137// - Applying SetAll for submitted items.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected