IsWindowHovered(): Added ImGuiHoveredFlags_FlattenChilds flag. Made IsRootWindowOrAnyChildHovered() obsolete in favor of IsWindowHovered( ImGuiHoveredFlags_FlattenChilds) (#1382, #1404)

This commit is contained in:
omar
2017-11-02 16:44:24 +01:00
parent 803ac3a5c6
commit ff4d4ca651
3 changed files with 20 additions and 21 deletions

View File

@ -1778,14 +1778,16 @@ void ImGui::ShowTestWindow(bool* p_open)
if (ImGui::TreeNode("Hovering"))
{
// Testing IsWindowHovered() function
// Testing IsWindowHovered() function with its various flags (note that the flags can be combined)
ImGui::BulletText(
"IsWindowHovered() = %d\n"
"IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n"
"IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n",
"IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n"
"IsWindowHovered(_FlattenChilds) = %d\n",
ImGui::IsWindowHovered(),
ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup),
ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem));
ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
ImGui::IsWindowHovered(ImGuiHoveredFlags_FlattenChilds));
// 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)
ImGui::Button("ITEM");