| 10322 | } |
| 10323 | |
| 10324 | void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window) |
| 10325 | { |
| 10326 | ImGuiContext& g = *GImGui; |
| 10327 | IM_ASSERT(id != 0); |
| 10328 | |
| 10329 | if (g.NavWindow != window) |
| 10330 | SetNavWindow(window); |
| 10331 | |
| 10332 | // Assume that SetFocusID() is called in the context where its window->DC.NavLayerCurrent and g.CurrentFocusScopeId are valid. |
| 10333 | // Note that window may be != g.CurrentWindow (e.g. SetFocusID call in InputTextEx for multi-line text) |
| 10334 | const ImGuiNavLayer nav_layer = window->DC.NavLayerCurrent; |
| 10335 | g.NavId = id; |
| 10336 | g.NavLayer = nav_layer; |
| 10337 | g.NavFocusScopeId = g.CurrentFocusScopeId; |
| 10338 | window->NavLastIds[nav_layer] = id; |
| 10339 | if (g.LastItemData.ID == id) |
| 10340 | window->NavRectRel[nav_layer] = WindowRectAbsToRel(window, g.LastItemData.NavRect); |
| 10341 | |
| 10342 | if (g.ActiveIdSource == ImGuiInputSource_Nav) |
| 10343 | g.NavDisableMouseHover = true; |
| 10344 | else |
| 10345 | g.NavDisableHighlight = true; |
| 10346 | } |
| 10347 | |
| 10348 | ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy) |
| 10349 | { |
nothing calls this directly
no test coverage detected