mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Demo: fix in 'Demo->Selection->Multi-Select in a Table' section.
This commit is contained in:
parent
7c6febed66
commit
47766ca403
1 changed files with 3 additions and 1 deletions
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue