Use -1 to open menu not specific to a given column.
| 3477 | |
| 3478 | // Use -1 to open menu not specific to a given column. |
| 3479 | void ImGui::TableOpenContextMenu(int column_n) |
| 3480 | { |
| 3481 | ImGuiContext& g = *GImGui; |
| 3482 | ImGuiTable* table = g.CurrentTable; |
| 3483 | if (column_n == -1 && table->CurrentColumn != -1) // When called within a column automatically use this one (for consistency) |
| 3484 | column_n = table->CurrentColumn; |
| 3485 | if (column_n == table->ColumnsCount) // To facilitate using with TableGetHoveredColumn() |
| 3486 | column_n = -1; |
| 3487 | IM_ASSERT(column_n >= -1 && column_n < table->ColumnsCount); |
| 3488 | if (table->Flags & (ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable)) |
| 3489 | { |
| 3490 | table->IsContextPopupOpen = true; |
| 3491 | table->ContextPopupColumn = (ImGuiTableColumnIdx)column_n; |
| 3492 | table->InstanceInteracted = table->InstanceCurrent; |
| 3493 | const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID); |
| 3494 | OpenPopupEx(context_menu_id, ImGuiPopupFlags_None); |
| 3495 | } |
| 3496 | } |
| 3497 | |
| 3498 | bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table) |
| 3499 | { |
nothing calls this directly
no test coverage detected