// 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;
short*p_backup=&window->DC.StackSizesBackup[0];
{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=(short)current;elseIM_ASSERT(*p_backup==current&&"BeginGroup/EndGroup Mismatch!");p_backup++;}// Too few or too many EndGroup()
{intcurrent=g.BeginPopupStack.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.
{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=(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=(short)current;elseIM_ASSERT(*p_backup>=current&&"PushFont/PopFont Mismatch!");p_backup++;}// Too few or too many PopFont()
// Ensure that ScrollBar doesn't read last frame's SkipItems
window->SkipItems=false;
// Draw window + handle manual resize
// As we highlight the title bar when want_focus is set, multiple reappearing windows will have have their title bar highlighted on their reappearing frame.
boolwindow_just_activated_by_user=(window->LastFrameActive<current_frame-1);// Not using !WasActive because the implicit "Debug" window would always toggle off->on
// 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()
// 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()
// Keyboard: Press and Release ALT to toggle menu layer
// FIXME: We lack an explicit IO variable for "is the imgui window focused", so compare mouse validity to detect the common case of back-end clearing releases all keys on ALT-TAB
// The Item Picker tool is super useful to visually select an item and break into the call-stack of where it was submitted.
if(ImGui::Button("Item Picker.."))
ImGui::DebugStartItemPicker();
ImGui::SameLine();
MetricsHelpMarker("Will call the IM_DEBUG_BREAK() macro to break in debugger.\nWarning: If you don't have a debugger attached, this will probably crash.");
ImGui::Checkbox("Show windows begin order",&show_windows_begin_order);
ImGui::Checkbox("Show windows rectangles",&show_windows_rects);
boolFrameScopeActive;// Set by NewFrame(), cleared by EndFrame()
boolFrameScopePushedFallbackWindow;// Set by NewFrame(), cleared by EndFrame()
boolFontAtlasOwnedByContext;// Io.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
boolFontAtlasOwnedByContext;// IO.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
ImGuiIOIO;
ImGuiPlatformIOPlatformIO;
ImGuiStyleStyle;
@ -1064,20 +1071,23 @@ struct ImGuiContext
intFrameCountEnded;
intFrameCountPlatformEnded;
intFrameCountRendered;
boolWithinFrameScope;// Set by NewFrame(), cleared by EndFrame()
boolWithinFrameScopeWithImplicitWindow;// Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed
boolWithinEndChild;// Set within EndChild()
// Windows state
ImVector<ImGuiWindow*>Windows;// Windows, sorted in display order, back to front
ImVector<ImGuiWindow*>WindowsFocusOrder;// Windows, sorted in focus order, back to front
ImVector<ImGuiWindow*>WindowsSortBuffer;
ImVector<ImGuiWindow*>CurrentWindowStack;
ImGuiStorageWindowsById;
intWindowsActiveCount;
ImGuiWindow*CurrentWindow;// Being drawn into
ImGuiStorageWindowsById;// Map window's ImGuiID to ImGuiWindow*
intWindowsActiveCount;// Number of unique windows submitted by frame
ImGuiWindow*CurrentWindow;// Window being drawn into
ImGuiWindow*HoveredWindow;// Will catch mouse inputs
ImGuiWindow*HoveredRootWindow;// Will catch mouse inputs (for focus/move only)
ImGuiWindow*HoveredWindowUnderMovingWindow;// Hovered window ignoring MovingWindow. Only set if MovingWindow is set.
ImGuiWindow*MovingWindow;// Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.
ImGuiWindow*WheelingWindow;
ImGuiWindow*WheelingWindow;// Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window.
ImVec2WheelingWindowRefMousePos;
floatWheelingWindowTimer;
@ -1105,7 +1115,6 @@ struct ImGuiContext
boolActiveIdPreviousFrameIsAlive;
boolActiveIdPreviousFrameHasBeenEditedBefore;
ImGuiWindow*ActiveIdPreviousFrameWindow;
ImGuiIDLastActiveId;// Store the last non-zero ActiveId, useful for animation.
floatLastActiveIdTimer;// Store the last non-zero ActiveId timer since the beginning of activation, useful for animation.
@ -1212,9 +1221,9 @@ struct ImGuiContext
ImFontInputTextPasswordFont;
ImGuiIDTempInputTextId;// Temporary text input when CTRL+clicking on a slider, etc.
ImGuiColorEditFlagsColorEditOptions;// Store user options for color edit widgets
floatColorEditLastHue;
floatColorEditLastHue;// Backup of last Hue associated to LastColor[3], so we can restore Hue in lossy RGB<>HSV round trips
floatColorEditLastColor[3];
ImVec4ColorPickerRef;
ImVec4ColorPickerRef;// Initial/reference color at the time of opening the color picker.
boolDragCurrentAccumDirty;
floatDragCurrentAccum;// Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings
floatDragSpeedDefaultRatio;// If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
@ -1242,7 +1251,7 @@ struct ImGuiContext
ImVector<ImGuiSettingsHandler>SettingsHandlers;// List of .ini settings handlers