MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / TableInitColumnDefaults

Function TableInitColumnDefaults

external/imgui/imgui_tables.cpp:1634–1655  ·  view source on GitHub ↗

Called in TableSetupColumn() when initializing and in TableLoadSettings() for defaults before applying stored settings. 'init_mask' specify which fields to initialize.

Source from the content-addressed store, hash-verified

1632// Called in TableSetupColumn() when initializing and in TableLoadSettings() for defaults before applying stored settings.
1633// 'init_mask' specify which fields to initialize.
1634static void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column, ImGuiTableColumnFlags init_mask)
1635{
1636 ImGuiTableColumnFlags flags = column->Flags;
1637 if (init_mask & ImGuiTableFlags_Resizable)
1638 {
1639 float init_width_or_weight = column->InitStretchWeightOrWidth;
1640 column->WidthRequest = ((flags & ImGuiTableColumnFlags_WidthFixed) && init_width_or_weight > 0.0f) ? init_width_or_weight : -1.0f;
1641 column->StretchWeight = (init_width_or_weight > 0.0f && (flags & ImGuiTableColumnFlags_WidthStretch)) ? init_width_or_weight : -1.0f;
1642 if (init_width_or_weight > 0.0f) // Disable auto-fit if an explicit width/weight has been specified
1643 column->AutoFitQueue = 0x00;
1644 }
1645 if (init_mask & ImGuiTableFlags_Reorderable)
1646 column->DisplayOrder = (ImGuiTableColumnIdx)table->Columns.index_from_ptr(column);
1647 if (init_mask & ImGuiTableFlags_Hideable)
1648 column->IsUserEnabled = column->IsUserEnabledNextFrame = (flags & ImGuiTableColumnFlags_DefaultHide) ? 0 : 1;
1649 if (init_mask & ImGuiTableFlags_Sortable)
1650 {
1651 // Multiple columns using _DefaultSort will be reassigned unique SortOrder values when building the sort specs.
1652 column->SortOrder = (flags & ImGuiTableColumnFlags_DefaultSort) ? 0 : -1;
1653 column->SortDirection = (flags & ImGuiTableColumnFlags_DefaultSort) ? ((flags & ImGuiTableColumnFlags_PreferSortDescending) ? (ImS8)ImGuiSortDirection_Descending : (ImU8)(ImGuiSortDirection_Ascending)) : (ImS8)ImGuiSortDirection_None;
1654 }
1655}
1656
1657// See "COLUMNS SIZING POLICIES" comments at the top of this file
1658// If (init_width_or_weight <= 0.0f) it is ignored

Callers 2

TableSetupColumnMethod · 0.85
TableLoadSettingsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected