mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
MultiSelect: mark parent child window as navigable into, with highlight. Assume user will always submit interactive items.
This commit is contained in:
parent
f6b5caf82c
commit
443b034895
2 changed files with 3 additions and 0 deletions
|
|
@ -3211,6 +3211,7 @@ static void ShowDemoWindowMultiSelect()
|
||||||
ImGui::BulletText("Shift+Click to check multiple boxes.");
|
ImGui::BulletText("Shift+Click to check multiple boxes.");
|
||||||
ImGui::BulletText("Shift+Keyboard to copy current value to other boxes.");
|
ImGui::BulletText("Shift+Keyboard to copy current value to other boxes.");
|
||||||
|
|
||||||
|
// If you have an array of checkboxes, you may want to use NoAutoSelect + NoAutoClear and the ImGuiSelectionExternalStorage helper.
|
||||||
static bool values[20] = {};
|
static bool values[20] = {};
|
||||||
static ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_NoAutoSelect | ImGuiMultiSelectFlags_NoAutoClear | ImGuiMultiSelectFlags_ClearOnEscape;
|
static ImGuiMultiSelectFlags flags = ImGuiMultiSelectFlags_NoAutoSelect | ImGuiMultiSelectFlags_NoAutoClear | ImGuiMultiSelectFlags_ClearOnEscape;
|
||||||
ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoSelect", &flags, ImGuiMultiSelectFlags_NoAutoSelect);
|
ImGui::CheckboxFlags("ImGuiMultiSelectFlags_NoAutoSelect", &flags, ImGuiMultiSelectFlags_NoAutoSelect);
|
||||||
|
|
|
||||||
|
|
@ -7329,6 +7329,8 @@ ImGuiMultiSelectIO* ImGui::BeginMultiSelect(ImGuiMultiSelectFlags flags, int cur
|
||||||
ms->BackupCursorMaxPos = window->DC.CursorMaxPos;
|
ms->BackupCursorMaxPos = window->DC.CursorMaxPos;
|
||||||
ms->ScopeRectMin = window->DC.CursorMaxPos = window->DC.CursorPos;
|
ms->ScopeRectMin = window->DC.CursorMaxPos = window->DC.CursorPos;
|
||||||
PushFocusScope(ms->FocusScopeId);
|
PushFocusScope(ms->FocusScopeId);
|
||||||
|
if (flags & ImGuiMultiSelectFlags_ScopeWindow) // Mark parent child window as navigable into, with highlight. Assume user will always submit interactive items.
|
||||||
|
window->DC.NavLayersActiveMask |= 1 << ImGuiNavLayer_Main;
|
||||||
|
|
||||||
// Use copy of keyboard mods at the time of the request, otherwise we would requires mods to be held for an extra frame.
|
// Use copy of keyboard mods at the time of the request, otherwise we would requires mods to be held for an extra frame.
|
||||||
ms->KeyMods = g.NavJustMovedToId ? g.NavJustMovedToKeyMods : g.IO.KeyMods;
|
ms->KeyMods = g.NavJustMovedToId ? g.NavJustMovedToKeyMods : g.IO.KeyMods;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue