Internal: Tabbing/Focus: Tidying up old code, moved some state to context instead of window. Storing new data will allow us to fix the bug mentioned in #2215 (probably in next commit).
window->FocusIdxTabRequestNext=window->FocusIdxTabCounter+(g.IO.KeyShift?(is_tab_stop?-1:0):+1);// Modulo on index will be applied at the end of frame once we've got the total counter of items.
g.FocusRequestNextCounterTab=window->DC.FocusCounterTab+(g.IO.KeyShift?(is_tab_stop?-1:0):+1);// Modulo on index will be applied at the end of frame once we've got the total counter of items.
// (This code is old and will be redesigned for Nav. In the meanwhile we use g.NavTabRequest as storage but this doesn't need ImGuiConfigFlags_NavEnableKeyboard to work!)
ImGuiNavMoveResultNavMoveResultLocalVisibleSet;// Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
ImGuiNavMoveResultNavMoveResultOther;// Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
// Tabbing system (older than Nav, active when Nav is disabled. Probably needs a redesign)
// Tabbing system (older than Nav, active even if Nav is disabled. FIXME-NAV: This needs a redesign!)
ImGuiWindow*FocusRequestCurrWindow;//
ImGuiWindow*FocusRequestNextWindow;//
intFocusRequestCurrCounterAll;// Any item being requested for focus, stored as an index (we on layout to be stable between the frame pressing TAB and the next frame, semi-ouch)
intFocusRequestCurrCounterTab;// Tab item being requested for focus, stored as an index
intFocusRequestNextCounterAll;// Stored for next frame
ImGuiLayoutTypeParentLayoutType;// Layout type of parent window at the time of Begin()
intFocusCounterAll;// Counter for focus/tabbing system. Start at -1 and increase as assigned via FocusableItemRegister() (FIXME-NAV: Needs redesign)
intFocusCounterTab;// (same, but only count widgets which you can Tab through)
// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
ImGuiIDNavLastIds[ImGuiNavLayer_COUNT];// Last known NavId for this window, per layer (0/1)
ImRectNavRectRel[ImGuiNavLayer_COUNT];// Reference rectangle, in window relative space
// Navigation / Focus
// FIXME-NAV: Merge all this with the new Nav system, at least the request variables should be moved to ImGuiContext
intFocusIdxAllCounter;// Start at -1 and increase as assigned via FocusItemRegister()
intFocusIdxTabCounter;// (same, but only count widgets which you can Tab through)
intFocusIdxAllRequestCurrent;// Item being requested for focus
intFocusIdxTabRequestCurrent;// Tab-able item being requested for focus
intFocusIdxAllRequestNext;// Item being requested for focus, for next update (relies on layout to be stable between the frame pressing TAB and the next frame)