MCPcopy Create free account
hub / github.com/RenderKit/embree / BeginPopupEx

Method BeginPopupEx

tutorials/common/imgui/imgui.cpp:10001–10022  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

9999
10000// Attention! BeginPopup() adds default flags which BeginPopupEx()!
10001bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags)
10002{
10003 ImGuiContext& g = *GImGui;
10004 if (!IsPopupOpen(id, ImGuiPopupFlags_None))
10005 {
10006 g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
10007 return false;
10008 }
10009
10010 char name[20];
10011 if (flags & ImGuiWindowFlags_ChildMenu)
10012 ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginMenuCount); // Recycle windows based on depth
10013 else
10014 ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame
10015
10016 flags |= ImGuiWindowFlags_Popup;
10017 bool is_open = Begin(name, NULL, flags);
10018 if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display)
10019 EndPopup();
10020
10021 return is_open;
10022}
10023
10024bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags)
10025{

Callers

nothing calls this directly

Calls 2

ImFormatStringFunction · 0.85
ClearFlagsMethod · 0.45

Tested by

no test coverage detected