mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-27 16:29:02 +08:00
TestEngine: submit window data to item system.
This commit is contained in:
parent
35e197f413
commit
6f73dbea80
15
imgui.cpp
15
imgui.cpp
@ -6306,6 +6306,18 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
}
|
||||
}
|
||||
|
||||
// [Test Engine] Register whole window in the item system
|
||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||
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
|
||||
|
||||
// Handle manual resize: Resize Grips, Borders, Gamepad
|
||||
int border_held = -1;
|
||||
ImU32 resize_grip_col[4] = {};
|
||||
@ -6527,10 +6539,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
// This is useful to allow creating context menus on title bar only, etc.
|
||||
SetLastItemData(window->MoveId, g.CurrentItemFlags, IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0, title_bar_rect);
|
||||
|
||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||
// [Test Engine] Register title bar / tab
|
||||
if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
|
||||
IMGUI_TEST_ENGINE_ITEM_ADD(g.LastItemData.Rect, g.LastItemData.ID);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
2
imgui.h
2
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.87 WIP"
|
||||
#define IMGUI_VERSION_NUM 18615
|
||||
#define IMGUI_VERSION_NUM 18616
|
||||
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
|
||||
#define IMGUI_HAS_TABLE
|
||||
|
||||
|
@ -2907,6 +2907,7 @@ extern const char* ImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ctx, ImGuiI
|
||||
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional)
|
||||
#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
|
||||
#else
|
||||
#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
|
||||
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user