Focus = move navigation cursor, set scrolling, set focus window.
| 7794 | |
| 7795 | // Focus = move navigation cursor, set scrolling, set focus window. |
| 7796 | void ImGui::FocusItem() |
| 7797 | { |
| 7798 | ImGuiContext& g = *GImGui; |
| 7799 | ImGuiWindow* window = g.CurrentWindow; |
| 7800 | IMGUI_DEBUG_LOG_FOCUS("FocusItem(0x%08x) in window \"%s\"\n", g.LastItemData.ID, window->Name); |
| 7801 | if (g.DragDropActive || g.MovingWindow != NULL) // FIXME: Opt-in flags for this? |
| 7802 | { |
| 7803 | IMGUI_DEBUG_LOG_FOCUS("FocusItem() ignored while DragDropActive!\n"); |
| 7804 | return; |
| 7805 | } |
| 7806 | |
| 7807 | ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_FocusApi | ImGuiNavMoveFlags_NoSetNavHighlight | ImGuiNavMoveFlags_NoSelect; |
| 7808 | ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY; |
| 7809 | SetNavWindow(window); |
| 7810 | NavMoveRequestSubmit(ImGuiDir_None, ImGuiDir_Up, move_flags, scroll_flags); |
| 7811 | NavMoveRequestResolveWithLastItem(&g.NavMoveResultLocal); |
| 7812 | } |
| 7813 | |
| 7814 | void ImGui::ActivateItemByID(ImGuiID id) |
| 7815 | { |
nothing calls this directly
no outgoing calls
no test coverage detected