Internals: folded ImGuiItemAddFlags into ImGuiItemFlags. ImGuiItemAddFlags_Focusable > ImGuiItemFlags_Inputable. One step in the big nav/tab/focus rework.
// Tab stop handling (previously was using internal ItemFocusable() api)
// FIXME-NAV: We would now want to move this above the clipping test, but this would require being able to scroll and currently this would mean an extra frame. (#4079, #343)
if(flags &ImGuiItemAddFlags_Focusable)
ItemFocusable(window,id);
// [WIP] Tab stop handling (previously was using internal FocusableItemRegister() api)
// FIXME-NAV: We would now want to move this before the clipping test, but this would require being able to scroll and currently this would mean an extra frame. (#4079, #343)
if(extra_flags &ImGuiItemFlags_Inputable)
ItemInputable(window,id);
// We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them)
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
@ -144,7 +144,6 @@ struct ImGuiWindowSettings; // Storage for a window .ini settings (we ke
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
typedefintImGuiLayoutType;// -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical
typedefintImGuiItemFlags;// -> enum ImGuiItemFlags_ // Flags: for PushItemFlag()
typedefintImGuiItemAddFlags;// -> enum ImGuiItemAddFlags_ // Flags: for ItemAdd()
typedefintImGuiItemStatusFlags;// -> enum ImGuiItemStatusFlags_ // Flags: for DC.LastItemStatusFlags
typedefintImGuiOldColumnFlags;// -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns()
typedefintImGuiNavHighlightFlags;// -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
@ -742,15 +741,8 @@ enum ImGuiItemFlags_
ImGuiItemFlags_NoNavDefaultFocus=1<<4,// false // Disable item being a candidate for default focus (e.g. used by title bar items)
ImGuiItemFlags_SelectableDontClosePopup=1<<5,// false // Disable MenuItem/Selectable() automatically closing their popup window
ImGuiItemFlags_MixedValue=1<<6,// false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
ImGuiItemFlags_ReadOnly=1<<7// false // [ALPHA] Allow hovering interactions but underlying value is not changed.
};
// Flags for ItemAdd()
// FIXME-NAV: _Focusable is _ALMOST_ what you would expect to be called '_TabStop' but because SetKeyboardFocusHere() works on items with no TabStop we distinguish Focusable from TabStop.
enumImGuiItemAddFlags_
{
ImGuiItemAddFlags_None=0,
ImGuiItemAddFlags_Focusable=1<<0// FIXME-NAV: In current/legacy scheme, Focusable+TabStop support are opt-in by widgets. We will transition it toward being opt-out, so this flag is expected to eventually disappear.
ImGuiItemFlags_ReadOnly=1<<7,// false // [ALPHA] Allow hovering interactions but underlying value is not changed.
ImGuiItemFlags_Inputable=1<<8// false // [WIP] Auto-activate item when focused. Currently only used and supported by a few items before it becomes a generic feature.
intCurrentTableIdx;// Current table index (into g.Tables)
ImGuiLayoutTypeLayoutType;
ImGuiLayoutTypeParentLayoutType;// Layout type of parent window at the time of Begin()
intFocusCounterRegular;// (Legacy Focus/Tabbing system) Sequential counter, start at -1 and increase as assigned via ImGuiItemAddFlags_Focusable (FIXME-NAV: Needs redesign)
intFocusCounterRegular;// (Legacy Focus/Tabbing system) Sequential counter, start at -1 and increase when ImGuiItemFlags_Inputable (FIXME-NAV: Needs redesign)
intFocusCounterTabStop;// (Legacy Focus/Tabbing system) Same, but only count widgets which you can Tab through.
// If you have old/custom copy-and-pasted widgets that used FocusableItemRegister():
// (Old) IMGUI_VERSION_NUM < 18209: using 'ItemAdd(....)' and 'bool focused = FocusableItemRegister(...)'
// (New) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
// (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
// (New) IMGUI_VERSION_NUM >= 18411: using 'ItemAdd(..., ImGuiItemAddFlags_Inputable)' and 'bool focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
// Widget code are simplified as there's no need to call FocusableItemUnregister() while managing the transition from regular widget to TempInputText()
inlineboolFocusableItemRegister(ImGuiWindow*window,ImGuiIDid){IM_ASSERT(0);IM_UNUSED(window);IM_UNUSED(id);returnfalse;}// -> pass ImGuiItemAddFlags_Focusable flag to ItemAdd()
inlineboolFocusableItemRegister(ImGuiWindow*window,ImGuiIDid){IM_ASSERT(0);IM_UNUSED(window);IM_UNUSED(id);returnfalse;}// -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd()