Internals: Nav: Added ImGuiNavLayer_ to clarify semantic of previously integer NavLayer values, and not pretend that increment/decrement operators on them super flexible. + Storage tweaks.
// NOT checking: DC.ItemWidth, DC.AllowKeyboardFocus, DC.ButtonRepeat, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
// NOT checking: DC.ItemWidth, DC.AllowKeyboardFocus, DC.ButtonRepeat, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
ImGuiContext&g=*GImGui;
ImGuiContext&g=*GImGui;
int*p_backup=&window->DC.StackSizesBackup[0];
short*p_backup=&window->DC.StackSizesBackup[0];
{intcurrent=window->IDStack.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup==current&&"PushID/PopID or TreeNode/TreePop Mismatch!");p_backup++;}// Too few or too many PopID()/TreePop()
{intcurrent=window->IDStack.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup==current&&"PushID/PopID or TreeNode/TreePop Mismatch!");p_backup++;}// Too few or too many PopID()/TreePop()
{intcurrent=window->DC.GroupStack.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup==current&&"BeginGroup/EndGroup Mismatch!");p_backup++;}// Too few or too many EndGroup()
{intcurrent=window->DC.GroupStack.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup==current&&"BeginGroup/EndGroup Mismatch!");p_backup++;}// Too few or too many EndGroup()
{intcurrent=g.CurrentPopupStack.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup==current&&"BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch");p_backup++;}// Too few or too many EndMenu()/EndPopup()
{intcurrent=g.CurrentPopupStack.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup==current&&"BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch");p_backup++;}// Too few or too many EndMenu()/EndPopup()
// For color, style and font stacks there is an incentive to use Push/Begin/Pop/.../End patterns, so we relax our checks a little to allow them.
// For color, style and font stacks there is an incentive to use Push/Begin/Pop/.../End patterns, so we relax our checks a little to allow them.
{intcurrent=g.ColorModifiers.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup>=current&&"PushStyleColor/PopStyleColor Mismatch!");p_backup++;}// Too few or too many PopStyleColor()
{intcurrent=g.ColorModifiers.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup>=current&&"PushStyleColor/PopStyleColor Mismatch!");p_backup++;}// Too few or too many PopStyleColor()
{intcurrent=g.StyleModifiers.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup>=current&&"PushStyleVar/PopStyleVar Mismatch!");p_backup++;}// Too few or too many PopStyleVar()
{intcurrent=g.StyleModifiers.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup>=current&&"PushStyleVar/PopStyleVar Mismatch!");p_backup++;}// Too few or too many PopStyleVar()
{intcurrent=g.FontStack.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup>=current&&"PushFont/PopFont Mismatch!");p_backup++;}// Too few or too many PopFont()
{intcurrent=g.FontStack.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup>=current&&"PushFont/PopFont Mismatch!");p_backup++;}// Too few or too many PopFont()
// 1D vector (this odd construct is used to facilitate the transition between 1D and 2D and maintenance of some patches)
// 1D vector (this odd construct is used to facilitate the transition between 1D and 2D, and the maintenance of some branches/patches)
structImVec1
structImVec1
{
{
floatx;
floatx;
ImVec1(){x=0.0f;}
ImVec1(){x=0.0f;}
ImVec1(float_x){x=_x;}
ImVec1(float_x){x=_x;}
};
};
enumImGuiButtonFlags_
enumImGuiButtonFlags_
@ -392,6 +392,13 @@ enum ImGuiNavForward
ImGuiNavForward_ForwardActive
ImGuiNavForward_ForwardActive
};
};
enumImGuiNavLayer
{
ImGuiNavLayer_Main=0,// Main scrolling layer
ImGuiNavLayer_Menu=1,// Menu layer (access with Alt/ImGuiNavInput_Menu)
ImGuiNavLayer_COUNT
};
enumImGuiPopupPositionPolicy
enumImGuiPopupPositionPolicy
{
{
ImGuiPopupPositionPolicy_Default,
ImGuiPopupPositionPolicy_Default,
@ -741,7 +748,7 @@ struct ImGuiContext
floatNavWindowingTimer;
floatNavWindowingTimer;
floatNavWindowingHighlightAlpha;
floatNavWindowingHighlightAlpha;
boolNavWindowingToggleLayer;
boolNavWindowingToggleLayer;
intNavLayer;// Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
ImGuiNavLayerNavLayer;// Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
intNavIdTabCounter;// == NavWindow->DC.FocusIdxTabCounter at time of NavId processing
intNavIdTabCounter;// == NavWindow->DC.FocusIdxTabCounter at time of NavId processing
boolNavIdIsAlive;// Nav widget has been seen this frame ~~ NavRefRectRel is valid
boolNavIdIsAlive;// Nav widget has been seen this frame ~~ NavRefRectRel is valid
boolNavMousePosDirty;// When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
boolNavMousePosDirty;// When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
ImRectLastItemDisplayRect;// End-user display rect (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
ImRectLastItemDisplayRect;// End-user display rect (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
boolNavHideHighlightOneFrame;
ImGuiNavLayerNavLayerCurrent;// Current layer, 0..31 (we currently only use 0..1)
boolNavHasScroll;// Set when scrolling can be used (ScrollMax > 0.0f)
intNavLayerCurrent;// Current layer, 0..31 (we currently only use 0..1)
intNavLayerCurrentMask;// = (1 << NavLayerCurrent) used by ItemAdd prior to clipping.
intNavLayerCurrentMask;// = (1 << NavLayerCurrent) used by ItemAdd prior to clipping.
intNavLayerActiveMask;// Which layer have been written to (result from previous frame)
intNavLayerActiveMask;// Which layer have been written to (result from previous frame)
intNavLayerActiveMaskNext;// Which layer have been written to (buffer for current frame)
intNavLayerActiveMaskNext;// Which layer have been written to (buffer for current frame)
boolNavHideHighlightOneFrame;
boolNavHasScroll;// Set when scrolling can be used (ScrollMax > 0.0f)
boolMenuBarAppending;// FIXME: Remove this
boolMenuBarAppending;// FIXME: Remove this
ImVec2MenuBarOffset;// MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
ImVec2MenuBarOffset;// MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
boolAppearing;// Set during the frame where the window is appearing (or re-appearing)
boolAppearing;// Set during the frame where the window is appearing (or re-appearing)
boolHidden;// Do not display (== (HiddenFramesForResize > 0) ||
boolHidden;// Do not display (== (HiddenFramesForResize > 0) ||
boolHasCloseButton;// Set when the window has a close button (p_open != NULL)
boolHasCloseButton;// Set when the window has a close button (p_open != NULL)
int BeginCount;// Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
shortBeginCount;// Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
int BeginOrderWithinParent;// Order within immediate parent window, if we are a child window. Otherwise 0.
shortBeginOrderWithinParent;// Order within immediate parent window, if we are a child window. Otherwise 0.
int BeginOrderWithinContext;// Order within entire imgui context. This is mostly used for debugging submission order related issues.
shortBeginOrderWithinContext;// Order within entire imgui context. This is mostly used for debugging submission order related issues.
ImGuiIDPopupId;// ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
ImGuiIDPopupId;// ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
intAutoFitFramesX,AutoFitFramesY;
intAutoFitFramesX,AutoFitFramesY;
boolAutoFitOnlyGrows;
boolAutoFitOnlyGrows;
@ -1090,8 +1097,8 @@ struct IMGUI_API ImGuiWindow
ImGuiWindow*RootWindowForNav;// Point to ourself or first ancestor which doesn't have the NavFlattened flag.
ImGuiWindow*RootWindowForNav;// Point to ourself or first ancestor which doesn't have the NavFlattened flag.
ImGuiWindow*NavLastChildNavWindow;// When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
ImGuiWindow*NavLastChildNavWindow;// When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
ImGuiIDNavLastIds[2];// Last known NavId for this window, per layer (0/1)
ImGuiIDNavLastIds[ImGuiNavLayer_COUNT];// Last known NavId for this window, per layer (0/1)
ImRectNavRectRel[2];// Reference rectangle, in window relative space
ImRectNavRectRel[ImGuiNavLayer_COUNT];// Reference rectangle, in window relative space
// Navigation / Focus
// Navigation / Focus
// FIXME-NAV: Merge all this with the new Nav system, at least the request variables should be moved to ImGuiContext
// FIXME-NAV: Merge all this with the new Nav system, at least the request variables should be moved to ImGuiContext