Restore ability to hide grid columns.

wxGrids stupidly does this by setting the width to zero, so you
have to be careful when adjusting minimum widths.
This commit is contained in:
Jeff Young 2019-02-17 14:09:35 +00:00
parent 23aa838a03
commit dc5ae574e2
3 changed files with 7 additions and 3 deletions

View File

@ -387,6 +387,7 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow()
if( col == 6 ) if( col == 6 )
col_size += 20; col_size += 20;
if( m_itemsGrid->IsColShown( col ) )
m_itemsGrid->SetColSize( col, col_size ); m_itemsGrid->SetColSize( col, col_size );
} }

View File

@ -303,6 +303,7 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow()
if( col == 6 ) if( col == 6 )
col_size += 20; col_size += 20;
if( m_itemsGrid->IsColShown( col ) )
m_itemsGrid->SetColSize( col, col_size ); m_itemsGrid->SetColSize( col, col_size );
} }

View File

@ -130,7 +130,9 @@ bool PANEL_MODEDIT_DEFAULTS::TransferDataToWindow()
{ {
// Set the minimal width to the column label size. // Set the minimal width to the column label size.
m_grid->SetColMinimalWidth( col, m_grid->GetVisibleWidth( col, true, false, false ) ); m_grid->SetColMinimalWidth( col, m_grid->GetVisibleWidth( col, true, false, false ) );
// Set the width to see the full contents // Set the width to see the full contents
if( m_grid->IsColShown( col ) )
m_grid->SetColSize( col, m_grid->GetVisibleWidth( col, true, true, true ) ); m_grid->SetColSize( col, m_grid->GetVisibleWidth( col, true, true, true ) );
} }