Attention! BeginPopup() adds default flags which BeginPopupEx()!
| 10713 | |
| 10714 | // Attention! BeginPopup() adds default flags which BeginPopupEx()! |
| 10715 | bool 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 | |
| 10738 | bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags) |
| 10739 | { |
nothing calls this directly
no test coverage detected