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,7 +387,8 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow()
if( col == 6 )
col_size += 20;
m_itemsGrid->SetColSize( col, col_size );
if( m_itemsGrid->IsColShown( col ) )
m_itemsGrid->SetColSize( col, col_size );
}
m_itemsGrid->SetRowLabelSize( m_itemsGrid->GetVisibleWidth( -1, false, true, true ) );

View File

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

View File

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