mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-21 12:52:19 +01:00
Fixes
parent
80c440f8c1
commit
485cd7b87e
@ -52,8 +52,8 @@ Minimum pseudo-code example using this helper:
|
|||||||
```cpp
|
```cpp
|
||||||
static vector<MyItem> items; // Your items
|
static vector<MyItem> items; // Your items
|
||||||
static ImGuiSelectionBasicStorage selection; // Your selection
|
static ImGuiSelectionBasicStorage selection; // Your selection
|
||||||
selection.AdapterData = (void*)&items; // Setup adapter so selection.ApplyRequests() function can convert indexes to identifiers.
|
selection.UserData = (void*)&items; // Setup adapter so selection.ApplyRequests() function can convert indexes to identifiers.
|
||||||
selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { return ((vector<MyItem>*)self->AdapterData))[idx].ID; };
|
selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { return ((vector<MyItem>*)self->UserData))[idx].ID; };
|
||||||
|
|
||||||
ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(ImGuiMultiSelectFlags_None, selection.Size, items.Size);
|
ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(ImGuiMultiSelectFlags_None, selection.Size, items.Size);
|
||||||
selection.ApplyRequests(ms_io);
|
selection.ApplyRequests(ms_io);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user