MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / BeginPopupEx

Method BeginPopupEx

KBotExt/imgui/imgui.cpp:10462–10483  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

10460
10461// Attention! BeginPopup() adds default flags which BeginPopupEx()!
10462bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags)
10463{
10464 ImGuiContext& g = *GImGui;
10465 if (!IsPopupOpen(id, ImGuiPopupFlags_None))
10466 {
10467 g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
10468 return false;
10469 }
10470
10471 char name[20];
10472 if (flags & ImGuiWindowFlags_ChildMenu)
10473 ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginMenuCount); // Recycle windows based on depth
10474 else
10475 ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame
10476
10477 flags |= ImGuiWindowFlags_Popup;
10478 bool is_open = Begin(name, NULL, flags);
10479 if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display)
10480 EndPopup();
10481
10482 return is_open;
10483}
10484
10485bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags)
10486{

Callers

nothing calls this directly

Calls 2

ImFormatStringFunction · 0.85
ClearFlagsMethod · 0.45

Tested by

no test coverage detected