ImGui::SetDragDropPayload("DND_DEMO_CELL",&n,sizeof(int));// Set payload to carry the index of our item (could be anything)
if(mode==Mode_Copy){ImGui::Text("Copy %s",names[n]);}// Display preview (could be anything, e.g. when dragging an image we could decide to display the filename and a small preview of the image, etc.)
ImGui::SetDragDropPayload("DND_DEMO_CELL",&n,sizeof(int));// Set payload to carry the index of our item (could be anything)
if(mode==Mode_Copy){ImGui::Text("Copy %s",names[n]);}// Display preview (could be anything, e.g. when dragging an image we could decide to display the filename and a small preview of the image, etc.)
// Demo helper function to select among default colors. See ShowStyleEditor() for more advanced options.
// Here we use the simplified Combo() api that packs items into a single literal string. Useful for quick combo boxes where the choices are known locally.
// FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered.
structIMGUI_APIImGuiWindowTempData
{
ImVec2CursorPos;
ImVec2CursorPos;// Current emitting position, in absolute coordinates.
ImVec2CursorPosPrevLine;
ImVec2CursorStartPos;// Initial position in client area with padding
ImVec2CursorStartPos;// Initial position after Begin(), generally ~ window position + WindowPadding.
ImVec2CursorMaxPos;// Used to implicitly calculate the size of our contents, always growing during the frame. Used to calculate window->ContentSize at the beginning of next frame
ImVec2CurrLineSize;
ImVec2PrevLineSize;
floatCurrLineTextBaseOffset;
floatCurrLineTextBaseOffset;// Baseline offset (0.0f by default on a new line, generally == style.FramePadding.y when a framed item has been added).
floatPrevLineTextBaseOffset;
intTreeDepth;
ImU32TreeMayJumpToParentOnPopMask;// Store a copy of !g.NavIdIsAlive for TreeDepth 0..31.. Could be turned into a ImU64 if necessary.
ImGuiIDLastItemId;
ImGuiItemStatusFlagsLastItemStatusFlags;
ImRectLastItemRect;// Interaction rect
ImRectLastItemDisplayRect;// End-user display rect (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
intTreeDepth;// Current tree depth.
ImU32TreeMayJumpToParentOnPopMask;// Store a copy of !g.NavIdIsAlive for TreeDepth 0..31.. Could be turned into a ImU64 if necessary.
ImGuiIDLastItemId;// ID for last item
ImGuiItemStatusFlagsLastItemStatusFlags;// Status flags for last item (see ImGuiItemStatusFlags_)
ImRectLastItemRect;// Interaction rect for last item
ImRectLastItemDisplayRect;// End-user display rect for last item (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
ImGuiNavLayerNavLayerCurrent;// Current layer, 0..31 (we currently only use 0..1)
intNavLayerCurrentMask;// = (1 << NavLayerCurrent) used by ItemAdd prior to clipping.
intNavLayerActiveMask;// Which layer have been written to (result from previous frame)
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.
ImVector<ImGuiWindow*>ChildWindows;
ImGuiStorage*StateStorage;
ImGuiStorage*StateStorage;// Current persistent per-window storage (store e.g. tree node open/close state)
ImGuiLayoutTypeLayoutType;
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)
@ -1287,9 +1287,9 @@ struct IMGUI_API ImGuiWindow
ImVec2SizeFull;// Size when non collapsed
ImVec2ContentSize;// Size of contents/scrollable client area (calculated from the extents reach of the cursor) from previous frame. Does not include window decoration or window padding.
ImVec2ContentSizeExplicit;// Size of contents/scrollable client area explicitly request by the user via SetNextWindowContentSize().
ImVec2WindowPadding;// Window padding at the time of begin.
floatWindowRounding;// Window rounding at the time of begin.
floatWindowBorderSize;// Window border size at the time of begin.
ImVec2WindowPadding;// Window padding at the time of Begin().
floatWindowRounding;// Window rounding at the time of Begin().
floatWindowBorderSize;// Window border size at the time of Begin().
intNameBufLen;// Size of buffer storing Name. May be larger than strlen(Name)!
ImGuiIDMoveId;// == window->GetID("#MOVE")
ImGuiIDChildId;// ID of corresponding item in parent window (for navigation to return from child window to parent window)
@ -1298,7 +1298,7 @@ struct IMGUI_API ImGuiWindow
ImVec2ScrollTarget;// target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
ImVec2ScrollTargetCenterRatio;// 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
ImVec2ScrollbarSizes;// Size taken by scrollbars on each axis
boolScrollbarX,ScrollbarY;
boolScrollbarX,ScrollbarY;// Are scrollbars visible?
boolActive;// Set to true on Begin(), unless Collapsed
boolWasActive;
boolWriteAccessed;// Set to true when any widget access the current window
@ -1313,9 +1313,9 @@ struct IMGUI_API ImGuiWindow
shortBeginOrderWithinParent;// Order within immediate parent window, if we are a child window. Otherwise 0.
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)
intAutoFitFramesX,AutoFitFramesY;
ImS8AutoFitFramesX,AutoFitFramesY;
ImS8AutoFitChildAxises;
boolAutoFitOnlyGrows;
intAutoFitChildAxises;
ImGuiDirAutoPosLastDirection;
intHiddenFramesCanSkipItems;// Hide the window for N frames
intHiddenFramesCannotSkipItems;// Hide the window for N frames while allowing items to be submitted so we can measure their size
@ -1338,7 +1338,7 @@ struct IMGUI_API ImGuiWindow
ImRectContentsRegionRect;// FIXME: This is currently confusing/misleading. It is essentially WorkRect but not handling of scrolling. We currently rely on it as right/bottom aligned sizing operation need some size to rely on.
intLastFrameActive;// Last frame number the window was Active.
floatLastTimeActive;
floatLastTimeActive;// Last timestamp the window was Active (using float as we don't need high precision there)
floatItemWidthDefault;
ImGuiMenuColumnsMenuColumns;// Simplified columns storage for menu items