Use -1 to open menu not specific to a given column.
| 3023 | |
| 3024 | // Use -1 to open menu not specific to a given column. |
| 3025 | void ImGui::TableOpenContextMenu(int column_n) |
| 3026 | { |
| 3027 | ImGuiContext& g = *GImGui; |
| 3028 | ImGuiTable* table = g.CurrentTable; |
| 3029 | if (column_n == -1 && table->CurrentColumn != -1) // When called within a column automatically use this one (for consistency) |
| 3030 | column_n = table->CurrentColumn; |
| 3031 | if (column_n == table->ColumnsCount) // To facilitate using with TableGetHoveredColumn() |
| 3032 | column_n = -1; |
| 3033 | IM_ASSERT(column_n >= -1 && column_n < table->ColumnsCount); |
| 3034 | if (table->Flags & (ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable)) |
| 3035 | { |
| 3036 | table->IsContextPopupOpen = true; |
| 3037 | table->ContextPopupColumn = (ImGuiTableColumnIdx)column_n; |
| 3038 | table->InstanceInteracted = table->InstanceCurrent; |
| 3039 | const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID); |
| 3040 | OpenPopupEx(context_menu_id, ImGuiPopupFlags_None); |
| 3041 | } |
| 3042 | } |
| 3043 | |
| 3044 | bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table) |
| 3045 | { |
nothing calls this directly
no test coverage detected