Added IsItemHoveredOrFocused() (provisional name), better handling of popup/tooltip positioning when using mouse+nav (#323)

This commit is contained in:
ocornut
2016-08-21 13:25:40 +02:00
parent ea2425ad9a
commit 87eb749cbc
2 changed files with 13 additions and 6 deletions

View File

@ -399,6 +399,7 @@ namespace ImGui
IMGUI_API bool IsItemHoveredRect(); // is the last item hovered by mouse? even if another item is active or window is blocked by popup while we are hovering this
IMGUI_API bool IsItemActive(); // is the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
IMGUI_API bool IsItemFocused(); // is the last item focused for keyboard/gamepad navigation?
IMGUI_API bool IsItemHoveredOrFocused(); // select best suitable between IsItemHovered() when mouse is used and IsItemFocused() when navigation is used. useful for tooltips that needs to work with both controls.
IMGUI_API bool IsItemClicked(int mouse_button = 0); // is the last item clicked? (e.g. button/node just clicked on)
IMGUI_API bool IsItemVisible(); // is the last item visible? (aka not out of sight due to clipping/scrolling.)
IMGUI_API bool IsAnyItemHovered();