|
@@ -342,6 +342,7 @@ CODE
|
|
|
When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
|
|
When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
|
|
|
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
|
|
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
|
|
|
|
|
|
|
|
|
|
+ - 2018/10/12 (1.66) - Renamed misc/stl/imgui_stl.* to misc/cpp/imgui_stdlib.* in prevision for other C++ helper files.
|
|
|
- 2018/09/28 (1.66) - renamed SetScrollHere() to SetScrollHereY(). Kept redirection function (will obsolete).
|
|
- 2018/09/28 (1.66) - renamed SetScrollHere() to SetScrollHereY(). Kept redirection function (will obsolete).
|
|
|
- 2018/09/06 (1.65) - renamed stb_truetype.h to imstb_truetype.h, stb_textedit.h to imstb_textedit.h, and stb_rect_pack.h to imstb_rectpack.h.
|
|
- 2018/09/06 (1.65) - renamed stb_truetype.h to imstb_truetype.h, stb_textedit.h to imstb_textedit.h, and stb_rect_pack.h to imstb_rectpack.h.
|
|
|
If you were conveniently using the imgui copy of those STB headers in your project you will have to update your include paths.
|
|
If you were conveniently using the imgui copy of those STB headers in your project you will have to update your include paths.
|
|
@@ -855,6 +856,7 @@ CODE
|
|
|
#include <stdint.h> // intptr_t
|
|
#include <stdint.h> // intptr_t
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+// Debug options
|
|
|
#define IMGUI_DEBUG_NAV_SCORING 0
|
|
#define IMGUI_DEBUG_NAV_SCORING 0
|
|
|
#define IMGUI_DEBUG_NAV_RECTS 0
|
|
#define IMGUI_DEBUG_NAV_RECTS 0
|
|
|
|
|
|
|
@@ -951,6 +953,14 @@ static void UpdateMouseWheel();
|
|
|
static void UpdateManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4]);
|
|
static void UpdateManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// Test engine hooks (imgui-test)
|
|
|
|
|
+//#define IMGUI_ENABLE_TEST_ENGINE_HOOKS
|
|
|
|
|
+#ifdef IMGUI_ENABLE_TEST_ENGINE_HOOKS
|
|
|
|
|
+extern void ImGuiTestEngineHook_PreNewFrame();
|
|
|
|
|
+extern void ImGuiTestEngineHook_PostNewFrame();
|
|
|
|
|
+extern void ImGuiTestEngineHook_ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg);
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
//-----------------------------------------------------------------------------
|
|
//-----------------------------------------------------------------------------
|
|
|
// [SECTION] CONTEXT AND MEMORY ALLOCATORS
|
|
// [SECTION] CONTEXT AND MEMORY ALLOCATORS
|
|
|
//-----------------------------------------------------------------------------
|
|
//-----------------------------------------------------------------------------
|
|
@@ -1213,6 +1223,7 @@ const char* ImStrchrRange(const char* str, const char* str_end, char c)
|
|
|
|
|
|
|
|
int ImStrlenW(const ImWchar* str)
|
|
int ImStrlenW(const ImWchar* str)
|
|
|
{
|
|
{
|
|
|
|
|
+ //return (int)wcslen((const wchar_t*)str); // FIXME-OPT: Could use this when wchar_t are 16-bits
|
|
|
int n = 0;
|
|
int n = 0;
|
|
|
while (*str++) n++;
|
|
while (*str++) n++;
|
|
|
return n;
|
|
return n;
|
|
@@ -2591,6 +2602,10 @@ void ImGui::ItemSize(const ImRect& bb, float text_offset_y)
|
|
|
// declare their minimum size requirement to ItemSize() and then use a larger region for drawing/interaction, which is passed to ItemAdd().
|
|
// declare their minimum size requirement to ItemSize() and then use a larger region for drawing/interaction, which is passed to ItemAdd().
|
|
|
bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg)
|
|
bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg)
|
|
|
{
|
|
{
|
|
|
|
|
+#ifdef IMGUI_ENABLE_TEST_ENGINE_HOOKS
|
|
|
|
|
+ ImGuiTestEngineHook_ItemAdd(bb, id, nav_bb_arg);
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
|
|
|
|
@@ -3104,6 +3119,10 @@ void ImGui::NewFrame()
|
|
|
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?");
|
|
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?");
|
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
|
|
|
|
|
|
|
|
+#ifdef IMGUI_ENABLE_TEST_ENGINE_HOOKS
|
|
|
|
|
+ ImGuiTestEngineHook_PreNewFrame();
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
// Check user data
|
|
// Check user data
|
|
|
// (We pass an error message in the assert expression to make it visible to programmers who are not using a debugger, as most assert handlers display their argument)
|
|
// (We pass an error message in the assert expression to make it visible to programmers who are not using a debugger, as most assert handlers display their argument)
|
|
|
IM_ASSERT(g.Initialized);
|
|
IM_ASSERT(g.Initialized);
|
|
@@ -3269,6 +3288,10 @@ void ImGui::NewFrame()
|
|
|
// We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags.
|
|
// We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags.
|
|
|
SetNextWindowSize(ImVec2(400,400), ImGuiCond_FirstUseEver);
|
|
SetNextWindowSize(ImVec2(400,400), ImGuiCond_FirstUseEver);
|
|
|
Begin("Debug##Default");
|
|
Begin("Debug##Default");
|
|
|
|
|
+
|
|
|
|
|
+#ifdef IMGUI_ENABLE_TEST_ENGINE_HOOKS
|
|
|
|
|
+ ImGuiTestEngineHook_PostNewFrame();
|
|
|
|
|
+#endif
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void ImGui::Initialize(ImGuiContext* context)
|
|
void ImGui::Initialize(ImGuiContext* context)
|
|
@@ -3294,7 +3317,10 @@ void ImGui::Shutdown(ImGuiContext* context)
|
|
|
// The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
|
|
// The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
|
|
|
ImGuiContext& g = *context;
|
|
ImGuiContext& g = *context;
|
|
|
if (g.IO.Fonts && g.FontAtlasOwnedByContext)
|
|
if (g.IO.Fonts && g.FontAtlasOwnedByContext)
|
|
|
|
|
+ {
|
|
|
|
|
+ g.IO.Fonts->Locked = false;
|
|
|
IM_DELETE(g.IO.Fonts);
|
|
IM_DELETE(g.IO.Fonts);
|
|
|
|
|
+ }
|
|
|
g.IO.Fonts = NULL;
|
|
g.IO.Fonts = NULL;
|
|
|
|
|
|
|
|
// Cleanup of other data are conditional on actually having initialized ImGui.
|
|
// Cleanup of other data are conditional on actually having initialized ImGui.
|
|
@@ -4313,12 +4339,12 @@ ImVec2 ImGui::CalcWindowExpectedSize(ImGuiWindow* window)
|
|
|
return CalcSizeAfterConstraint(window, CalcSizeAutoFit(window, size_contents));
|
|
return CalcSizeAfterConstraint(window, CalcSizeAutoFit(window, size_contents));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static float GetScrollMaxX(ImGuiWindow* window)
|
|
|
|
|
|
|
+float ImGui::GetWindowScrollMaxX(ImGuiWindow* window)
|
|
|
{
|
|
{
|
|
|
return ImMax(0.0f, window->SizeContents.x - (window->SizeFull.x - window->ScrollbarSizes.x));
|
|
return ImMax(0.0f, window->SizeContents.x - (window->SizeFull.x - window->ScrollbarSizes.x));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static float GetScrollMaxY(ImGuiWindow* window)
|
|
|
|
|
|
|
+float ImGui::GetWindowScrollMaxY(ImGuiWindow* window)
|
|
|
{
|
|
{
|
|
|
return ImMax(0.0f, window->SizeContents.y - (window->SizeFull.y - window->ScrollbarSizes.y));
|
|
return ImMax(0.0f, window->SizeContents.y - (window->SizeFull.y - window->ScrollbarSizes.y));
|
|
|
}
|
|
}
|
|
@@ -4346,8 +4372,8 @@ static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window, bool s
|
|
|
scroll = ImMax(scroll, ImVec2(0.0f, 0.0f));
|
|
scroll = ImMax(scroll, ImVec2(0.0f, 0.0f));
|
|
|
if (!window->Collapsed && !window->SkipItems)
|
|
if (!window->Collapsed && !window->SkipItems)
|
|
|
{
|
|
{
|
|
|
- scroll.x = ImMin(scroll.x, GetScrollMaxX(window));
|
|
|
|
|
- scroll.y = ImMin(scroll.y, GetScrollMaxY(window));
|
|
|
|
|
|
|
+ scroll.x = ImMin(scroll.x, ImGui::GetWindowScrollMaxX(window));
|
|
|
|
|
+ scroll.y = ImMin(scroll.y, ImGui::GetWindowScrollMaxY(window));
|
|
|
}
|
|
}
|
|
|
return scroll;
|
|
return scroll;
|
|
|
}
|
|
}
|
|
@@ -6013,12 +6039,12 @@ float ImGui::GetScrollY()
|
|
|
|
|
|
|
|
float ImGui::GetScrollMaxX()
|
|
float ImGui::GetScrollMaxX()
|
|
|
{
|
|
{
|
|
|
- return GetScrollMaxX(GImGui->CurrentWindow);
|
|
|
|
|
|
|
+ return GetWindowScrollMaxX(GImGui->CurrentWindow);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
float ImGui::GetScrollMaxY()
|
|
float ImGui::GetScrollMaxY()
|
|
|
{
|
|
{
|
|
|
- return GetScrollMaxY(GImGui->CurrentWindow);
|
|
|
|
|
|
|
+ return GetWindowScrollMaxY(GImGui->CurrentWindow);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void ImGui::SetScrollX(float scroll_x)
|
|
void ImGui::SetScrollX(float scroll_x)
|
|
@@ -8922,7 +8948,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
(flags & ImGuiWindowFlags_ChildWindow) ? "Child " : "", (flags & ImGuiWindowFlags_Tooltip) ? "Tooltip " : "", (flags & ImGuiWindowFlags_Popup) ? "Popup " : "",
|
|
(flags & ImGuiWindowFlags_ChildWindow) ? "Child " : "", (flags & ImGuiWindowFlags_Tooltip) ? "Tooltip " : "", (flags & ImGuiWindowFlags_Popup) ? "Popup " : "",
|
|
|
(flags & ImGuiWindowFlags_Modal) ? "Modal " : "", (flags & ImGuiWindowFlags_ChildMenu) ? "ChildMenu " : "", (flags & ImGuiWindowFlags_NoSavedSettings) ? "NoSavedSettings " : "",
|
|
(flags & ImGuiWindowFlags_Modal) ? "Modal " : "", (flags & ImGuiWindowFlags_ChildMenu) ? "ChildMenu " : "", (flags & ImGuiWindowFlags_NoSavedSettings) ? "NoSavedSettings " : "",
|
|
|
(flags & ImGuiWindowFlags_NoInputs) ? "NoInputs":"", (flags & ImGuiWindowFlags_AlwaysAutoResize) ? "AlwaysAutoResize" : "");
|
|
(flags & ImGuiWindowFlags_NoInputs) ? "NoInputs":"", (flags & ImGuiWindowFlags_AlwaysAutoResize) ? "AlwaysAutoResize" : "");
|
|
|
- ImGui::BulletText("Scroll: (%.2f/%.2f,%.2f/%.2f)", window->Scroll.x, GetScrollMaxX(window), window->Scroll.y, GetScrollMaxY(window));
|
|
|
|
|
|
|
+ ImGui::BulletText("Scroll: (%.2f/%.2f,%.2f/%.2f)", window->Scroll.x, GetWindowScrollMaxX(window), window->Scroll.y, GetWindowScrollMaxY(window));
|
|
|
ImGui::BulletText("Active: %d/%d, WriteAccessed: %d, BeginOrderWithinContext: %d", window->Active, window->WasActive, window->WriteAccessed, (window->Active || window->WasActive) ? window->BeginOrderWithinContext : -1);
|
|
ImGui::BulletText("Active: %d/%d, WriteAccessed: %d, BeginOrderWithinContext: %d", window->Active, window->WasActive, window->WriteAccessed, (window->Active || window->WasActive) ? window->BeginOrderWithinContext : -1);
|
|
|
ImGui::BulletText("Appearing: %d, Hidden: %d (Reg %d Resize %d), SkipItems: %d", window->Appearing, window->Hidden, window->HiddenFramesRegular, window->HiddenFramesForResize, window->SkipItems);
|
|
ImGui::BulletText("Appearing: %d, Hidden: %d (Reg %d Resize %d), SkipItems: %d", window->Appearing, window->Hidden, window->HiddenFramesRegular, window->HiddenFramesForResize, window->SkipItems);
|
|
|
ImGui::BulletText("NavLastIds: 0x%08X,0x%08X, NavLayerActiveMask: %X", window->NavLastIds[0], window->NavLastIds[1], window->DC.NavLayerActiveMask);
|
|
ImGui::BulletText("NavLastIds: 0x%08X,0x%08X, NavLayerActiveMask: %X", window->NavLastIds[0], window->NavLastIds[1], window->DC.NavLayerActiveMask);
|