Reluctantly exposed GetActiveID(), GetHoveredID() in imgui_internal because the demo code will need it.

This commit is contained in:
omar
2017-10-13 16:48:14 +02:00
parent 53780a4fcc
commit c42baf392a
2 changed files with 14 additions and 0 deletions

View File

@ -1974,6 +1974,12 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
}
}
ImGuiID ImGui::GetActiveID()
{
ImGuiContext& g = *GImGui;
return g.ActiveId;
}
// Assume that SetFocusID() is called in the context where its NavLayer is the current window nav layer.
void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window)
{
@ -2000,6 +2006,12 @@ void ImGui::SetHoveredID(ImGuiID id)
g.HoveredIdAllowOverlap = false;
}
ImGuiID ImGui::GetHoveredID()
{
ImGuiContext& g = *GImGui;
return g.HoveredId ? g.HoveredId : g.HoveredIdPreviousFrame;
}
void ImGui::KeepAliveID(ImGuiID id)
{
ImGuiContext& g = *GImGui;