Fix accidental application of filters to all cells of 3D search path GUI

This commit is contained in:
Cirilo Bernardo 2016-01-19 10:11:09 +11:00
parent 54940002f9
commit 625ce3cb69
1 changed files with 16 additions and 6 deletions

View File

@ -69,9 +69,20 @@ DLG_3D_PATH_CONFIG::DLG_3D_PATH_CONFIG( wxWindow* aParent, S3D_FILENAME_RESOLVER
while( sL != eL ) while( sL != eL )
{ {
m_Aliases->SetCellValue( nitems, 0, sL->m_alias ); m_Aliases->SetCellValue( nitems, 0, sL->m_alias );
if( 0 == nitems )
{
m_Aliases->SetCellEditor( nitems, 0, new wxGridCellTextEditor );
pEdAlias = (wxGridCellTextEditor*) m_Aliases->GetCellEditor( nitems, 0 ); pEdAlias = (wxGridCellTextEditor*) m_Aliases->GetCellEditor( nitems, 0 );
pEdAlias->SetValidator( m_aliasValidator ); pEdAlias->SetValidator( m_aliasValidator );
pEdAlias->DecRef(); pEdAlias->DecRef();
}
else
{
pEdAlias->IncRef();
m_Aliases->SetCellEditor( nitems, 0, pEdAlias );
}
m_Aliases->SetCellValue( nitems, 1, sL->m_pathvar ); m_Aliases->SetCellValue( nitems, 1, sL->m_pathvar );
m_Aliases->SetCellValue( nitems++, 2, sL->m_description ); m_Aliases->SetCellValue( nitems++, 2, sL->m_description );
@ -135,9 +146,8 @@ void DLG_3D_PATH_CONFIG::OnAddAlias( wxCommandEvent& event )
if( m_Aliases->InsertRows( ni, 1 ) ) if( m_Aliases->InsertRows( ni, 1 ) )
{ {
wxGridCellTextEditor* pEdAlias; wxGridCellTextEditor* pEdAlias;
pEdAlias = (wxGridCellTextEditor*) m_Aliases->GetCellEditor( ni, 0 ); pEdAlias = (wxGridCellTextEditor*) m_Aliases->GetCellEditor( 0, 0 );
pEdAlias->SetValidator( m_aliasValidator ); m_Aliases->SetCellEditor( ni, 0, pEdAlias );
pEdAlias->DecRef();
m_Aliases->SelectRow( ni, false ); m_Aliases->SelectRow( ni, false );
m_Aliases->AutoSize(); m_Aliases->AutoSize();
Fit(); Fit();