// Gently handle the user mistakenly calling OpenPopup() every frame. It is a programming mistake! However, if we were to run the regular code path, the ui
// would become completely unusable because the popup will always be in hidden-while-calculating-size state _while_ claiming focus. Which would be a very confusing
// situation for the programmer. Instead, we silently allow the popup to proceed, it will keep reappearing and the programming error will be more obvious to understand.
title_r=ImRect(ImTrunc(off+title_r.Min*scale),ImTrunc(off+ImVec2(title_r.Max.x,title_r.Min.y)*scale)+ImVec2(0,5));// Exaggerate title bar height
title_r=ImRect(ImTrunc(off+title_r.Min*scale),ImTrunc(off+ImVec2(title_r.Max.x,title_r.Min.y+title_r.GetHeight()*3.0f)*scale));// Exaggerate title bar height
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.");
MetricsHelpMarker("Dear ImGui uses monitor data:\n- to query DPI settings on a per monitor basis\n- to position popup/tooltips so they don't straddle monitors.");
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.90.2 WIP"
#define IMGUI_VERSION_NUM 19017
#define IMGUI_VERSION "1.90.2"
#define IMGUI_VERSION_NUM 19020
#define IMGUI_HAS_TABLE
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch
#define IMGUI_HAS_DOCK // Docking WIP branch
@ -350,7 +350,7 @@ namespace ImGui
// - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child.
// - Before 1.90 (November 2023), the "ImGuiChildFlags child_flags = 0" parameter was "bool border = false".
// This API is backward compatible with old code, as we guarantee that ImGuiChildFlags_Border == true.
// - Manual sizing (each axis can use a different setting e.g. ImVec2(0.0f, 400.0f)):
@ -1070,7 +1070,7 @@ enum ImGuiWindowFlags_
};
// Flags for ImGui::BeginChild()
// (Legacy: bot 0 must always correspond to ImGuiChildFlags_Border to be backward compatible with old API using 'bool border = false'.
// (Legacy: bit 0 must always correspond to ImGuiChildFlags_Border to be backward compatible with old API using 'bool border = false'.
// About using AutoResizeX/AutoResizeY flags:
// - May be combined with SetNextWindowSizeConstraints() to set a min/max size for each axis (see "Demo->Child->Auto-resize with Constraints").
// - Size measurement for a given axis is only performed when the child window is within visible boundaries, or is just appearing.
@ -1081,7 +1081,7 @@ enum ImGuiWindowFlags_
enumImGuiChildFlags_
{
ImGuiChildFlags_None=0,
ImGuiChildFlags_Border=1<<0,// Show an outer border and enable WindowPadding. (Important: this is always == 1 == true for legacy reason)
ImGuiChildFlags_Border=1<<0,// Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == true for legacy reason)
ImGuiChildFlags_AlwaysUseWindowPadding=1<<1,// Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense)
ImGuiChildFlags_ResizeX=1<<2,// Allow resize from right border (layout direction). Enable .ini saving (unless ImGuiWindowFlags_NoSavedSettings passed to window flags)
ImGuiChildFlags_ResizeY=1<<3,// Allow resize from bottom border (layout direction). "
@ -1150,8 +1150,8 @@ enum ImGuiTreeNodeFlags_
};
// Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions.
// - To be backward compatible with older API which took an 'int mouse_button = 1' argument, we need to treat
// small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags.
// - To be backward compatible with older API which took an 'int mouse_button = 1' argument instead of 'ImGuiPopupFlags flags',
// we need to treat small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags.
// It is therefore guaranteed to be legal to pass a mouse button index in ImGuiPopupFlags.
// - For the same reason, we exceptionally default the ImGuiPopupFlags argument of BeginPopupContextXXX functions to 1 instead of 0.
// IMPORTANT: because the default parameter is 1 (==ImGuiPopupFlags_MouseButtonRight), if you rely on the default parameter
@ -1165,10 +1165,12 @@ enum ImGuiPopupFlags_
ImGuiPopupFlags_MouseButtonMiddle=2,// For BeginPopupContext*(): open on Middle Mouse release. Guaranteed to always be == 2 (same as ImGuiMouseButton_Middle)
ImGuiPopupFlags_MouseButtonMask_=0x1F,
ImGuiPopupFlags_MouseButtonDefault_=1,
ImGuiPopupFlags_NoOpenOverExistingPopup=1<<5,// For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack
ImGuiPopupFlags_NoOpenOverItems=1<<6,// For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space
ImGuiPopupFlags_AnyPopupId=1<<7,// For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup.
ImGuiPopupFlags_AnyPopupLevel=1<<8,// For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level)
ImGuiPopupFlags_NoReopen=1<<5,// For OpenPopup*(), BeginPopupContext*(): don't reopen same popup if already open (won't reposition, won't reinitialize navigation)
//ImGuiPopupFlags_NoReopenAlwaysNavInit = 1 << 6, // For OpenPopup*(), BeginPopupContext*(): focus and initialize navigation even when not reopening.
ImGuiPopupFlags_NoOpenOverExistingPopup=1<<7,// For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack
ImGuiPopupFlags_NoOpenOverItems=1<<8,// For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space
ImGuiPopupFlags_AnyPopupId=1<<10,// For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup.
ImGuiPopupFlags_AnyPopupLevel=1<<11,// For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level)
intCurLenW,CurLenA;// we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not.
ImVector<ImWchar>TextW;// edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
ImVector<char>TextA;// temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity.
ImVector<char>InitialTextA;// backup of end-user buffer at the time of focus (in UTF-8, unaltered)
ImVector<char>InitialTextA;// value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered)
boolTextAIsValid;// temporary UTF8 buffer is not initially valid before we make the widget active (until then we pull the data from user argument)
intBufCapacityA;// end-user buffer capacity
floatScrollX;// horizontal scrolling/offset
@ -1575,8 +1575,7 @@ enum ImGuiScrollFlags_
enumImGuiNavHighlightFlags_
{
ImGuiNavHighlightFlags_None=0,
ImGuiNavHighlightFlags_TypeDefault=1<<0,
ImGuiNavHighlightFlags_TypeThin=1<<1,
ImGuiNavHighlightFlags_Compact=1<<1,// Compact highlight, no padding
ImGuiNavHighlightFlags_AlwaysDraw=1<<2,// Draw rectangular highlight if (g.NavId == id) _even_ when using the mouse.
ImGuiNavHighlightFlags_NoRounding=1<<3,
};
@ -2053,6 +2052,8 @@ struct ImGuiMetricsConfig
boolShowDockingNodes=false;
intShowWindowsRectsType=-1;
intShowTablesRectsType=-1;
intHighlightMonitorIdx=-1;
ImGuiIDHighlightViewportID=0;
};
structImGuiStackLevelInfo
@ -2220,8 +2221,6 @@ struct ImGuiContext
ImVector<ImGuiPopupData>BeginPopupStack;// Which level of BeginPopup() we are in (reset every frame)
ImVector<ImGuiNavTreeNodeData>NavTreeNodeStack;// Stack for TreeNode() when a NavLeft requested is emitted.
intBeginMenuCount;
// Viewports
ImVector<ImGuiViewportP*>Viewports;// Active viewports (always 1+, and generally 1 unless multi-viewports are enabled). Each viewports hold their copy of ImDrawData.
// Backup state of deactivating item so they'll have a chance to do a write to output buffer on the same frame they report IsItemDeactivatedAfterEdit (#4714)
InputTextDeactivateHook(state->ID);
// Take a copy of the initial buffer value (both in original UTF-8 format and converted to wchar)
// From the moment we focused we are ignoring the content of 'buf' (unless we are in read-only mode)
// From the moment we focused we are normally ignoring the content of 'buf' (unless we are in read-only mode)
constintbuf_len=(int)strlen(buf);
state->InitialTextA.resize(buf_len+1);// UTF-8. we use +1 to make sure that .Data is always pointing to at least an empty string.
memcpy(state->InitialTextA.Data,buf,buf_len+1);
if(!init_reload_from_user_buf)
{
// Take a copy of the initial buffer value.
state->InitialTextA.resize(buf_len+1);// UTF-8. we use +1 to make sure that .Data is always pointing to at least an empty string.
memcpy(state->InitialTextA.Data,buf,buf_len+1);
}
// Preserve cursor position and undo/redo stack if we come back to same widget
// FIXME: Since we reworked this on 2022/06, may want to differentiate recycle_cursor vs recycle_undostate?