BeginPopup() API had to be changed! :( Proper support for stacked popups, leading into menus (wip #126)

This commit is contained in:
ocornut
2015-05-11 15:57:02 +01:00
parent d23709ce35
commit fcd08ed8d4
2 changed files with 120 additions and 56 deletions

View File

@ -226,8 +226,10 @@ namespace ImGui
IMGUI_API void EndTooltip();
// Popup
IMGUI_API void BeginPopup(bool* p_opened);
IMGUI_API void OpenPopup(const char* str_id); // mark popup as open. will close when user click outside, or activate menu items, or CloseCurrentPopup() is called within a BeginPopup/EndPopup block.
IMGUI_API bool BeginPopup(const char* str_id); // return true if popup if opened and start outputting to it. only call EndPopup() if BeginPopup() returned true!
IMGUI_API void EndPopup();
IMGUI_API void CloseCurrentPopup();
// Layout
IMGUI_API void BeginGroup();
@ -358,7 +360,7 @@ namespace ImGui
IMGUI_API void ListBoxFooter(); // terminate the scrolling region
// Widgets: Menus
// FIXME-WIP: v1.39 in development
// FIXME-WIP: v1.39 in development, API may change
IMGUI_API bool MenuItem(const char* label, const char* shortcut = NULL, bool selected = NULL); // bool enabled = true
IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected); // bool enabled = true