You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// (this is specifically done here by comparing on hover because it allows us a detection of duplicates that is algorithmically extra cheap, 1 u32 compare per item. No O(log N) lookup whatsoever)
4854
4862
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
4855
4863
if (id != 0 && g.HoveredIdPreviousFrame == id && (item_flags & ImGuiItemFlags_AllowDuplicateId) == 0)
// Empty identifier are valid and useful in a small amount of cases, but 99.9% of the time you want to use "##something".
11681
11689
// READ THE FAQ: https://dearimgui.com/faq
11682
11690
IM_ASSERT(id != window->ID && "Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!");
11691
+
11692
+
// [DEBUG] Highlight all conflicts WITHOUT needing to hover. THIS WILL SLOW DOWN DEAR IMGUI. DON'T KEEP ACTIVATED.
11693
+
// This will only work for items submitted with ItemAdd(). Some very rare/odd/unrecommended code patterns are calling ButtonBehavior() without ItemAdd().
11694
+
#ifdef IMGUI_DEBUG_HIGHLIGHT_ALL_ID_CONFLICTS
11695
+
if ((g.LastItemData.ItemFlags & ImGuiItemFlags_AllowDuplicateId) == 0)
11696
+
{
11697
+
int* p_alive = g.DebugDrawIdConflictsAliveCount.GetIntRef(id, -1); // Could halve lookups if we knew ImGuiStorage can store 64-bit, or by storing FrameCount as 30-bits + highlight as 2-bits. But the point is that we should not pretend that this is fast.
TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "IMGUI_DEBUG_HIGHLIGHT_ALL_ID_CONFLICTS is enabled.\nMust disable after use! Otherwise Dear ImGui will run slower.\n");
Copy file name to clipboardExpand all lines: imgui_internal.h
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
// dear imgui, v1.92.1 WIP
1
+
// dear imgui, v1.92.1
2
2
// (internal structures/api)
3
3
4
4
// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.
@@ -987,6 +987,7 @@ enum ImGuiItemStatusFlags_
987
987
ImGuiItemStatusFlags_Visible = 1 << 8, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()).
988
988
ImGuiItemStatusFlags_HasClipRect = 1 << 9, // g.LastItemData.ClipRect is valid.
989
989
ImGuiItemStatusFlags_HasShortcut = 1 << 10, // g.LastItemData.Shortcut valid. Set by SetNextItemShortcut() -> ItemAdd().
990
+
//ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, // Removed IN 1.90.1 (Dec 2023). The trigger is part of g.NavActivateId. See commit 54c1bdeceb.
990
991
991
992
// Additional status + semantic for ImGuiTestEngine
ImGuiNavHighlightFlags_Compact = ImGuiNavRenderCursorFlags_Compact, // Renamed in 1.91.4
1701
1703
ImGuiNavHighlightFlags_AlwaysDraw = ImGuiNavRenderCursorFlags_AlwaysDraw, // Renamed in 1.91.4
1702
1704
ImGuiNavHighlightFlags_NoRounding = ImGuiNavRenderCursorFlags_NoRounding, // Renamed in 1.91.4
1705
+
//ImGuiNavHighlightFlags_TypeThin = ImGuiNavRenderCursorFlags_Compact, // Renamed in 1.90.2
1703
1706
#endif
1704
1707
};
1705
1708
@@ -2385,7 +2388,7 @@ struct ImGuiContext
2385
2388
ImVec2 WheelingAxisAvg;
2386
2389
2387
2390
// Item/widgets state and tracking information
2388
-
ImGuiID DebugDrawIdConflicts; // Set when we detect multiple items with the same identifier
2391
+
ImGuiID DebugDrawIdConflictsId;// Set when we detect multiple items with the same identifier
2389
2392
ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by ID Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
2390
2393
ImGuiID HoveredId; // Hovered widget, filled during the frame
2391
2394
ImGuiID HoveredIdPreviousFrame;
@@ -2474,18 +2477,19 @@ struct ImGuiContext
2474
2477
ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow'
2475
2478
ImGuiID NavFocusScopeId; // Focused focus scope (e.g. selection code often wants to "clear other items" when landing on an item of the same scope)
2476
2479
ImGuiNavLayer NavLayer; // Focused layer (main scrolling layer, or menu/title bar layer)
2477
-
ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem()
2480
+
ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItemByID()
ImVector<ImGuiFocusScopeData> NavFocusRoute; // Reversed copy focus scope stack for NavId (should contains NavFocusScopeId). This essentially follow the window->ParentWindowForFocusRoute chain.
2482
2485
ImGuiID NavHighlightActivatedId;
2483
2486
float NavHighlightActivatedTimer;
2484
-
ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame.
2487
+
ImGuiID NavNextActivateId; // Set by ActivateItemByID(), queued until next frame.
2485
2488
ImGuiActivateFlags NavNextActivateFlags;
2486
2489
ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Mouse
2487
2490
ImGuiSelectionUserData NavLastValidSelectionUserData; // Last valid data passed to SetNextItemSelectionUser(), or -1. For current window. Not reset when focusing an item that doesn't have selection data.
2488
2491
ImS8 NavCursorHideFrames;
2492
+
//ImGuiID NavActivateInputId; // Removed in 1.89.4 (July 2023). This is now part of g.NavActivateId and sets g.NavActivateFlags |= ImGuiActivateFlags_PreferInput. See commit c9a53aa74, issue #5606.
2489
2493
2490
2494
// Navigation: Init & Move Requests
2491
2495
bool NavAnyRequest; // ~~ NavMoveRequest || NavInitRequest this is to perform early out in ItemAdd()
@@ -2699,6 +2703,10 @@ struct ImGuiContext
2699
2703
ImGuiIDStackTool DebugIDStackTool;
2700
2704
ImGuiDebugAllocInfo DebugAllocInfo;
2701
2705
ImGuiDockNode* DebugHoveredDockNode; // Hovered dock node.
float FramerateSecPerFrame[60]; // Calculate estimate of framerate for user over the last 60 frames..
@@ -2707,7 +2715,7 @@ struct ImGuiContext
2707
2715
float FramerateSecPerFrameAccum;
2708
2716
int WantCaptureMouseNextFrame; // Explicit capture override via SetNextFrameWantCaptureMouse()/SetNextFrameWantCaptureKeyboard(). Default to -1.
2709
2717
int WantCaptureKeyboardNextFrame; // "
2710
-
int WantTextInputNextFrame; // Copied in EndFrame() from g.PlatformImeData.WanttextInput. Needs to be set for some backends (SDL3) to emit character inputs.
2718
+
int WantTextInputNextFrame; // Copied in EndFrame() from g.PlatformImeData.WantTextInput. Needs to be set for some backends (SDL3) to emit character inputs.
2711
2719
ImVector<char> TempBuffer; // Temporary text buffer
2712
2720
char TempKeychordName[64];
2713
2721
@@ -3518,7 +3526,7 @@ namespace ImGui
3518
3526
// This should be part of a larger set of API: FocusItem(offset = -1), FocusItemByID(id), ActivateItem(offset = -1), ActivateItemByID(id) etc. which are
3519
3527
// much harder to design and implement than expected. I have a couple of private branches on this matter but it's not simple. For now implementing the easy ones.
3520
3528
IMGUI_API voidFocusItem(); // Focus last item (no selection/activation).
3521
-
IMGUI_API voidActivateItemByID(ImGuiID id); // Activate an item by ID (button, checkbox, tree node etc.). Activation is queued and processed on the next frame when the item is encountered again.
3529
+
IMGUI_API voidActivateItemByID(ImGuiID id); // Activate an item by ID (button, checkbox, tree node etc.). Activation is queued and processed on the next frame when the item is encountered again. Was called 'ActivateItem()' before 1.89.7.
3522
3530
3523
3531
// Inputs
3524
3532
// FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.
0 commit comments