Added BeginPopupContextVoid() helper for completeness (#126)

This commit is contained in:
ocornut
2015-05-27 23:28:53 +01:00
parent 235cca4f97
commit dcc7df2b21
2 changed files with 11 additions and 2 deletions

View File

@ -3185,13 +3185,21 @@ bool ImGui::BeginPopupContextItem(const char* str_id, int button)
bool ImGui::BeginPopupContextWindow(bool in_empty_space_only, const char* str_id, int button)
{
if (str_id == NULL) str_id = "window_context_menu";
if (!str_id) str_id = "window_context_menu";
if (ImGui::IsMouseHoveringWindow() && ImGui::IsMouseClicked(button))
if (!in_empty_space_only || !ImGui::IsAnyItemHovered())
ImGui::OpenPopup(str_id);
return ImGui::BeginPopup(str_id);
}
bool ImGui::BeginPopupContextVoid(const char* str_id, int button)
{
if (!str_id) str_id = "void_context_menu";
if (!ImGui::IsMouseHoveringAnyWindow() && ImGui::IsMouseClicked(button))
ImGui::OpenPopup(str_id);
return ImGui::BeginPopup(str_id);
}
bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
{
ImGuiState& g = *GImGui;