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

Method SetNextItemSelectionUserData

include/imgui/imgui_widgets.cpp:8209–8230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8207}
8208
8209void ImGui::SetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data)
8210{
8211 // Note that flags will be cleared by ItemAdd(), so it's only useful for Navigation code!
8212 // This designed so widgets can also cheaply set this before calling ItemAdd(), so we are not tied to MultiSelect api.
8213 ImGuiContext& g = *GImGui;
8214 g.NextItemData.SelectionUserData = selection_user_data;
8215 g.NextItemData.FocusScopeId = g.CurrentFocusScopeId;
8216
8217 if (ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect)
8218 {
8219 // Auto updating RangeSrcPassedBy for cases were clipper is not used (done before ItemAdd() clipping)
8220 g.NextItemData.ItemFlags |= ImGuiItemFlags_HasSelectionUserData | ImGuiItemFlags_IsMultiSelect;
8221 if (ms->IO.RangeSrcItem == selection_user_data)
8222 ms->RangeSrcPassedBy = true;
8223 //ms->PrevSubmittedItem = ms->CurrSubmittedItem; // Can't rely on previous g.NextItemData.SelectionUserData because NextItemData is not restored on nested multi-select.
8224 //ms->CurrSubmittedItem = selection_user_data;
8225 }
8226 else
8227 {
8228 g.NextItemData.ItemFlags |= ImGuiItemFlags_HasSelectionUserData;
8229 }
8230}
8231
8232// In charge of:
8233// - Applying SetAll for submitted items.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected