MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / SetFocusID

Method SetFocusID

KBotExt/imgui/imgui.cpp:10800–10826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10798}
10799
10800void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window)
10801{
10802 ImGuiContext& g = *GImGui;
10803 IM_ASSERT(id != 0);
10804
10805 if (g.NavWindow != window)
10806 SetNavWindow(window);
10807
10808 // Assume that SetFocusID() is called in the context where its window->DC.NavLayerCurrent and g.CurrentFocusScopeId are valid.
10809 // Note that window may be != g.CurrentWindow (e.g. SetFocusID call in InputTextEx for multi-line text)
10810 const ImGuiNavLayer nav_layer = window->DC.NavLayerCurrent;
10811 g.NavId = id;
10812 g.NavLayer = nav_layer;
10813 g.NavFocusScopeId = g.CurrentFocusScopeId;
10814 window->NavLastIds[nav_layer] = id;
10815 if (g.LastItemData.ID == id)
10816 window->NavRectRel[nav_layer] = WindowRectAbsToRel(window, g.LastItemData.NavRect);
10817
10818 if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad)
10819 g.NavDisableMouseHover = true;
10820 else
10821 g.NavDisableHighlight = true;
10822
10823 // Clear preferred scoring position (NavMoveRequestApplyResult() will tend to restore it)
10824 NavClearPreferredPosForAxis(ImGuiAxis_X);
10825 NavClearPreferredPosForAxis(ImGuiAxis_Y);
10826}
10827
10828static ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy)
10829{

Callers

nothing calls this directly

Calls 1

WindowRectAbsToRelFunction · 0.85

Tested by

no test coverage detected