From 4e3c7f1557af3627f3882ab27bbaecd7cc559427 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 24 Nov 2017 16:50:11 +0100 Subject: [PATCH] Nav: Exposed NavInitWindow() in imgui_internal (#787) --- imgui.cpp | 4 ++-- imgui_internal.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 815858f28..535824504 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2528,7 +2528,7 @@ int ImGui::GetFrameCount() } // This needs to be called before we submit any widget (aka in or before Begin) -static void NavInitWindow(ImGuiWindow* window, bool force_reinit) +void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit) { ImGuiContext& g = *GImGui; IM_ASSERT(window == g.NavWindow); @@ -4724,7 +4724,7 @@ static bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b if (/*!(flags & ImGuiWindowFlags_NavFlattened) &&*/ (child_window->DC.NavLayerActiveMask != 0 || child_window->DC.NavHasScroll) && g.NavActivateId == id) { ImGui::FocusWindow(child_window); - NavInitWindow(child_window, false); + ImGui::NavInitWindow(child_window, false); ImGui::SetActiveID(id+1, child_window); // Steal ActiveId with a dummy id so that key-press won't activate child item g.ActiveIdSource = ImGuiInputSource_Nav; } diff --git a/imgui_internal.h b/imgui_internal.h index 5b238a35c..0bae4d9bd 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -914,6 +914,8 @@ namespace ImGui IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags); IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip = true); + IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit); + IMGUI_API int CalcTypematicPressedRepeatAmount(float t, float t_prev, float repeat_delay, float repeat_rate); IMGUI_API void Scrollbar(ImGuiLayoutType direction);