// 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)
{intn=window->IDStack.Size;if(write)*p=(short)n;elseIM_ASSERT(*p==n&&"PushID/PopID or TreeNode/TreePop Mismatch!");p++;}// Too few or too many PopID()/TreePop()
{intn=window->DC.GroupStack.Size;if(write)*p=(short)n;elseIM_ASSERT(*p==n&&"BeginGroup/EndGroup Mismatch!");p++;}// Too few or too many EndGroup()
// NOT checking: DC.ItemWidth, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
{IM_ASSERT(window->IDStack.Size==1&&"PushID/PopID or TreeNode/TreePop Mismatch!");}// Too few or too many PopID()/TreePop();
// Global stacks
// 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.
{intn=g.BeginPopupStack.Size;if(write)*p=(short)n;elseIM_ASSERT(*p==n&&"BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch!");p++;}// Too few or too many EndMenu()/EndPopup()
{intn=g.ColorModifiers.Size;if(write)*p=(short)n;elseIM_ASSERT(*p>=n&&"PushStyleColor/PopStyleColor Mismatch!");p++;}// Too few or too many PopStyleColor()
{intn=g.StyleModifiers.Size;if(write)*p=(short)n;elseIM_ASSERT(*p>=n&&"PushStyleVar/PopStyleVar Mismatch!");p++;}// Too few or too many PopStyleVar()
{intn=g.FontStack.Size;if(write)*p=(short)n;elseIM_ASSERT(*p>=n&&"PushFont/PopFont Mismatch!");p++;}// Too few or too many PopFont()
{intn=g.GroupStack.Size;if(begin)*p=(short)n;elseIM_ASSERT(*p==n&&"BeginGroup/EndGroup Mismatch!");p++;}// Too few or too many EndGroup()
{intn=g.BeginPopupStack.Size;if(begin)*p=(short)n;elseIM_ASSERT(*p==n&&"BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch!");p++;}// Too few or too many EndMenu()/EndPopup()
{intn=g.ColorModifiers.Size;if(begin)*p=(short)n;elseIM_ASSERT(*p>=n&&"PushStyleColor/PopStyleColor Mismatch!");p++;}// Too few or too many PopStyleColor()
{intn=g.StyleModifiers.Size;if(begin)*p=(short)n;elseIM_ASSERT(*p>=n&&"PushStyleVar/PopStyleVar Mismatch!");p++;}// Too few or too many PopStyleVar()
{intn=g.FontStack.Size;if(begin)*p=(short)n;elseIM_ASSERT(*p>=n&&"PushFont/PopFont Mismatch!");p++;}// Too few or too many PopFont()
IMGUI_APIvoidPushAllowKeyboardFocus(boolallow_keyboard_focus);// allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
IMGUI_APIvoidPopAllowKeyboardFocus();
IMGUI_APIvoidPushButtonRepeat(boolrepeat);// in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.
IMGUI_APIvoidPopButtonRepeat();
IMGUI_APIconstImVec4&GetStyleColorVec4(ImGuiColidx);// retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwise use GetColorU32() to get style color with style alpha baked in.
IMGUI_APIImFont*GetFont();// get current font
IMGUI_APIfloatGetFontSize();// get current font size (= height in pixels) of current font with current scale applied
@ -373,10 +377,6 @@ namespace ImGui
IMGUI_APIfloatCalcItemWidth();// width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most 'Item' functions.
IMGUI_APIvoidPushTextWrapPos(floatwrap_local_pos_x=0.0f);// push word-wrapping position for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space
IMGUI_APIvoidPopTextWrapPos();
IMGUI_APIvoidPushAllowKeyboardFocus(boolallow_keyboard_focus);// allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
IMGUI_APIvoidPopAllowKeyboardFocus();
IMGUI_APIvoidPushButtonRepeat(boolrepeat);// in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.
IMGUI_APIvoidPopButtonRepeat();
// Cursor / Layout
// - By "cursor" we mean the current output position.
// 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.
window->DC.MenuBarOffset.x=window->DC.CursorPos.x-window->MenuBarRect().Min.x;// Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos.