Invalidate selection of item being removed from wxNSComboBoxControl
We need to explicitly invalidate selection of item being removed because it's not done by NSComboBox (selection index is retained).
This commit is contained in:
@@ -294,6 +294,14 @@ void wxNSComboBoxControl::InsertItem(int pos, const wxString& item)
|
|||||||
void wxNSComboBoxControl::RemoveItem(int pos)
|
void wxNSComboBoxControl::RemoveItem(int pos)
|
||||||
{
|
{
|
||||||
SendEvents(false);
|
SendEvents(false);
|
||||||
|
|
||||||
|
// Explicitly deselect item being removed
|
||||||
|
int selIdx = [m_comboBox indexOfSelectedItem];
|
||||||
|
if (selIdx!= -1 && selIdx == pos)
|
||||||
|
{
|
||||||
|
[m_comboBox deselectItemAtIndex:selIdx];
|
||||||
|
}
|
||||||
|
|
||||||
[m_comboBox removeItemAtIndex:pos];
|
[m_comboBox removeItemAtIndex:pos];
|
||||||
SendEvents(true);
|
SendEvents(true);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user