Use -1 to open menu not specific to a given column.
| 3499 | |
| 3500 | // Use -1 to open menu not specific to a given column. |
| 3501 | void ImGui::TableOpenContextMenu(int column_n) |
| 3502 | { |
| 3503 | ImGuiContext& g = *GImGui; |
| 3504 | ImGuiTable* table = g.CurrentTable; |
| 3505 | if (column_n == -1 && table->CurrentColumn != -1) // When called within a column automatically use this one (for consistency) |
| 3506 | column_n = table->CurrentColumn; |
| 3507 | if (column_n == table->ColumnsCount) // To facilitate using with TableGetHoveredColumn() |
| 3508 | column_n = -1; |
| 3509 | IM_ASSERT(column_n >= -1 && column_n < table->ColumnsCount); |
| 3510 | if (table->Flags & (ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable)) |
| 3511 | { |
| 3512 | table->IsContextPopupOpen = true; |
| 3513 | table->ContextPopupColumn = (ImGuiTableColumnIdx)column_n; |
| 3514 | table->InstanceInteracted = table->InstanceCurrent; |
| 3515 | const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID); |
| 3516 | OpenPopupEx(context_menu_id, ImGuiPopupFlags_None); |
| 3517 | } |
| 3518 | } |
| 3519 | |
| 3520 | bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table) |
| 3521 | { |
nothing calls this directly
no test coverage detected