(api breaking) changed parameter order for BeginPopupContextWindow(), note that most uses relied on default parameters completely.

This commit is contained in:
omar 2017-08-16 14:24:41 +08:00
parent 638d77c682
commit 5ea1865fdb
2 changed files with 7 additions and 4 deletions

View File

@ -204,6 +204,7 @@
Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
Also read releases logs https://github.com/ocornut/imgui/releases for more details.
- 2017/08/15 (1.51) - changed parameter order for BeginPopupContextWindow(), note that most uses relied on default parameters completely.
- 2017/08/13 (1.51) - renamed ImGuiCol_Columns_*** to ImGuiCol_Separator_***
- 2017/08/11 (1.51) - renamed ImGuiSetCond_*** types and flags to ImGuiCond_***. Kept redirection enums (will obsolete).
- 2017/08/09 (1.51) - removed ValueColor() helpers, they are equivalent to calling Text(label) + SameLine() + ColorButton().
@ -3598,9 +3599,10 @@ bool ImGui::BeginPopupContextItem(const char* str_id, int mouse_button)
return BeginPopup(str_id);
}
bool ImGui::BeginPopupContextWindow(bool also_over_items, const char* str_id, int mouse_button)
bool ImGui::BeginPopupContextWindow(const char* str_id, int mouse_button, bool also_over_items)
{
if (!str_id) str_id = "window_context_menu";
if (!str_id)
str_id = "window_context_menu";
if (IsMouseHoveringWindow() && IsMouseClicked(mouse_button))
if (also_over_items || !IsAnyItemHovered())
OpenPopupEx(str_id, true);
@ -3609,7 +3611,8 @@ bool ImGui::BeginPopupContextWindow(bool also_over_items, const char* str_id, in
bool ImGui::BeginPopupContextVoid(const char* str_id, int mouse_button)
{
if (!str_id) str_id = "void_context_menu";
if (!str_id)
str_id = "void_context_menu";
if (!IsMouseHoveringAnyWindow() && IsMouseClicked(mouse_button))
OpenPopupEx(str_id, true);
return BeginPopup(str_id);

View File

@ -386,7 +386,7 @@ namespace ImGui
IMGUI_API bool BeginPopup(const char* str_id); // return true if the popup is open, and you can start outputting to it. only call EndPopup() if BeginPopup() returned true!
IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags extra_flags = 0); // modal dialog (block interactions behind the modal window, can't close the modal window by clicking outside)
IMGUI_API bool BeginPopupContextItem(const char* str_id, int mouse_button = 1); // helper to open and begin popup when clicked on last item. read comments in .cpp!
IMGUI_API bool BeginPopupContextWindow(bool also_over_items = true, const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked on current window.
IMGUI_API bool BeginPopupContextWindow(const char* str_id = NULL, int mouse_button = 1, bool also_over_items = true); // helper to open and begin popup when clicked on current window.
IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked in void (no window).
IMGUI_API void EndPopup();
IMGUI_API void CloseCurrentPopup(); // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.