Skip to content

Commit 2e48c2d

Browse files
committed
Removed redirecting functions/enums names that were marked obsolete in 1.63 (August 2018) + tables tweaks.
1 parent 4d8e839 commit 2e48c2d

File tree

5 files changed

+38
-34
lines changed

5 files changed

+38
-34
lines changed

docs/CHANGELOG.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Breaking Changes:
4141
- Backends: moved all backends files (imgui_impl_XXXX.cpp, imgui_impl_XXXX.h) from examples/ to backends/. (#3513)
4242
- Renamed ImDrawList::AddBezierCurve() to ImDrawList::AddBezierCubic(). Kept inline redirection function (will obsolete).
4343
- Renamed ImDrawList::PathBezierCurveTo() to ImDrawList::PathBezierCubicCurveTo(). Kept inline redirection function (will obsolete).
44-
- Removed redirecting functions/enums names that were marked obsolete in 1.60 (April 2017):
44+
- Removed redirecting functions/enums names that were marked obsolete in 1.60 (April 2018):
4545
- io.RenderDrawListsFn pointer -> use ImGui::GetDrawData() value and call the render function of your backend
4646
- ImGui::IsAnyWindowFocused() -> use ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow)
4747
- ImGui::IsAnyWindowHovered() -> use ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow)
@@ -50,6 +50,11 @@ Breaking Changes:
5050
- Removed redirecting functions/enums names that were marked obsolete in 1.61 (May 2018):
5151
- InputFloat (... int decimal_precision ...) -> use InputFloat (... const char* format ...) with format = "%.Xf" where X was value for decimal_precision.
5252
- same for InputFloat2()/InputFloat3()/InputFloat4() variants taking a `int decimal_precision` parameter.
53+
- Removed redirecting functions/enums names that were marked obsolete in 1.63 (August 2018):
54+
- ImGui::IsItemDeactivatedAfterChange() -> use ImGui::IsItemDeactivatedAfterEdit().
55+
- ImGuiCol_ModalWindowDarkening -> use ImGuiCol_ModalWindowDimBg
56+
- ImGuiInputTextCallback -> use ImGuiTextEditCallback
57+
- ImGuiInputTextCallbackData -> use ImGuiTextEditCallbackData
5358
- If you were still using the old names, while you are cleaning up, considering enabling
5459
IMGUI_DISABLE_OBSOLETE_FUNCTIONS in imconfig.h even temporarily to have a pass at finding
5560
and removing up old API calls, if any remaining.

imgui.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,11 @@ CODE
371371
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.
372372
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
373373

374+
- 2020/10/12 (1.80) - removed redirecting functions/enums that were marked obsolete in 1.63 (August 2018):
375+
- ImGui::IsItemDeactivatedAfterChange() -> use ImGui::IsItemDeactivatedAfterEdit().
376+
- ImGuiCol_ModalWindowDarkening -> use ImGuiCol_ModalWindowDimBg
377+
- ImGuiInputTextCallback -> use ImGuiTextEditCallback
378+
- ImGuiInputTextCallbackData -> use ImGuiTextEditCallbackData
374379
- 2020/12/21 (1.80) - renamed ImDrawList::AddBezierCurve() to AddBezierCubic(), and PathBezierCurveTo() to PathBezierCubicCurveTo(). Kept inline redirection function (will obsolete).
375380
- 2020/12/04 (1.80) - added imgui_tables.cpp file! Manually constructed project files will need the new file added!
376381
- 2020/11/18 (1.80) - renamed undocumented/internals ImGuiColumnsFlags_* to ImGuiOldColumnFlags_* in prevision of incoming Tables API.

imgui.h

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,21 +1074,21 @@ enum ImGuiTableFlags_
10741074
ImGuiTableFlags_ColumnsWidthStretch = 1 << 13, // Default if ScrollX is off. Columns will default to use _WidthStretch. Read description above for more details.
10751075
ImGuiTableFlags_ColumnsWidthFixed = 1 << 14, // Default if ScrollX is on. Columns will default to use _WidthFixed or _WidthAutoResize policy (if Resizable is off). Read description above for more details.
10761076
ImGuiTableFlags_SameWidths = 1 << 15, // Make all columns the same widths which is useful with Fixed columns policy (but granted by default with Stretch policy + no resize). Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible and disable ImGuiTableFlags_Resizable.
1077-
ImGuiTableFlags_NoHostExtendY = 1 << 17, // Disable extending table past the limit set by outer_size.y. Only meaningful when neither ScrollX nor ScrollY are set (data below the limit will be clipped and not visible)
1078-
ImGuiTableFlags_NoKeepColumnsVisible = 1 << 18, // Disable keeping column always minimally visible when ScrollX is off and table gets too small.
1079-
ImGuiTableFlags_PreciseWidths = 1 << 19, // Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
1077+
ImGuiTableFlags_NoHostExtendY = 1 << 16, // Disable extending table past the limit set by outer_size.y. Only meaningful when neither ScrollX nor ScrollY are set (data below the limit will be clipped and not visible)
1078+
ImGuiTableFlags_NoKeepColumnsVisible = 1 << 17, // Disable keeping column always minimally visible when ScrollX is off and table gets too small.
1079+
ImGuiTableFlags_PreciseWidths = 1 << 18, // Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
10801080
// Clipping
1081-
ImGuiTableFlags_NoClip = 1 << 20, // Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
1081+
ImGuiTableFlags_NoClip = 1 << 19, // Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
10821082
// Padding
1083-
ImGuiTableFlags_PadOuterX = 1 << 21, // Default if BordersOuterV is on. Enable outer-most padding.
1084-
ImGuiTableFlags_NoPadOuterX = 1 << 22, // Default if BordersOuterV is off. Disable outer-most padding.
1085-
ImGuiTableFlags_NoPadInnerX = 1 << 23, // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
1083+
ImGuiTableFlags_PadOuterX = 1 << 20, // Default if BordersOuterV is on. Enable outer-most padding.
1084+
ImGuiTableFlags_NoPadOuterX = 1 << 21, // Default if BordersOuterV is off. Disable outer-most padding.
1085+
ImGuiTableFlags_NoPadInnerX = 1 << 22, // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
10861086
// Scrolling
1087-
ImGuiTableFlags_ScrollX = 1 << 24, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
1088-
ImGuiTableFlags_ScrollY = 1 << 25, // Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
1087+
ImGuiTableFlags_ScrollX = 1 << 23, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
1088+
ImGuiTableFlags_ScrollY = 1 << 24, // Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
10891089
// Sorting
1090-
ImGuiTableFlags_SortMulti = 1 << 26, // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
1091-
ImGuiTableFlags_SortTristate = 1 << 27 // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
1090+
ImGuiTableFlags_SortMulti = 1 << 25, // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
1091+
ImGuiTableFlags_SortTristate = 1 << 26 // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
10921092
};
10931093

10941094
// Flags for ImGui::TableSetupColumn()
@@ -1392,11 +1392,6 @@ enum ImGuiCol_
13921392
ImGuiCol_NavWindowingDimBg, // Darken/colorize entire screen behind the CTRL+TAB window list, when active
13931393
ImGuiCol_ModalWindowDimBg, // Darken/colorize entire screen behind a modal window, when one is active
13941394
ImGuiCol_COUNT
1395-
1396-
// Obsolete names (will be removed)
1397-
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
1398-
, ImGuiCol_ModalWindowDarkening = ImGuiCol_ModalWindowDimBg // [renamed in 1.63]
1399-
#endif
14001395
};
14011396

14021397
// Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure.
@@ -1726,8 +1721,8 @@ struct ImGuiIO
17261721

17271722
// Miscellaneous options
17281723
bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations.
1729-
bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl (was called io.OptMacOSXBehaviors prior to 1.63)
1730-
bool ConfigInputTextCursorBlink; // = true // Set to false to disable blinking cursor, for users who consider it distracting. (was called: io.OptCursorBlink prior to 1.63)
1724+
bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl.
1725+
bool ConfigInputTextCursorBlink; // = true // Set to false to disable blinking cursor, for users who consider it distracting.
17311726
bool ConfigWindowsResizeFromEdges; // = true // Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag)
17321727
bool ConfigWindowsMoveFromTitleBarOnly; // = false // [BETA] Set to true to only allow moving windows when clicked+dragged from the title bar. Windows without a title bar are not affected.
17331728
float ConfigMemoryCompactTimer; // = 60.0f // [BETA] Free transient windows/tables memory buffers when unused for given amount of time. Set to -1.0f to disable.
@@ -1960,11 +1955,7 @@ namespace ImGui
19601955
static inline ImDrawList* GetOverlayDrawList() { return GetForegroundDrawList(); }
19611956
// OBSOLETED in 1.66 (from Sep 2018)
19621957
static inline void SetScrollHere(float center_ratio=0.5f){ SetScrollHereY(center_ratio); }
1963-
// OBSOLETED in 1.63 (between Aug 2018 and Sept 2018)
1964-
static inline bool IsItemDeactivatedAfterChange() { return IsItemDeactivatedAfterEdit(); }
19651958
}
1966-
typedef ImGuiInputTextCallback ImGuiTextEditCallback; // OBSOLETED in 1.63 (from Aug 2018): made the names consistent
1967-
typedef ImGuiInputTextCallbackData ImGuiTextEditCallbackData;
19681959
#endif
19691960

19701961
//-----------------------------------------------------------------------------

imgui_demo.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3594,8 +3594,10 @@ static void ShowDemoWindowTables()
35943594
"Fixed-width columns generally makes more sense if you want to use horizontal scrolling.\n\n"
35953595
"Double-click a column border to auto-fit the column to its contents.");
35963596
static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_ColumnsWidthFixed | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_ContextMenuInBody;
3597-
//ImGui::CheckboxFlags("ImGuiTableFlags_ScrollX", &flags, ImGuiTableFlags_ScrollX); // FIXME-TABLE: Explain or fix the effect of enable Scroll on outer_size
3598-
if (ImGui::BeginTable("##table1", 3, flags))
3597+
static bool use_all_width = true;
3598+
ImGui::Checkbox("Use all width", &use_all_width);
3599+
3600+
if (ImGui::BeginTable("##table1", 3, flags, ImVec2(use_all_width ? -FLT_MIN : 0.0f, 0.0f)))
35993601
{
36003602
for (int row = 0; row < 5; row++)
36013603
{
@@ -3663,7 +3665,7 @@ static void ShowDemoWindowTables()
36633665
if (ImGui::TreeNode("Reorderable, hideable, with headers"))
36643666
{
36653667
HelpMarker("Click and drag column headers to reorder columns.\n\nYou can also right-click on a header to open a context menu.");
3666-
static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_NoBordersInBody;
3668+
static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV;
36673669
PushStyleCompact();
36683670
ImGui::CheckboxFlags("ImGuiTableFlags_Resizable", &flags, ImGuiTableFlags_Resizable);
36693671
ImGui::CheckboxFlags("ImGuiTableFlags_Reorderable", &flags, ImGuiTableFlags_Reorderable);
@@ -4026,7 +4028,7 @@ static void ShowDemoWindowTables()
40264028
{
40274029
HelpMarker("This demonstrate embedding a table into another table cell.");
40284030

4029-
if (ImGui::BeginTable("recurse1", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable))
4031+
if (ImGui::BeginTable("recurse1", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable))
40304032
{
40314033
ImGui::TableSetupColumn("A0");
40324034
ImGui::TableSetupColumn("A1");
@@ -4036,7 +4038,7 @@ static void ShowDemoWindowTables()
40364038
ImGui::Text("A0 Cell 0");
40374039
{
40384040
float rows_height = TEXT_BASE_HEIGHT * 2;
4039-
if (ImGui::BeginTable("recurse2", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable))
4041+
if (ImGui::BeginTable("recurse2", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable))
40404042
{
40414043
ImGui::TableSetupColumn("B0");
40424044
ImGui::TableSetupColumn("B1");

imgui_tables.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,10 +2295,11 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
22952295
void ImGui::TableDrawBorders(ImGuiTable* table)
22962296
{
22972297
ImGuiWindow* inner_window = table->InnerWindow;
2298-
table->DrawSplitter.SetCurrentChannel(inner_window->DrawList, TABLE_DRAW_CHANNEL_BG0);
22992298
if (inner_window->Hidden || !table->HostClipRect.Overlaps(table->InnerClipRect))
23002299
return;
2300+
23012301
ImDrawList* inner_drawlist = inner_window->DrawList;
2302+
table->DrawSplitter.SetCurrentChannel(inner_drawlist, TABLE_DRAW_CHANNEL_BG0);
23022303
inner_drawlist->PushClipRect(table->Bg0ClipRectForDrawCmd.Min, table->Bg0ClipRectForDrawCmd.Max, false);
23032304

23042305
// Draw inner border and resizing feedback
@@ -2318,20 +2319,20 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
23182319
const bool is_hovered = (table->HoveredColumnBorder == column_n);
23192320
const bool is_resized = (table->ResizedColumn == column_n) && (table->InstanceInteracted == table->InstanceCurrent);
23202321
const bool is_resizable = (column->Flags & (ImGuiTableColumnFlags_NoResize | ImGuiTableColumnFlags_NoDirectResize_)) == 0;
2322+
const bool is_frozen_separator = (table->FreezeColumnsCount != -1 && table->FreezeColumnsCount == order_n + 1);
23212323

23222324
if (column->MaxX > table->InnerClipRect.Max.x && !is_resized)// && is_hovered)
23232325
continue;
2324-
if (column->NextEnabledColumn == -1 && !is_resizable)
2325-
if ((table->Flags & ImGuiTableFlags_SameWidths) == 0)
2326-
continue;
2326+
if (column->NextEnabledColumn == -1 && !is_resizable && (table->Flags & ImGuiTableFlags_SameWidths) == 0)
2327+
continue;
23272328
if (column->MaxX <= column->ClipRect.Min.x) // FIXME-TABLE FIXME-STYLE: Assume BorderSize==1, this is problematic if we want to increase the border size..
23282329
continue;
23292330

23302331
// Draw in outer window so right-most column won't be clipped
23312332
// Always draw full height border when being resized/hovered, or on the delimitation of frozen column scrolling.
23322333
ImU32 col;
23332334
float draw_y2;
2334-
if (is_hovered || is_resized || (table->FreezeColumnsCount != -1 && table->FreezeColumnsCount == order_n + 1))
2335+
if (is_hovered || is_resized || is_frozen_separator)
23352336
{
23362337
draw_y2 = draw_y2_body;
23372338
col = is_resized ? GetColorU32(ImGuiCol_SeparatorActive) : is_hovered ? GetColorU32(ImGuiCol_SeparatorHovered) : table->BorderColorStrong;
@@ -2348,7 +2349,7 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
23482349
}
23492350

23502351
// Draw outer border
2351-
// FIXME-TABLE: could use AddRect or explicit VLine/HLine helper?
2352+
// FIXME: could use AddRect or explicit VLine/HLine helper?
23522353
if (table->Flags & ImGuiTableFlags_BordersOuter)
23532354
{
23542355
// Display outer border offset by 1 which is a simple way to display it without adding an extra draw call

0 commit comments

Comments
 (0)