From 5170a9d6dc14c62548d1b7bdb605a1d3019956e2 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 9 Nov 2023 12:22:35 +0100 Subject: [PATCH] Tables: Internals: renamed TableDrawContextMenu() to TableDrawDefaultContextMenu() for clarify. Followup to fea52e2 --- imgui_internal.h | 2 +- imgui_tables.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/imgui_internal.h b/imgui_internal.h index 725ad0af..e1b36268 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -3211,7 +3211,7 @@ namespace ImGui IMGUI_API void TableUpdateBorders(ImGuiTable* table); IMGUI_API void TableUpdateColumnsWeightFromWidth(ImGuiTable* table); IMGUI_API void TableDrawBorders(ImGuiTable* table); - IMGUI_API void TableDrawContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display); + IMGUI_API void TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display); IMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table); IMGUI_API void TableMergeDrawChannels(ImGuiTable* table); inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; } diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 655ad7c7..c9ea4544 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -49,7 +49,7 @@ Index of this file: // | TableSetupDrawChannels() - setup ImDrawList channels // | TableUpdateBorders() - detect hovering columns for resize, ahead of contents submission // | TableBeginContextMenuPopup() -// | - TableDrawContextMenu() - draw right-click context menu contents +// | - TableDrawDefaultContextMenu() - draw right-click context menu contents //----------------------------------------------------------------------------- // - TableHeadersRow() or TableHeader() user submit a headers row (optional) // | TableSortSpecsClickColumn() - when left-clicked: alter sort order and sort direction @@ -1194,11 +1194,11 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // [Part 11] Default context menu // - To append to this menu: you can call TableBeginContextMenuPopup()/.../EndPopup(). // - To modify or replace this: set table->IsContextPopupNoDefaultContents = true, then call TableBeginContextMenuPopup()/.../EndPopup(). - // - You may call TableDrawContextMenu() with selected flags to display specific sections of the default menu, - // e.g. TableDrawContextMenu(table, table->Flags & ~ImGuiTableFlags_Hideable) will display everything EXCEPT columns visibility options. + // - You may call TableDrawDefaultContextMenu() with selected flags to display specific sections of the default menu, + // e.g. TableDrawDefaultContextMenu(table, table->Flags & ~ImGuiTableFlags_Hideable) will display everything EXCEPT columns visibility options. if (table->DisableDefaultContextMenu == false && TableBeginContextMenuPopup(table)) { - TableDrawContextMenu(table, table->Flags); + TableDrawDefaultContextMenu(table, table->Flags); EndPopup(); } @@ -3262,7 +3262,8 @@ void ImGui::TableAngledHeadersRowEx(float angle, float max_label_width) // [SECTION] Tables: Context Menu //------------------------------------------------------------------------- // - TableOpenContextMenu() [Internal] -// - TableDrawContextMenu() [Internal] +// - TableBeginContextMenuPopup() [Internal] +// - TableDrawDefaultContextMenu() [Internal] //------------------------------------------------------------------------- // Use -1 to open menu not specific to a given column. @@ -3304,7 +3305,7 @@ bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table) ////- ImGuiTableFlags_Sortable -> display sorting options (disabled) // - ImGuiTableFlags_Hideable -> display columns visibility menu items // It means if you have a custom context menus you can call this section and omit some sections, and add your own. -void ImGui::TableDrawContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display) +void ImGui::TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow;