Fix selection event generation in wxMac wxListBox

Prevents deselecting the selected item in single-selection listbox.

Also generate correct events in the multi-selection case by reusing the
existing wxListBoxBase::CalcAndSendEvent() method.

Closes #15603.
This commit is contained in:
ikamakj
2018-06-30 23:05:57 +02:00
committed by Vadim Zeitlin
parent 2ab430965c
commit c369c792a3
2 changed files with 31 additions and 15 deletions

View File

@@ -125,6 +125,12 @@ public:
bool MacGetBlockEvents() const { return m_blockEvents; }
virtual void HandleLineEvent( unsigned int n, bool doubleClick );
// These are called by wxNSTableView
using wxListBoxBase::DoChangeSingleSelection;
using wxListBoxBase::CalcAndSendEvent;
int GetOldSelection() const { return m_oldSelections.empty() ? wxNOT_FOUND : m_oldSelections[0]; }
protected:
// callback for derived classes which may have to insert additional data
// at a certain line - which cannot be predetermined for sorted list data