1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

MultiSelect: Temporary fix/work-around for child/popup to not inherit MultiSelectEnabled flag, until we make mulit-select data stackable.

This commit is contained in:
ocornut 2020-08-20 20:46:57 +02:00
parent 00c4b8f2a3
commit b9721c1ed7
3 changed files with 17 additions and 9 deletions

View file

@ -2857,7 +2857,7 @@ static void ShowDemoWindowMultiSelect()
if (ImGui::RadioButton("Tree nodes", widget_type == WidgetType_TreeNode)) { widget_type = WidgetType_TreeNode; }
ImGui::SameLine();
ImGui::Checkbox("Use 2 columns", &use_columns);
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", (unsigned int*)&ImGui::GetIO().ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard);
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", &ImGui::GetIO().ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard);
ImGui::SameLine(); HelpMarker("Hold CTRL and click to select multiple items. Hold SHIFT to select a range. Keyboard is also supported.");
// Open a scrolling region
@ -2918,6 +2918,14 @@ static void ShowDemoWindowMultiSelect()
ImGui::TreePop();
}
// Right-click: context menu
if (ImGui::BeginPopupContextItem())
{
ImGui::Text("(Testing Selectable inside an embedded popup)");
ImGui::Selectable("Close");
ImGui::EndPopup();
}
if (use_columns)
{
ImGui::NextColumn();