MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / TableSetColumnEnabled

Method TableSetColumnEnabled

include/imgui/imgui_tables.cpp:1777–1788  ·  view source on GitHub ↗

Change user accessible enabled/disabled state of a column (often perceived as "showing/hiding" from users point of view) Note that end-user can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody) - Require table to have the ImGuiTableFlags_Hideable flag because we are manipulating user accessible state. - Re

Source from the content-addressed store, hash-verified

1775// - For the getter you can test (TableGetColumnFlags() & ImGuiTableColumnFlags_IsEnabled) != 0.
1776// - Alternative: the ImGuiTableColumnFlags_Disabled is an overriding/master disable flag which will also hide the column from context menu.
1777void ImGui::TableSetColumnEnabled(int column_n, bool enabled)
1778{
1779 ImGuiContext& g = *GImGui;
1780 ImGuiTable* table = g.CurrentTable;
1781 IM_ASSERT_USER_ERROR_RET(table != NULL, "Call should only be done while in BeginTable() scope!");
1782 IM_ASSERT(table->Flags & ImGuiTableFlags_Hideable); // See comments above
1783 if (column_n < 0)
1784 column_n = table->CurrentColumn;
1785 IM_ASSERT(column_n >= 0 && column_n < table->ColumnsCount);
1786 ImGuiTableColumn* column = &table->Columns[column_n];
1787 column->IsUserEnabledNextFrame = enabled;
1788}
1789
1790// We allow querying for an extra column in order to poll the IsHovered state of the right-most section
1791ImGuiTableColumnFlags ImGui::TableGetColumnFlags(int column_n)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected