mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 06:06:35 +00:00
Added stacked modal windows example (#249)
This commit is contained in:
parent
f0311b643a
commit
0f38a53d28
23
imgui.cpp
23
imgui.cpp
@ -11490,7 +11490,7 @@ void ImGui::ShowTestWindow(bool* opened)
|
||||
{
|
||||
ImGui::TextWrapped("Modal windows are like popups but the user cannot close them by clicking outside the window.");
|
||||
|
||||
if (ImGui::Button("Delete"))
|
||||
if (ImGui::Button("Delete.."))
|
||||
ImGui::OpenPopup("Delete?");
|
||||
if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse))
|
||||
{
|
||||
@ -11508,6 +11508,27 @@ void ImGui::ShowTestWindow(bool* opened)
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
if (ImGui::Button("Stacked modals.."))
|
||||
ImGui::OpenPopup("Stacked 1");
|
||||
if (ImGui::BeginPopupModal("Stacked 1"))
|
||||
{
|
||||
ImGui::Text("Hello from Stacked The First");
|
||||
|
||||
if (ImGui::Button("Another one.."))
|
||||
ImGui::OpenPopup("Stacked 2");
|
||||
if (ImGui::BeginPopupModal("Stacked 2"))
|
||||
{
|
||||
ImGui::Text("Hello from Stacked The Second");
|
||||
if (ImGui::Button("Close"))
|
||||
ImGui::CloseCurrentPopup();
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
if (ImGui::Button("Close"))
|
||||
ImGui::CloseCurrentPopup();
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user