| 10798 | } |
| 10799 | |
| 10800 | void 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 | |
| 10828 | static ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy) |
| 10829 | { |
nothing calls this directly
no test coverage detected