MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / TableOpenContextMenu

Method TableOpenContextMenu

plugins/Cardinal/src/DearImGui/imgui_tables.cpp:3001–3018  ·  view source on GitHub ↗

Use -1 to open menu not specific to a given column.

Source from the content-addressed store, hash-verified

2999
3000// Use -1 to open menu not specific to a given column.
3001void ImGui::TableOpenContextMenu(int column_n)
3002{
3003 ImGuiContext& g = *GImGui;
3004 ImGuiTable* table = g.CurrentTable;
3005 if (column_n == -1 && table->CurrentColumn != -1) // When called within a column automatically use this one (for consistency)
3006 column_n = table->CurrentColumn;
3007 if (column_n == table->ColumnsCount) // To facilitate using with TableGetHoveredColumn()
3008 column_n = -1;
3009 IM_ASSERT(column_n >= -1 && column_n < table->ColumnsCount);
3010 if (table->Flags & (ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable))
3011 {
3012 table->IsContextPopupOpen = true;
3013 table->ContextPopupColumn = (ImGuiTableColumnIdx)column_n;
3014 table->InstanceInteracted = table->InstanceCurrent;
3015 const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID);
3016 OpenPopupEx(context_menu_id, ImGuiPopupFlags_None);
3017 }
3018}
3019
3020// Output context menu into current window (generally a popup)
3021// FIXME-TABLE: Ideally this should be writable by the user. Full programmatic access to that data?

Callers

nothing calls this directly

Calls 1

ImHashStrFunction · 0.85

Tested by

no test coverage detected