// FIXME: Allow to reopen existing, would need to a/ read DC.LastItemHoveredRect instead of DC.LastItemHoveredAndUsable and b/ add parameter to API (more tricky)
// This is a helper to handle the most simple case of associating one named popup to one given widget.
// 1. If you have many possible popups (for different "instances" of a same widget, or for wholly different widgets), you may be better off handling
// this yourself so you can store data relative to the widget that opened the popup instead of choosing different popup identifiers.
// 2. If you want right-clicking on the same item to reopen the popup at new location, use the same code replacing IsItemHovered() with IsItemHoveredRect().
// Because: hovering an item in a window below the popup won't normally trigger is hovering behavior/coloring. The pattern of ignoring the fact that
// the item isn't interactable (because it is blocked by the active popup) may useful in some situation when e.g. large canvas as one item, content of menu
IMGUI_APIvoidOpenPopup(constchar*str_id);// mark popup as open. popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
IMGUI_APIboolBeginPopup(constchar*str_id);// return true if popup if opened and start outputting to it. only call EndPopup() if BeginPopup() returned true!
IMGUI_APIboolBeginPopupModal(constchar*name,bool*p_opened=NULL,ImGuiWindowFlagsextra_flags=0);// modal dialog (can't close them by clicking outside)
IMGUI_APIboolBeginPopupContextItem(constchar*str_id,intmouse_button=1);// helper to open and begin popup when clicked on last item
IMGUI_APIboolBeginPopupContextWindow(boolalso_over_items=true,constchar*str_id=NULL,intmouse_button=1);// helper to open and begin popup when clicked on current window
IMGUI_APIboolBeginPopupContextVoid(constchar*str_id=NULL,intmouse_button=1);// helper to open and begin popup when clicked in void (no window)
IMGUI_APIboolBeginPopupContextItem(constchar*str_id,intmouse_button=1);// helper to open and begin popup when clicked on last item. read comments in .cpp!
IMGUI_APIboolBeginPopupContextWindow(boolalso_over_items=true,constchar*str_id=NULL,intmouse_button=1);// helper to open and begin popup when clicked on current window.
IMGUI_APIboolBeginPopupContextVoid(constchar*str_id=NULL,intmouse_button=1);// helper to open and begin popup when clicked in void (no window).
IMGUI_APIvoidEndPopup();
IMGUI_APIvoidCloseCurrentPopup();// close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.
@ -368,7 +368,7 @@ namespace ImGui
// Utilities
IMGUI_APIboolIsItemHovered();// was the last item hovered by mouse?
IMGUI_APIboolIsItemHoveredRect();// was the last item hovered by mouse? even if another item is active while we are hovering this
IMGUI_APIboolIsItemHoveredRect();// was the last item hovered by mouse? even if another item is active or window is blocked by popup while we are hovering this
IMGUI_APIboolIsItemActive();// was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
IMGUI_APIboolIsItemVisible();// was the last item visible? (aka not out of sight due to clipping/scrolling.)