mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
Added IsItemEdited() to query if the last item modified its value (or was pressed). This is equivalent to the bool returned by most widgets. It is useful in some situation e.g. using InputText() with ImGuiInputTextFlags_EnterReturnsTrue. (#2034)
This commit is contained in:
@ -1275,7 +1275,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Active, Focused, Hovered & Focused Tests"))
|
||||
if (ImGui::TreeNode("Active, Focused and Hovered Tests"))
|
||||
{
|
||||
// Display the value of IsItemHovered() and other common item state functions. Note that the flags can be combined.
|
||||
// (because BulletText is an item itself and that would affect the output of IsItemHovered() we pass all state in a single call to simplify the code).
|
||||
@ -1304,6 +1304,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
"IsItemHovered(_AllowWhenOverlapped) = %d\n"
|
||||
"IsItemHovered(_RectOnly) = %d\n"
|
||||
"IsItemActive() = %d\n"
|
||||
"IsItemEdited() = %d\n"
|
||||
"IsItemDeactivated() = %d\n"
|
||||
"IsItemDeactivatedAfterChange() = %d\n"
|
||||
"IsItemVisible() = %d\n",
|
||||
@ -1315,6 +1316,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlapped),
|
||||
ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly),
|
||||
ImGui::IsItemActive(),
|
||||
ImGui::IsItemEdited(),
|
||||
ImGui::IsItemDeactivated(),
|
||||
ImGui::IsItemDeactivatedAfterChange(),
|
||||
ImGui::IsItemVisible()
|
||||
|
Reference in New Issue
Block a user