mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-24 07:40:22 +01:00
Reluctantly exposed GetActiveID(), GetHoveredID() in imgui_internal because the demo code will need it.
This commit is contained in:
parent
53780a4fcc
commit
c42baf392a
12
imgui.cpp
12
imgui.cpp
@ -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;
|
||||
|
@ -865,9 +865,11 @@ namespace ImGui
|
||||
IMGUI_API void EndFrame(); // Ends the ImGui frame. Automatically called by Render()! you most likely don't need to ever call that yourself directly. If you don't need to render you can call EndFrame() but you'll have wasted CPU already. If you don't need to render, don't create any windows instead!
|
||||
|
||||
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);
|
||||
IMGUI_API ImGuiID GetActiveID();
|
||||
IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow* window);
|
||||
IMGUI_API void ClearActiveID();
|
||||
IMGUI_API void SetHoveredID(ImGuiID id);
|
||||
IMGUI_API ImGuiID GetHoveredID();
|
||||
IMGUI_API void KeepAliveID(ImGuiID id);
|
||||
|
||||
IMGUI_API void ItemSize(const ImVec2& size, float text_offset_y = 0.0f);
|
||||
|
Loading…
Reference in New Issue
Block a user