mirror of
https://github.com/ocornut/imgui.git
synced 2026-06-01 01:34:57 +08:00
Demo: fix in 'Demo->Selection->Multi-Select in a Table' section.
This commit is contained in:
+3
-1
@@ -2863,7 +2863,7 @@ static void DemoWindowWidgetsSelectionAndMultiSelect(ImGuiDemoWindowData* demo_d
|
|||||||
|
|
||||||
const int ITEMS_COUNT = 10000;
|
const int ITEMS_COUNT = 10000;
|
||||||
ImGui::Text("Selection: %d/%d", selection.Size, ITEMS_COUNT);
|
ImGui::Text("Selection: %d/%d", selection.Size, ITEMS_COUNT);
|
||||||
if (ImGui::BeginTable("##Basket", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter))
|
if (ImGui::BeginTable("##Basket", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter, ImVec2(0.0f, ImGui::GetFontSize() * 20)))
|
||||||
{
|
{
|
||||||
ImGui::TableSetupColumn("Object");
|
ImGui::TableSetupColumn("Object");
|
||||||
ImGui::TableSetupColumn("Action");
|
ImGui::TableSetupColumn("Action");
|
||||||
@@ -2884,6 +2884,7 @@ static void DemoWindowWidgetsSelectionAndMultiSelect(ImGuiDemoWindowData* demo_d
|
|||||||
{
|
{
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::PushID(n);
|
||||||
char label[64];
|
char label[64];
|
||||||
sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]);
|
sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]);
|
||||||
bool item_is_selected = selection.Contains((ImGuiID)n);
|
bool item_is_selected = selection.Contains((ImGuiID)n);
|
||||||
@@ -2891,6 +2892,7 @@ static void DemoWindowWidgetsSelectionAndMultiSelect(ImGuiDemoWindowData* demo_d
|
|||||||
ImGui::Selectable(label, item_is_selected, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap);
|
ImGui::Selectable(label, item_is_selected, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap);
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::SmallButton("hello");
|
ImGui::SmallButton("hello");
|
||||||
|
ImGui::PopID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user