MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / TableOpenContextMenu

Method TableOpenContextMenu

Source/3rdParty/imgui/imgui_tables.cpp:3501–3518  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3499
3500// Use -1 to open menu not specific to a given column.
3501void 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
3520bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table)
3521{

Callers

nothing calls this directly

Calls 1

ImHashStrFunction · 0.85

Tested by

no test coverage detected