@@ -4456,14 +4456,42 @@ static void ShowDemoWindowTables()
4456
4456
ImGui::TreePop ();
4457
4457
}
4458
4458
4459
+ // Demonstrate creating multiple tables with the same ID
4460
+ if (open_action != -1 )
4461
+ ImGui::SetNextItemOpen (open_action != 0 );
4462
+ if (ImGui::TreeNode (" Synced instances" ))
4463
+ {
4464
+ HelpMarker (" Multiple tables with the same identifier will share their settings, width, visibility, order etc." );
4465
+ for (int n = 0 ; n < 3 ; n++)
4466
+ {
4467
+ char buf[32 ];
4468
+ sprintf (buf, " Synced Table %d" , n);
4469
+ bool open = ImGui::CollapsingHeader (buf, ImGuiTreeNodeFlags_DefaultOpen);
4470
+ if (open && ImGui::BeginTable (" Table" , 3 , ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_ColumnsWidthFixed | ImGuiTableFlags_NoSavedSettings))
4471
+ {
4472
+ ImGui::TableSetupColumn (" One" );
4473
+ ImGui::TableSetupColumn (" Two" );
4474
+ ImGui::TableSetupColumn (" Three" );
4475
+ ImGui::TableHeadersRow ();
4476
+ for (int cell = 0 ; cell < 9 ; cell++)
4477
+ {
4478
+ ImGui::TableNextColumn ();
4479
+ ImGui::Text (" this cell %d" , cell);
4480
+ }
4481
+ ImGui::EndTable ();
4482
+ }
4483
+ }
4484
+ ImGui::TreePop ();
4485
+ }
4486
+
4487
+ // Demonstrate using Sorting facilities
4488
+ // This is a simplified version of the "Advanced" example, where we mostly focus on the code necessary to handle sorting.
4489
+ // Note that the "Advanced" example also showcase manually triggering a sort (e.g. if item quantities have been modified)
4459
4490
static const char * template_items_names[] =
4460
4491
{
4461
4492
" Banana" , " Apple" , " Cherry" , " Watermelon" , " Grapefruit" , " Strawberry" , " Mango" ,
4462
4493
" Kiwi" , " Orange" , " Pineapple" , " Blueberry" , " Plum" , " Coconut" , " Pear" , " Apricot"
4463
4494
};
4464
-
4465
- // This is a simplified version of the "Advanced" example, where we mostly focus on the code necessary to handle sorting.
4466
- // Note that the "Advanced" example also showcase manually triggering a sort (e.g. if item quantities have been modified)
4467
4495
if (open_action != -1 )
4468
4496
ImGui::SetNextItemOpen (open_action != 0 );
4469
4497
if (ImGui::TreeNode (" Sorting" ))
0 commit comments