From 5b0510c5b766ae3dba1e70bd838bf3b1df61de94 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 20 Aug 2022 22:55:51 +0200 Subject: [PATCH] TestEngine: facilitate aiming at InputScalar() using wildcards + removed unnecessary IDStack.size hack (require TestEngine latest) --- imgui.cpp | 2 -- imgui.h | 2 +- imgui_widgets.cpp | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index bbbbe8be..d22451d6 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6455,10 +6455,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) if (g.TestEngineHookItems) { IM_ASSERT(window->IDStack.Size == 1); - window->IDStack.Size = 0; IMGUI_TEST_ENGINE_ITEM_ADD(window->Rect(), window->ID); IMGUI_TEST_ENGINE_ITEM_INFO(window->ID, window->Name, (g.HoveredWindow == window) ? ImGuiItemStatusFlags_HoveredRect : 0); - window->IDStack.Size = 1; } #endif diff --git a/imgui.h b/imgui.h index d09f09fb..eb3d8b64 100644 --- a/imgui.h +++ b/imgui.h @@ -65,7 +65,7 @@ Index of this file: // Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) #define IMGUI_VERSION "1.89 WIP" -#define IMGUI_VERSION_NUM 18808 +#define IMGUI_VERSION_NUM 18809 #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) #define IMGUI_HAS_TABLE diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 1f9fb883..09d5ad08 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -3474,6 +3474,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data SetNextItemWidth(ImMax(1.0f, CalcItemWidth() - (button_size + style.ItemInnerSpacing.x) * 2)); if (InputText("", buf, IM_ARRAYSIZE(buf), flags)) // PushId(label) + "" gives us the expected ID from outside point of view value_changed = DataTypeApplyFromText(buf, data_type, p_data, format); + IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags); // Step buttons const ImVec2 backup_frame_padding = style.FramePadding;