Invalidate selection of item being removed from wxChoice (wxOSX)
We need to explicitly invalidate selection of item being removed because it's not done by wxChoiceWidgetsImpl::RemoveItem().
This commit is contained in:
@@ -146,6 +146,11 @@ void wxChoice::DoDeleteOneItem(unsigned int n)
|
||||
if ( HasClientObjectData() )
|
||||
delete GetClientObject( n );
|
||||
|
||||
// Deselect item being removed
|
||||
int selIdx = GetSelection();
|
||||
if ( selIdx != -1 && selIdx == n )
|
||||
SetSelection(-1);
|
||||
|
||||
dynamic_cast<wxChoiceWidgetImpl*>(GetPeer())->RemoveItem(n);
|
||||
m_strings.RemoveAt( n ) ;
|
||||
m_datas.RemoveAt( n ) ;
|
||||
|
||||
Reference in New Issue
Block a user