mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-25 10:05:25 +08:00
Merge branch 'master' into docking
# Conflicts: # imgui.cpp # imgui_internal.h
This commit is contained in:
@@ -43,6 +43,25 @@ Breaking changes:
|
||||
|
||||
Other changes:
|
||||
|
||||
- Error Handling: Enabled/improved error recovery systems. (#1651, #5654)
|
||||
- Error recovery is not perfect nor guaranteed! It is a feature to ease development.
|
||||
- Functions that support error recovery are using IM_ASSERT_USER_ERROR() instead of IM_ASSERT().
|
||||
- You not are not supposed to rely on it in the course of a normal application run.
|
||||
- Possible usage: facilitate recovery from errors triggered from a scripting language or
|
||||
after specific exceptions handlers. Surface errors to programmers in less agressive ways.
|
||||
- Always ensure that on programmers seats you have at minimum Asserts or Tooltips enabled
|
||||
when making direct imgui API calls! Otherwise it would severely hinder your ability to
|
||||
catch and correct mistakes!
|
||||
- Added io.ConfigErrorRecovery to enable error recovery support.
|
||||
- Added io.ConfigErrorRecoveryEnableAssert to assert on recoverable errors.
|
||||
- Added io.ConfigErrorRecoveryEnableDebugLog to output to debug log on recoverable errors.
|
||||
- Added io.ConfigErrorRecoveryEnableTooltip to enable displaying an error tooltip on recoverable errors.
|
||||
The tooltip include a way to enable asserts if they were disabled.
|
||||
- All options are enabled by default.
|
||||
- Read https://github.com/ocornut/imgui/wiki/Error-Handling for a bit more details.
|
||||
- Windows: BeginChild(): made it possible to call SetNextWindowSize() on a child window
|
||||
using ImGuiChildFlags_ResizeX,ImGuiChildFlags_ResizeY in order to override its current
|
||||
size. (#1710, #8020)
|
||||
- Scrollbar: Shift+Click scroll to clicked location (pre-1.90.8 default). (#8002, #7328)
|
||||
- Scrollbar: added io.ConfigScrollbarScrollByPage setting (default to true). (#8002, #7328)
|
||||
Set io.ConfigScrollbarScrollByPage=false to enforce always scrolling to clicked location.
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
// Library Version
|
||||
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
|
||||
#define IMGUI_VERSION "1.91.3 WIP"
|
||||
#define IMGUI_VERSION_NUM 19121
|
||||
#define IMGUI_VERSION_NUM 19123
|
||||
#define IMGUI_HAS_TABLE
|
||||
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch
|
||||
#define IMGUI_HAS_DOCK // Docking WIP branch
|
||||
@@ -2355,6 +2355,23 @@ struct ImGuiIO
|
||||
// Debug options
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// Options to configure how we handle recoverable errors [EXPERIMENTAL]
|
||||
// - Error recovery is not perfect nor guaranteed! It is a feature to ease development.
|
||||
// - Functions that support error recovery are using IM_ASSERT_USER_ERROR() instead of IM_ASSERT().
|
||||
// - You not are not supposed to rely on it in the course of a normal application run.
|
||||
// - Possible usage: facilitate recovery from errors triggered from a scripting language or after specific exceptions handlers.
|
||||
// - Always ensure that on programmers seat you have at minimum Asserts or Tooltips enabled when making direct imgui API calls!
|
||||
// Otherwise it would severely hinder your ability to catch and correct mistakes!
|
||||
// Read https://github.com/ocornut/imgui/wiki/Error-Handling for details about typical usage scenarios:
|
||||
// - Programmer seats: keep asserts (default), or disable asserts and keep error tooltips (new and nice!)
|
||||
// - Non-programmer seats: maybe disable asserts, but make sure errors are resurfaced (visible log entries, use callback etc.)
|
||||
// - Recovery after error from scripting language: record stack sizes before running script, disable assert, trigger breakpoint from ErrorCallback, recover with ErrorRecoveryTryToRecoverState(), restore settings.
|
||||
// - Recovery after an exception handler: record stack sizes before try {} block, disable assert, set log callback, recover with ErrorRecoveryTryToRecoverState(), restore settings.
|
||||
bool ConfigErrorRecovery; // = true // Enable error recovery support. Some errors won't be detected and lead to direct crashes if recovery is disabled.
|
||||
bool ConfigErrorRecoveryEnableAssert; // = true // Enable asserts on recoverable error. By default call IM_ASSERT() when returning from a failing IM_ASSERT_USER_ERROR()
|
||||
bool ConfigErrorRecoveryEnableDebugLog; // = true // Enable debug log output on recoverable errors.
|
||||
bool ConfigErrorRecoveryEnableTooltip; // = true // Enable tooltip on recoverable errors. The tooltip include a way to enable asserts if they were disabled.
|
||||
|
||||
// Option to enable various debug tools showing buttons that will call the IM_DEBUG_BREAK() macro.
|
||||
// - The Item Picker tool will be available regardless of this being enabled, in order to maximize its discoverability.
|
||||
// - Requires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application.
|
||||
@@ -2383,7 +2400,7 @@ struct ImGuiIO
|
||||
bool ConfigDebugIniSettings; // = false // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower)
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Platform Functions
|
||||
// Platform Identifiers
|
||||
// (the imgui_impl_xxxx backend files are setting those up for you)
|
||||
//------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -599,6 +599,22 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::SameLine(); HelpMarker("Swap Cmd<>Ctrl keys, enable various MacOS style behaviors.");
|
||||
ImGui::Text("Also see Style->Rendering for rendering options.");
|
||||
|
||||
// Read https://github.com/ocornut/imgui/wiki/Error-Handling
|
||||
ImGui::SeparatorText("Error Handling");
|
||||
ImGui::Checkbox("io.ConfigErrorRecovery", &io.ConfigErrorRecovery);
|
||||
ImGui::SameLine(); HelpMarker(
|
||||
"Options to configure how we handle recoverable errors.\n"
|
||||
"- Error recovery is not perfect nor guaranteed! It is a feature to ease development.\n"
|
||||
"- You not are not supposed to rely on it in the course of a normal application run.\n"
|
||||
"- Possible usage: facilitate recovery from errors triggered from a scripting language or after specific exceptions handlers.\n"
|
||||
"- Always ensure that on programmers seat you have at minimum Asserts or Tooltips enabled when making direct imgui API call!"
|
||||
"Otherwise it would severely hinder your ability to catch and correct mistakes!");
|
||||
ImGui::Checkbox("io.ConfigErrorRecoveryEnableAssert", &io.ConfigErrorRecoveryEnableAssert);
|
||||
ImGui::Checkbox("io.ConfigErrorRecoveryEnableDebugLog", &io.ConfigErrorRecoveryEnableDebugLog);
|
||||
ImGui::Checkbox("io.ConfigErrorRecoveryEnableTooltip", &io.ConfigErrorRecoveryEnableTooltip);
|
||||
if (!io.ConfigErrorRecoveryEnableAssert && !io.ConfigErrorRecoveryEnableDebugLog && !io.ConfigErrorRecoveryEnableTooltip)
|
||||
io.ConfigErrorRecoveryEnableAssert = io.ConfigErrorRecoveryEnableDebugLog = io.ConfigErrorRecoveryEnableTooltip = true;
|
||||
|
||||
ImGui::SeparatorText("Debug");
|
||||
ImGui::Checkbox("io.ConfigDebugIsDebuggerPresent", &io.ConfigDebugIsDebuggerPresent);
|
||||
ImGui::SameLine(); HelpMarker("Enable various tools calling IM_DEBUG_BREAK().\n\nRequires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application.");
|
||||
@@ -4006,6 +4022,9 @@ static void ShowDemoWindowLayout()
|
||||
ImGui::SeparatorText("Manual-resize");
|
||||
{
|
||||
HelpMarker("Drag bottom border to resize. Double-click bottom border to auto-fit to vertical contents.");
|
||||
//if (ImGui::Button("Set Height to 200"))
|
||||
// ImGui::SetNextWindowSize(ImVec2(-FLT_MIN, 200.0f));
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, ImGui::GetStyleColorVec4(ImGuiCol_FrameBg));
|
||||
if (ImGui::BeginChild("ResizableChild", ImVec2(-FLT_MIN, ImGui::GetTextLineHeightWithSpacing() * 8), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeY))
|
||||
for (int n = 0; n < 10; n++)
|
||||
|
||||
+60
-34
@@ -28,6 +28,7 @@ Index of this file:
|
||||
// [SECTION] Viewport support
|
||||
// [SECTION] Settings support
|
||||
// [SECTION] Localization support
|
||||
// [SECTION] Error handling, State recovery support
|
||||
// [SECTION] Metrics, Debug tools
|
||||
// [SECTION] Generic context hooks
|
||||
// [SECTION] ImGuiContext (main imgui context)
|
||||
@@ -135,6 +136,7 @@ struct ImGuiDockContext; // Docking system context
|
||||
struct ImGuiDockRequest; // Docking system dock/undock queued request
|
||||
struct ImGuiDockNode; // Docking system node (hold a list of Windows OR two child dock nodes)
|
||||
struct ImGuiDockNodeSettings; // Storage for a dock node in .ini file (we preserve those even if the associated dock node isn't active during the session)
|
||||
struct ImGuiErrorRecoveryState; // Storage of stack sizes for error handling and recovery
|
||||
struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup()
|
||||
struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box
|
||||
struct ImGuiInputTextDeactivateData;// Short term storage to backup text of a deactivating InputText() while another is stealing active id
|
||||
@@ -151,7 +153,6 @@ struct ImGuiOldColumnData; // Storage data for a single column for lega
|
||||
struct ImGuiOldColumns; // Storage data for a columns set for legacy Columns() api
|
||||
struct ImGuiPopupData; // Storage for current popup stack
|
||||
struct ImGuiSettingsHandler; // Storage for one type registered in the .ini file
|
||||
struct ImGuiStackSizes; // Storage of stack sizes for debugging/asserting
|
||||
struct ImGuiStyleMod; // Stacked style modifier, backup of modified data so we can restore it
|
||||
struct ImGuiTabBar; // Storage for a tab bar
|
||||
struct ImGuiTabItem; // Storage for a tab item (within a tab bar)
|
||||
@@ -179,7 +180,7 @@ typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // E
|
||||
// Flags
|
||||
typedef int ImGuiActivateFlags; // -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later)
|
||||
typedef int ImGuiDebugLogFlags; // -> enum ImGuiDebugLogFlags_ // Flags: for ShowDebugLogWindow(), g.DebugLogFlags
|
||||
typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow();
|
||||
typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow()
|
||||
typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for g.LastItemData.StatusFlags
|
||||
typedef int ImGuiOldColumnFlags; // -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns()
|
||||
typedef int ImGuiNavHighlightFlags; // -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
|
||||
@@ -193,8 +194,6 @@ typedef int ImGuiTooltipFlags; // -> enum ImGuiTooltipFlags_ // F
|
||||
typedef int ImGuiTypingSelectFlags; // -> enum ImGuiTypingSelectFlags_ // Flags: for GetTypingSelectRequest()
|
||||
typedef int ImGuiWindowRefreshFlags; // -> enum ImGuiWindowRefreshFlags_ // Flags: for SetNextWindowRefreshPolicy()
|
||||
|
||||
typedef void (*ImGuiErrorLogCallback)(void* user_data, const char* fmt, ...);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] Context pointer
|
||||
// See implementation of this variable in imgui.cpp for comments and details.
|
||||
@@ -227,6 +226,7 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
|
||||
#else
|
||||
#define IMGUI_DEBUG_LOG(...) ((void)0)
|
||||
#endif
|
||||
#define IMGUI_DEBUG_LOG_ERROR(...) do { ImGuiContext& g2 = *GImGui; if (g2.DebugLogFlags & ImGuiDebugLogFlags_EventError) IMGUI_DEBUG_LOG(__VA_ARGS__); else g2.DebugLogSkippedErrors++; } while (0)
|
||||
#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
@@ -250,12 +250,6 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
|
||||
#define IM_ASSERT_PARANOID(_EXPR)
|
||||
#endif
|
||||
|
||||
// Error handling
|
||||
// Down the line in some frameworks/languages we would like to have a way to redirect those to the programmer and recover from more faults.
|
||||
#ifndef IM_ASSERT_USER_ERROR
|
||||
#define IM_ASSERT_USER_ERROR(_EXP,_MSG) IM_ASSERT((_EXP) && _MSG) // Recoverable User Error
|
||||
#endif
|
||||
|
||||
// Misc Macros
|
||||
#define IM_PI 3.14159265358979323846f
|
||||
#ifdef _WIN32
|
||||
@@ -1278,10 +1272,12 @@ struct ImGuiTreeNodeStackData
|
||||
ImRect NavRect; // Used for nav landing
|
||||
};
|
||||
|
||||
// sizeof() = 18
|
||||
struct IMGUI_API ImGuiStackSizes
|
||||
// sizeof() = 20
|
||||
struct IMGUI_API ImGuiErrorRecoveryState
|
||||
{
|
||||
short SizeOfWindowStack;
|
||||
short SizeOfIDStack;
|
||||
short SizeOfTreeStack;
|
||||
short SizeOfColorStack;
|
||||
short SizeOfStyleVarStack;
|
||||
short SizeOfFontStack;
|
||||
@@ -1291,18 +1287,16 @@ struct IMGUI_API ImGuiStackSizes
|
||||
short SizeOfBeginPopupStack;
|
||||
short SizeOfDisabledStack;
|
||||
|
||||
ImGuiStackSizes() { memset(this, 0, sizeof(*this)); }
|
||||
void SetToContextState(ImGuiContext* ctx);
|
||||
void CompareWithContextState(ImGuiContext* ctx);
|
||||
ImGuiErrorRecoveryState() { memset(this, 0, sizeof(*this)); }
|
||||
};
|
||||
|
||||
// Data saved for each window pushed into the stack
|
||||
struct ImGuiWindowStackData
|
||||
{
|
||||
ImGuiWindow* Window;
|
||||
ImGuiLastItemData ParentLastItemDataBackup;
|
||||
ImGuiStackSizes StackSizesOnBegin; // Store size of various stacks for asserting
|
||||
bool DisabledOverrideReenable; // Non-child window override disabled flag
|
||||
ImGuiWindow* Window;
|
||||
ImGuiLastItemData ParentLastItemDataBackup;
|
||||
ImGuiErrorRecoveryState StackSizesInBegin; // Store size of various stacks for asserting
|
||||
bool DisabledOverrideReenable; // Non-child window override disabled flag
|
||||
};
|
||||
|
||||
struct ImGuiShrinkWidthItem
|
||||
@@ -2076,6 +2070,22 @@ struct ImGuiLocEntry
|
||||
const char* Text;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] Error handling, State recovery support
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Macros used by Recoverable Error handling
|
||||
// - Only dispatch error if _EXPR: evaluate as assert (similar to an assert macro).
|
||||
// - The message will always be a string literal, in order to increase likelihood of being display by an assert handler.
|
||||
// - The intent is that you may rewire this macro to dispatch dynamically:
|
||||
// - On programmers machines, when debugger is attached, on direct imgui API usage error: always assert!
|
||||
// - On exception recovery and script language recovery: you may decide to error log.
|
||||
#ifndef IM_ASSERT_USER_ERROR
|
||||
#define IM_ASSERT_USER_ERROR(_EXPR,_MSG) do { if (!(_EXPR) && ImGui::ErrorLog(_MSG)) { IM_ASSERT((_EXPR) && _MSG); } } while (0) // Recoverable User Error
|
||||
#endif
|
||||
|
||||
|
||||
typedef void (*ImGuiErrorCallback)(ImGuiContext* ctx, void* user_data, const char* msg); // Function signature for g.ErrorCallback
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] Metrics, Debug Tools
|
||||
@@ -2085,18 +2095,19 @@ enum ImGuiDebugLogFlags_
|
||||
{
|
||||
// Event types
|
||||
ImGuiDebugLogFlags_None = 0,
|
||||
ImGuiDebugLogFlags_EventActiveId = 1 << 0,
|
||||
ImGuiDebugLogFlags_EventFocus = 1 << 1,
|
||||
ImGuiDebugLogFlags_EventPopup = 1 << 2,
|
||||
ImGuiDebugLogFlags_EventNav = 1 << 3,
|
||||
ImGuiDebugLogFlags_EventClipper = 1 << 4,
|
||||
ImGuiDebugLogFlags_EventSelection = 1 << 5,
|
||||
ImGuiDebugLogFlags_EventIO = 1 << 6,
|
||||
ImGuiDebugLogFlags_EventInputRouting = 1 << 7,
|
||||
ImGuiDebugLogFlags_EventDocking = 1 << 8,
|
||||
ImGuiDebugLogFlags_EventViewport = 1 << 9,
|
||||
ImGuiDebugLogFlags_EventError = 1 << 0, // Error submitted by IM_ASSERT_USER_ERROR()
|
||||
ImGuiDebugLogFlags_EventActiveId = 1 << 1,
|
||||
ImGuiDebugLogFlags_EventFocus = 1 << 2,
|
||||
ImGuiDebugLogFlags_EventPopup = 1 << 3,
|
||||
ImGuiDebugLogFlags_EventNav = 1 << 4,
|
||||
ImGuiDebugLogFlags_EventClipper = 1 << 5,
|
||||
ImGuiDebugLogFlags_EventSelection = 1 << 6,
|
||||
ImGuiDebugLogFlags_EventIO = 1 << 7,
|
||||
ImGuiDebugLogFlags_EventInputRouting = 1 << 8,
|
||||
ImGuiDebugLogFlags_EventDocking = 1 << 9,
|
||||
ImGuiDebugLogFlags_EventViewport = 1 << 10,
|
||||
|
||||
ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
|
||||
ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport,
|
||||
ImGuiDebugLogFlags_OutputToTTY = 1 << 20, // Also send output to TTY
|
||||
ImGuiDebugLogFlags_OutputToTestEngine = 1 << 21, // Also send output to Test Engine
|
||||
};
|
||||
@@ -2516,11 +2527,22 @@ struct ImGuiContext
|
||||
int LogDepthToExpand;
|
||||
int LogDepthToExpandDefault; // Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call.
|
||||
|
||||
// Error Handling
|
||||
ImGuiErrorCallback ErrorCallback; // = NULL. May be exposed in public API eventually.
|
||||
void* ErrorCallbackUserData; // = NULL
|
||||
ImVec2 ErrorTooltipLockedPos;
|
||||
bool ErrorFirst;
|
||||
int ErrorCountCurrentFrame; // [Internal] Number of errors submitted this frame.
|
||||
ImGuiErrorRecoveryState StackSizesInNewFrame; // [Internal]
|
||||
ImGuiErrorRecoveryState*StackSizesInBeginForCurrentWindow; // [Internal]
|
||||
|
||||
// Debug Tools
|
||||
// (some of the highly frequently used data are interleaved in other structures above: DebugBreakXXX fields, DebugHookIdInfo, DebugLocateId etc.)
|
||||
int DebugDrawIdConflictsCount; // Locked count (preserved when holding CTRL)
|
||||
ImGuiDebugLogFlags DebugLogFlags;
|
||||
ImGuiTextBuffer DebugLogBuf;
|
||||
ImGuiTextIndex DebugLogIndex;
|
||||
int DebugLogSkippedErrors;
|
||||
ImGuiDebugLogFlags DebugLogAutoDisableFlags;
|
||||
ImU8 DebugLogAutoDisableFrames;
|
||||
ImU8 DebugLocateFrames; // For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above.
|
||||
@@ -3706,11 +3728,15 @@ namespace ImGui
|
||||
IMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow* window);
|
||||
IMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow* window);
|
||||
|
||||
// Error Checking, State Recovery
|
||||
IMGUI_API void ErrorLogCallbackToDebugLog(void* user_data, const char* fmt, ...);
|
||||
IMGUI_API void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
|
||||
IMGUI_API void ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
|
||||
// Error handling, State Recovery
|
||||
IMGUI_API bool ErrorLog(const char* msg);
|
||||
IMGUI_API void ErrorRecoveryStoreState(ImGuiErrorRecoveryState* state_out);
|
||||
IMGUI_API void ErrorRecoveryTryToRecoverState(const ImGuiErrorRecoveryState* state_in);
|
||||
IMGUI_API void ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in);
|
||||
IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
|
||||
IMGUI_API void ErrorCheckEndFrameFinalizeErrorTooltip();
|
||||
IMGUI_API bool BeginErrorTooltip();
|
||||
IMGUI_API void EndErrorTooltip();
|
||||
|
||||
// Debug Tools
|
||||
IMGUI_API void DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr, size_t size); // size >= 0 : alloc, size = -1 : free
|
||||
|
||||
@@ -1484,7 +1484,9 @@ void ImGui::EndTable()
|
||||
{
|
||||
short backup_nav_layers_active_mask = inner_window->DC.NavLayersActiveMask;
|
||||
inner_window->DC.NavLayersActiveMask |= 1 << ImGuiNavLayer_Main; // So empty table don't appear to navigate differently.
|
||||
g.CurrentTable = NULL; // To avoid error recovery recursing
|
||||
EndChild();
|
||||
g.CurrentTable = table;
|
||||
inner_window->DC.NavLayersActiveMask = backup_nav_layers_active_mask;
|
||||
}
|
||||
else
|
||||
|
||||
+9
-1
@@ -7398,6 +7398,7 @@ void ImGui::EndBoxSelect(const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flag
|
||||
static void DebugLogMultiSelectRequests(const char* function, const ImGuiMultiSelectIO* io)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_UNUSED(function);
|
||||
for (const ImGuiSelectionRequest& req : io->Requests)
|
||||
{
|
||||
if (req.Type == ImGuiSelectionRequestType_SetAll) IMGUI_DEBUG_LOG_SELECTION("[selection] %s: Request: SetAll %d (= %s)\n", function, req.Selected, req.Selected ? "SelectAll" : "Clear");
|
||||
@@ -7557,7 +7558,7 @@ ImGuiMultiSelectIO* ImGui::EndMultiSelect()
|
||||
ImGuiMultiSelectTempData* ms = g.CurrentMultiSelect;
|
||||
ImGuiMultiSelectState* storage = ms->Storage;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
IM_ASSERT(ms->FocusScopeId == g.CurrentFocusScopeId);
|
||||
IM_ASSERT_USER_ERROR(ms->FocusScopeId == g.CurrentFocusScopeId, "EndMultiSelect() FocusScope mismatch!");
|
||||
IM_ASSERT(g.CurrentMultiSelect != NULL && storage->Window == g.CurrentWindow);
|
||||
IM_ASSERT(g.MultiSelectTempDataStacked > 0 && &g.MultiSelectTempData[g.MultiSelectTempDataStacked - 1] == g.CurrentMultiSelect);
|
||||
|
||||
@@ -8164,6 +8165,13 @@ void ImGuiSelectionExternalStorage::ApplyRequests(ImGuiMultiSelectIO* ms_io)
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// This is essentially a thin wrapper to using BeginChild/EndChild with the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label.
|
||||
// This handle some subtleties with capturing info from the label, but for 99% uses it could essentially be rewritten as:
|
||||
// if (ImGui::BeginChild("...", ImVec2(ImGui::CalcItemWidth(), ImGui::GetTextLineHeight() * 7.5f), ImGuiChildFlags_FrameStyle))
|
||||
// { .... }
|
||||
// ImGui::EndChild();
|
||||
// ImGui::SameLine();
|
||||
// ImGui::AlignTextToFramePadding();
|
||||
// ImGui::Text("Label");
|
||||
// Tip: To have a list filling the entire window width, use size.x = -FLT_MIN and pass an non-visible label e.g. "##empty"
|
||||
// Tip: If your vertical size is calculated from an item count (e.g. 10 * item_height) consider adding a fractional part to facilitate seeing scrolling boundaries (e.g. 10.25 * item_height).
|
||||
bool ImGui::BeginListBox(const char* label, const ImVec2& size_arg)
|
||||
|
||||
Reference in New Issue
Block a user