MCPcopy Create free account
hub / github.com/SatDump/SatDump / ShowDemoWindowLayout

Function ShowDemoWindowLayout

src-core/imgui/imgui_demo.cpp:2659–3470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2657}
2658
2659static void ShowDemoWindowLayout()
2660{
2661 IMGUI_DEMO_MARKER("Layout");
2662 if (!ImGui::CollapsingHeader("Layout & Scrolling"))
2663 return;
2664
2665 IMGUI_DEMO_MARKER("Layout/Child windows");
2666 if (ImGui::TreeNode("Child windows"))
2667 {
2668 ImGui::SeparatorText("Child windows");
2669
2670 HelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window.");
2671 static bool disable_mouse_wheel = false;
2672 static bool disable_menu = false;
2673 ImGui::Checkbox("Disable Mouse Wheel", &disable_mouse_wheel);
2674 ImGui::Checkbox("Disable Menu", &disable_menu);
2675
2676 // Child 1: no border, enable horizontal scrollbar
2677 {
2678 ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar;
2679 if (disable_mouse_wheel)
2680 window_flags |= ImGuiWindowFlags_NoScrollWithMouse;
2681 ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f, 260), false, window_flags);
2682 for (int i = 0; i < 100; i++)
2683 ImGui::Text("%04d: scrollable region", i);
2684 ImGui::EndChild();
2685 }
2686
2687 ImGui::SameLine();
2688
2689 // Child 2: rounded border
2690 {
2691 ImGuiWindowFlags window_flags = ImGuiWindowFlags_None;
2692 if (disable_mouse_wheel)
2693 window_flags |= ImGuiWindowFlags_NoScrollWithMouse;
2694 if (!disable_menu)
2695 window_flags |= ImGuiWindowFlags_MenuBar;
2696 ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
2697 ImGui::BeginChild("ChildR", ImVec2(0, 260), true, window_flags);
2698 if (!disable_menu && ImGui::BeginMenuBar())
2699 {
2700 if (ImGui::BeginMenu("Menu"))
2701 {
2702 ShowExampleMenuFile();
2703 ImGui::EndMenu();
2704 }
2705 ImGui::EndMenuBar();
2706 }
2707 if (ImGui::BeginTable("split", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings))
2708 {
2709 for (int i = 0; i < 100; i++)
2710 {
2711 char buf[32];
2712 sprintf(buf, "%03d", i);
2713 ImGui::TableNextColumn();
2714 ImGui::Button(buf, ImVec2(-FLT_MIN, 0.0f));
2715 }
2716 ImGui::EndTable();

Callers 1

ShowDemoWindowMethod · 0.85

Calls 15

ImVec2Function · 0.85
PushStyleVarFunction · 0.85
ShowExampleMenuFileFunction · 0.85
BeginTableFunction · 0.85
EndTableFunction · 0.85
PopStyleVarFunction · 0.85
SetNextItemWidthFunction · 0.85
PushStyleColorFunction · 0.85
PopStyleColorFunction · 0.85
DragFloatFunction · 0.85
TextColoredFunction · 0.85
ImVec4Class · 0.85

Tested by

no test coverage detected