IsWindowHovered(): split ImGuiHoveredFlags_FlattenChild into separate ChildWindows and RootWindow flags. Allowing more combination and a better symetry with IsWindowFocused() flags. (#1382)
-2017/10/20(1.52)-markedIsItemHoveredRect()/IsMouseHoveringWindow()asobsolete,infavorofusingthenewlyintroducedflagsforIsItemHovered()andIsWindowHovered().Seehttps://github.com/ocornut/imgui/issues/1382 for details.
// Test for bounding box overlap, as updated as ItemAdd()
if(!window->DC.LastItemRectHoveredRect)
returnfalse;
IM_ASSERT((flags&ImGuiHoveredFlags_FlattenChilds)==0);// Flags not supported by this function
IM_ASSERT((flags&(ImGuiHoveredFlags_RootWindow|ImGuiHoveredFlags_ChildWindows))==0);// Flags not supported by this function
// Test if we are hovering the right window (our window could be behind another window)
// [2017/10/16] Reverted commit 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but this leaves us unable to use IsItemHovered() after EndChild() itself.
//ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 1, // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet.
ImGuiHoveredFlags_AllowWhenBlockedByActiveItem=1<<2,// Return true even if an active item is blocking access to this item/window
ImGuiHoveredFlags_AllowWhenOverlapped=1<<3,// Return true even if the position is overlapped by another window
ImGuiHoveredFlags_FlattenChilds=1<<4,// Treat all child windows as the same window (for IsWindowHovered())
ImGuiHoveredFlags_ChildWindows=1<<4,// IsWindowHovered() only: Return true if any children of the window is hovered
ImGuiHoveredFlags_RootWindow=1<<5,// IsWindowHovered() only: Test from root window (top most parent of the current hierarchy)
staticinlinevoidSetNextWindowContentWidth(floatwidth){ImGui::SetNextWindowContentSize(ImVec2(width,0.0f));}// OBSOLETE 1.53+ (nb: original version preserved last Y value set by SetNextWindowContentSize())
staticinlineboolIsRootWindowOrAnyChildHovered(ImGuiHoveredFlagsflags=0){returnIsItemHovered(flags|ImGuiHoveredFlags_FlattenChilds);}// OBSOLETE 1.53+ use flags directly
staticinlinevoidSetNextWindowContentWidth(floatwidth){SetNextWindowContentSize(ImVec2(width,0.0f));}// OBSOLETE 1.53+ (nb: original version preserved last Y value set by SetNextWindowContentSize())
staticinlineboolIsRootWindowOrAnyChildHovered(ImGuiHoveredFlagsflags=0){returnIsItemHovered(flags|ImGuiHoveredFlags_RootWindow|ImGuiHoveredFlags_ChildWindows);}// OBSOLETE 1.53+ use flags directly
boolBegin(constchar*name,bool*p_open,constImVec2&size_on_first_use,floatbg_alpha_override=-1.0f,ImGuiWindowFlagsflags=0);// OBSOLETE 1.52+. use SetNextWindowSize() instead if you want to set a window size.
// Testing IsItemHovered() function (because BulletText is an item itself and that would affect the output of IsItemHovered, we pass all lines in a single items to shorten the code)