PANEL_SETUP_NETCLASSES: fix not working (immediately closed) wxChoice widgets to select a filter This happens with wxWidgets 3.0.4 on Windows and is a side effect of a call to Layout(). The fix just calls Layout() only when needed.

Fixes: lp:1843594
https://bugs.launchpad.net/kicad/+bug/1843594
This commit is contained in:
jean-pierre charras 2019-09-13 09:20:31 +02:00
parent cec885daf9
commit 4db8638f7e
1 changed files with 10 additions and 3 deletions

View File

@ -488,9 +488,16 @@ void PANEL_SETUP_NETCLASSES::OnUpdateUI( wxUpdateUIEvent& event )
wxSize netclassSize = GetClientSize();
netclassSize.y -= m_membershipSize.y;
m_netclassesPane->SetMinSize( netclassSize );
m_netclassesPane->SetMaxSize( netclassSize );
Layout();
// Modify m_netclassesPane size only if needed, because calling Layout()
// has a annoying effect if a wxChoice is open, it is closed by this call.
// So it cannot blindly called inside each wxUpdateUIEvent event,
// at least on Windows + wxWidgets 3.0 (do not happens with 3.1.1).
if( netclassSize.y != m_netclassesPane->GetSize().y )
{
m_netclassesPane->SetMinSize( netclassSize );
m_netclassesPane->SetMaxSize( netclassSize );
Layout();
}
}