mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-24 05:19:02 +08:00
Demo: Tweaks format.
This commit is contained in:
parent
398a4e1865
commit
12aa3cb09e
@ -1061,7 +1061,9 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
goto_line |= ImGui::InputInt("##Line", &line, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
ImGui::BeginChild("Sub1", ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f,300), false, ImGuiWindowFlags_HorizontalScrollbar | (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0));
|
||||
// Child 1: no border, enable horizontal scrollbar
|
||||
{
|
||||
ImGui::BeginChild("Child1", ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f, 300), false, ImGuiWindowFlags_HorizontalScrollbar | (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0));
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
ImGui::Text("%04d: scrollable region", i);
|
||||
@ -1071,11 +1073,14 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
if (goto_line && line >= 100)
|
||||
ImGui::SetScrollHere();
|
||||
ImGui::EndChild();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
// Child 2: rounded border
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f);
|
||||
ImGui::BeginChild("Sub2", ImVec2(0,300), true, (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0));
|
||||
ImGui::BeginChild("Child2", ImVec2(0,300), true, (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0));
|
||||
ImGui::Text("With border");
|
||||
ImGui::Columns(2);
|
||||
for (int i = 0; i < 100; i++)
|
||||
@ -1088,6 +1093,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
}
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user