|
@@ -1499,7 +1499,7 @@ void ImGui::TableSetupScrollFreeze(int columns, int rows)
|
|
// - TableGetColumnCount()
|
|
// - TableGetColumnCount()
|
|
// - TableGetColumnName()
|
|
// - TableGetColumnName()
|
|
// - TableGetColumnName() [Internal]
|
|
// - TableGetColumnName() [Internal]
|
|
-// - TableSetColumnEnabled() [Internal]
|
|
|
|
|
|
+// - TableSetColumnEnabled()
|
|
// - TableGetColumnFlags()
|
|
// - TableGetColumnFlags()
|
|
// - TableGetCellBgRect() [Internal]
|
|
// - TableGetCellBgRect() [Internal]
|
|
// - TableGetColumnResizeID() [Internal]
|
|
// - TableGetColumnResizeID() [Internal]
|
|
@@ -1535,10 +1535,11 @@ const char* ImGui::TableGetColumnName(const ImGuiTable* table, int column_n)
|
|
return &table->ColumnsNames.Buf[column->NameOffset];
|
|
return &table->ColumnsNames.Buf[column->NameOffset];
|
|
}
|
|
}
|
|
|
|
|
|
-// Request enabling/disabling a column (often perceived as "showing/hiding" from users point of view)
|
|
|
|
|
|
+// 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)
|
|
// 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)
|
|
-// Request will be applied during next layout, which happens on the first call to TableNextRow() after BeginTable()
|
|
|
|
-// For the getter you can use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsEnabled)
|
|
|
|
|
|
+// - Require table to have the ImGuiTableFlags_Hideable flag because we are manipulating user accessible state.
|
|
|
|
+// - Request will be applied during next layout, which happens on the first call to TableNextRow() after BeginTable().
|
|
|
|
+// - For the getter you can test (TableGetColumnFlags() & ImGuiTableColumnFlags_IsEnabled) != 0.
|
|
void ImGui::TableSetColumnEnabled(int column_n, bool enabled)
|
|
void ImGui::TableSetColumnEnabled(int column_n, bool enabled)
|
|
{
|
|
{
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
@@ -1546,6 +1547,7 @@ void ImGui::TableSetColumnEnabled(int column_n, bool enabled)
|
|
IM_ASSERT(table != NULL);
|
|
IM_ASSERT(table != NULL);
|
|
if (!table)
|
|
if (!table)
|
|
return;
|
|
return;
|
|
|
|
+ IM_ASSERT(table->Flags & ImGuiTableFlags_Hideable); // See comments above
|
|
if (column_n < 0)
|
|
if (column_n < 0)
|
|
column_n = table->CurrentColumn;
|
|
column_n = table->CurrentColumn;
|
|
IM_ASSERT(column_n >= 0 && column_n < table->ColumnsCount);
|
|
IM_ASSERT(column_n >= 0 && column_n < table->ColumnsCount);
|