Added IsItemActivated() as an extension to the IsItemDeactivated/IsItemDeactivatedAfterEdit functions which are useful to implement variety of undo patterns. (#820, #956, #1875)

This commit is contained in:
omar
2019-02-06 11:52:42 +01:00
parent c59611a3b3
commit e3dd95d335
4 changed files with 20 additions and 2 deletions

View File

@ -4215,6 +4215,18 @@ bool ImGui::IsItemActive()
return false;
}
bool ImGui::IsItemActivated()
{
ImGuiContext& g = *GImGui;
if (g.ActiveId)
{
ImGuiWindow* window = g.CurrentWindow;
if (g.ActiveId == window->DC.LastItemId && g.ActiveIdPreviousFrame != window->DC.LastItemId)
return true;
}
return false;
}
bool ImGui::IsItemDeactivated()
{
ImGuiContext& g = *GImGui;