MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / BeginPopupEx

Method BeginPopupEx

extern/imgui/imgui.cpp:10715–10736  ·  view source on GitHub ↗

Attention! BeginPopup() adds default flags which BeginPopupEx()!

Source from the content-addressed store, hash-verified

10713
10714// Attention! BeginPopup() adds default flags which BeginPopupEx()!
10715bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags)
10716{
10717 ImGuiContext& g = *GImGui;
10718 if (!IsPopupOpen(id, ImGuiPopupFlags_None))
10719 {
10720 g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
10721 return false;
10722 }
10723
10724 char name[20];
10725 if (flags & ImGuiWindowFlags_ChildMenu)
10726 ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginMenuCount); // Recycle windows based on depth
10727 else
10728 ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame
10729
10730 flags |= ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoDocking;
10731 bool is_open = Begin(name, NULL, flags);
10732 if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display)
10733 EndPopup();
10734
10735 return is_open;
10736}
10737
10738bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags)
10739{

Callers

nothing calls this directly

Calls 2

ImFormatStringFunction · 0.85
ClearFlagsMethod · 0.45

Tested by

no test coverage detected