Fix updating of grid view in MSW

This commit is contained in:
Jon Evans 2020-08-23 13:48:50 -04:00
parent a77000f9d9
commit eb0d3d653f
1 changed files with 12 additions and 0 deletions

View File

@ -557,7 +557,11 @@ void APPEARANCE_CONTROLS::OnNetGridClick( wxGridEvent& event )
{ {
case NET_GRID_TABLE::COL_VISIBILITY: case NET_GRID_TABLE::COL_VISIBILITY:
m_netsTable->SetValueAsBool( row, col, !m_netsTable->GetValueAsBool( row, col ) ); m_netsTable->SetValueAsBool( row, col, !m_netsTable->GetValueAsBool( row, col ) );
#ifdef __WXMSW__
m_netsGrid->ForceRefresh();
#else
m_netsGrid->RefreshRect( m_netsGrid->CellToRect( row, col ) ); m_netsGrid->RefreshRect( m_netsGrid->CellToRect( row, col ) );
#endif
break; break;
default: default:
@ -2087,8 +2091,12 @@ void APPEARANCE_CONTROLS::showNetclass( const wxString& aClassName, bool aShow )
if( row >= 0 ) if( row >= 0 )
{ {
m_netsTable->SetValueAsBool( row, NET_GRID_TABLE::COL_VISIBILITY, aShow ); m_netsTable->SetValueAsBool( row, NET_GRID_TABLE::COL_VISIBILITY, aShow );
#ifdef __WXMSW__
m_netsGrid->ForceRefresh();
#else
m_netsGrid->RefreshRect( m_netsGrid->RefreshRect(
m_netsGrid->CellToRect( row, NET_GRID_TABLE::COL_VISIBILITY ) ); m_netsGrid->CellToRect( row, NET_GRID_TABLE::COL_VISIBILITY ) );
#endif
} }
} }
} }
@ -2109,8 +2117,12 @@ void APPEARANCE_CONTROLS::showNetclass( const wxString& aClassName, bool aShow )
if( row >= 0 ) if( row >= 0 )
{ {
m_netsTable->SetValueAsBool( row, NET_GRID_TABLE::COL_VISIBILITY, aShow ); m_netsTable->SetValueAsBool( row, NET_GRID_TABLE::COL_VISIBILITY, aShow );
#ifdef __WXMSW__
m_netsGrid->ForceRefresh();
#else
m_netsGrid->RefreshRect( m_netsGrid->RefreshRect(
m_netsGrid->CellToRect( row, NET_GRID_TABLE::COL_VISIBILITY ) ); m_netsGrid->CellToRect( row, NET_GRID_TABLE::COL_VISIBILITY ) );
#endif
} }
} }
} }