Skip to content

Commit 8b9fedb

Browse files
committed
Moved Obsolete function block lower in the file + obsoleted old SetScrollHere (->SetScrollHereY)
1 parent e45847d commit 8b9fedb

File tree

3 files changed

+50
-48
lines changed

3 files changed

+50
-48
lines changed

docs/CHANGELOG.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ HOW TO UPDATE?
3737

3838
Breaking Changes:
3939

40+
- Removed redirecting functions/enums names that were marked obsolete in 1.66 (September 2018):
41+
- ImGui::SetScrollHere() --> use ImGui::SetScrollHereY()
4042
- ImDrawList: upgraded AddPolyline()/PathStroke()'s "bool closed" parameter to use "ImDrawFlags flags".
4143
The matching ImDrawFlags_Closed value is guaranteed to always stay == 1 in the future.
42-
bool closed = false ----> use ImDrawFlags_None, or 0
43-
bool closed = true ----> use ImDrawFlags_Closed
44+
- bool closed = false --> use ImDrawFlags_None, or 0
45+
- bool closed = true --> use ImDrawFlags_Closed
4446
Difference may not be noticeable for most but zealous type-checking tools may report a need to change.
4547
- ImDrawList: clarified that PathArcTo()/PathArcToFast() won't render with radius < 0.0f. Previously it sorts
4648
of accidentally worked but would lead to counter-clockwise paths which and have an effect on anti-aliasing.

imgui.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ CODE
376376
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.
377377
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
378378

379+
- 2021/03/11 (1.82) - removed redirecting functions/enums names that were marked obsolete in 1.66 (September 2018):
380+
- ImGui::SetScrollHere() -> use ImGui::SetScrollHereY()
379381
- 2021/03/11 (1.82) - clarified that ImDrawList::PathArcTo(), ImDrawList::PathArcToFast() won't render with radius < 0.0f. Previously it sorts of accidentally worked but would generally lead to counter-clockwise paths and have an effect on anti-aliasing.
380382
- 2021/03/10 (1.82) - upgraded ImDrawList::AddPolyline() and PathStroke() "bool closed" parameter to "ImDrawFlags flags". The matching ImDrawFlags_Closed value is guaranteed to always stay == 1 in the future.
381383
- 2021/02/22 (1.82) - win32+mingw: Re-enabled IME functions by default even under MinGW. In July 2016, issue #738 had me incorrectly disable those default functions for MinGW. MinGW users should: either link with -limm32, either set their imconfig file with '#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS'.

imgui.h

+44-46
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Index of this file:
2828
// [SECTION] ImGuiStyle
2929
// [SECTION] ImGuiIO
3030
// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs)
31-
// [SECTION] Obsolete functions
3231
// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor)
3332
// [SECTION] Drawing API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawFlags, ImDrawListFlags, ImDrawList, ImDrawData)
3433
// [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont)
3534
// [SECTION] Viewports (ImGuiViewportFlags, ImGuiViewport)
35+
// [SECTION] Obsolete functions and types
3636
3737
*/
3838

@@ -1975,51 +1975,6 @@ struct ImGuiTableSortSpecs
19751975
ImGuiTableSortSpecs() { memset(this, 0, sizeof(*this)); }
19761976
};
19771977

1978-
//-----------------------------------------------------------------------------
1979-
// [SECTION] Obsolete functions
1980-
// (Will be removed! Read 'API BREAKING CHANGES' section in imgui.cpp for details)
1981-
// Please keep your copy of dear imgui up to date! Occasionally set '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' in imconfig.h to stay ahead.
1982-
//-----------------------------------------------------------------------------
1983-
1984-
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
1985-
namespace ImGui
1986-
{
1987-
// OBSOLETED in 1.81 (from February 2021)
1988-
IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // Helper to calculate size from items_count and height_in_items
1989-
static inline bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0, 0)) { return BeginListBox(label, size); }
1990-
static inline void ListBoxFooter() { EndListBox(); }
1991-
// OBSOLETED in 1.79 (from August 2020)
1992-
static inline void OpenPopupContextItem(const char* str_id = NULL, ImGuiMouseButton mb = 1) { OpenPopupOnItemClick(str_id, mb); } // Bool return value removed. Use IsWindowAppearing() in BeginPopup() instead. Renamed in 1.77, renamed back in 1.79. Sorry!
1993-
// OBSOLETED in 1.78 (from June 2020)
1994-
// Old drag/sliders functions that took a 'float power = 1.0' argument instead of flags.
1995-
// For shared code, you can version check at compile-time with `#if IMGUI_VERSION_NUM >= 17704`.
1996-
IMGUI_API bool DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed, const void* p_min, const void* p_max, const char* format, float power);
1997-
IMGUI_API bool DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, const void* p_min, const void* p_max, const char* format, float power);
1998-
static inline bool DragFloat(const char* label, float* v, float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalar(label, ImGuiDataType_Float, v, v_speed, &v_min, &v_max, format, power); }
1999-
static inline bool DragFloat2(const char* label, float v[2], float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalarN(label, ImGuiDataType_Float, v, 2, v_speed, &v_min, &v_max, format, power); }
2000-
static inline bool DragFloat3(const char* label, float v[3], float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalarN(label, ImGuiDataType_Float, v, 3, v_speed, &v_min, &v_max, format, power); }
2001-
static inline bool DragFloat4(const char* label, float v[4], float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalarN(label, ImGuiDataType_Float, v, 4, v_speed, &v_min, &v_max, format, power); }
2002-
IMGUI_API bool SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, float power);
2003-
IMGUI_API bool SliderScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_min, const void* p_max, const char* format, float power);
2004-
static inline bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format, float power) { return SliderScalar(label, ImGuiDataType_Float, v, &v_min, &v_max, format, power); }
2005-
static inline bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* format, float power) { return SliderScalarN(label, ImGuiDataType_Float, v, 2, &v_min, &v_max, format, power); }
2006-
static inline bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* format, float power) { return SliderScalarN(label, ImGuiDataType_Float, v, 3, &v_min, &v_max, format, power); }
2007-
static inline bool SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* format, float power) { return SliderScalarN(label, ImGuiDataType_Float, v, 4, &v_min, &v_max, format, power); }
2008-
// OBSOLETED in 1.77 (from June 2020)
2009-
static inline bool BeginPopupContextWindow(const char* str_id, ImGuiMouseButton mb, bool over_items) { return BeginPopupContextWindow(str_id, mb | (over_items ? 0 : ImGuiPopupFlags_NoOpenOverItems)); }
2010-
// OBSOLETED in 1.72 (from April 2019)
2011-
static inline void TreeAdvanceToLabelPos() { SetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing()); }
2012-
// OBSOLETED in 1.71 (from June 2019)
2013-
static inline void SetNextTreeNodeOpen(bool open, ImGuiCond cond = 0) { SetNextItemOpen(open, cond); }
2014-
// OBSOLETED in 1.70 (from May 2019)
2015-
static inline float GetContentRegionAvailWidth() { return GetContentRegionAvail().x; }
2016-
// OBSOLETED in 1.69 (from Mar 2019)
2017-
static inline ImDrawList* GetOverlayDrawList() { return GetForegroundDrawList(); }
2018-
// OBSOLETED in 1.66 (from Sep 2018)
2019-
static inline void SetScrollHere(float center_ratio=0.5f){ SetScrollHereY(center_ratio); }
2020-
}
2021-
#endif
2022-
20231978
//-----------------------------------------------------------------------------
20241979
// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor)
20251980
//-----------------------------------------------------------------------------
@@ -2792,6 +2747,49 @@ struct ImGuiViewport
27922747
ImVec2 GetWorkCenter() const { return ImVec2(WorkPos.x + WorkSize.x * 0.5f, WorkPos.y + WorkSize.y * 0.5f); }
27932748
};
27942749

2750+
//-----------------------------------------------------------------------------
2751+
// [SECTION] Obsolete functions and types
2752+
// (Will be removed! Read 'API BREAKING CHANGES' section in imgui.cpp for details)
2753+
// Please keep your copy of dear imgui up to date! Occasionally set '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' in imconfig.h to stay ahead.
2754+
//-----------------------------------------------------------------------------
2755+
2756+
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
2757+
namespace ImGui
2758+
{
2759+
// OBSOLETED in 1.81 (from February 2021)
2760+
IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // Helper to calculate size from items_count and height_in_items
2761+
static inline bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0, 0)) { return BeginListBox(label, size); }
2762+
static inline void ListBoxFooter() { EndListBox(); }
2763+
// OBSOLETED in 1.79 (from August 2020)
2764+
static inline void OpenPopupContextItem(const char* str_id = NULL, ImGuiMouseButton mb = 1) { OpenPopupOnItemClick(str_id, mb); } // Bool return value removed. Use IsWindowAppearing() in BeginPopup() instead. Renamed in 1.77, renamed back in 1.79. Sorry!
2765+
// OBSOLETED in 1.78 (from June 2020)
2766+
// Old drag/sliders functions that took a 'float power = 1.0' argument instead of flags.
2767+
// For shared code, you can version check at compile-time with `#if IMGUI_VERSION_NUM >= 17704`.
2768+
IMGUI_API bool DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed, const void* p_min, const void* p_max, const char* format, float power);
2769+
IMGUI_API bool DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, const void* p_min, const void* p_max, const char* format, float power);
2770+
static inline bool DragFloat(const char* label, float* v, float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalar(label, ImGuiDataType_Float, v, v_speed, &v_min, &v_max, format, power); }
2771+
static inline bool DragFloat2(const char* label, float v[2], float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalarN(label, ImGuiDataType_Float, v, 2, v_speed, &v_min, &v_max, format, power); }
2772+
static inline bool DragFloat3(const char* label, float v[3], float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalarN(label, ImGuiDataType_Float, v, 3, v_speed, &v_min, &v_max, format, power); }
2773+
static inline bool DragFloat4(const char* label, float v[4], float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalarN(label, ImGuiDataType_Float, v, 4, v_speed, &v_min, &v_max, format, power); }
2774+
IMGUI_API bool SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, float power);
2775+
IMGUI_API bool SliderScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_min, const void* p_max, const char* format, float power);
2776+
static inline bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format, float power) { return SliderScalar(label, ImGuiDataType_Float, v, &v_min, &v_max, format, power); }
2777+
static inline bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* format, float power) { return SliderScalarN(label, ImGuiDataType_Float, v, 2, &v_min, &v_max, format, power); }
2778+
static inline bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* format, float power) { return SliderScalarN(label, ImGuiDataType_Float, v, 3, &v_min, &v_max, format, power); }
2779+
static inline bool SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* format, float power) { return SliderScalarN(label, ImGuiDataType_Float, v, 4, &v_min, &v_max, format, power); }
2780+
// OBSOLETED in 1.77 (from June 2020)
2781+
static inline bool BeginPopupContextWindow(const char* str_id, ImGuiMouseButton mb, bool over_items) { return BeginPopupContextWindow(str_id, mb | (over_items ? 0 : ImGuiPopupFlags_NoOpenOverItems)); }
2782+
// OBSOLETED in 1.72 (from April 2019)
2783+
static inline void TreeAdvanceToLabelPos() { SetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing()); }
2784+
// OBSOLETED in 1.71 (from June 2019)
2785+
static inline void SetNextTreeNodeOpen(bool open, ImGuiCond cond = 0) { SetNextItemOpen(open, cond); }
2786+
// OBSOLETED in 1.70 (from May 2019)
2787+
static inline float GetContentRegionAvailWidth() { return GetContentRegionAvail().x; }
2788+
// OBSOLETED in 1.69 (from Mar 2019)
2789+
static inline ImDrawList* GetOverlayDrawList() { return GetForegroundDrawList(); }
2790+
}
2791+
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
2792+
27952793
//-----------------------------------------------------------------------------
27962794

27972795
#if defined(__clang__)

0 commit comments

Comments
 (0)