Fixed show context menu for multiple selection in ObjectList

This commit is contained in:
YuSanka 2019-12-10 17:25:30 +01:00
parent b63b5125b6
commit 313e86ea94

View File

@ -807,7 +807,7 @@ void ObjectList::list_manipulation(bool evt_context_menu/* = false*/)
if (!item) { if (!item) {
if (col == nullptr) { if (col == nullptr) {
if (wxOSX) if (wxOSX && !multiple_selection())
UnselectAll(); UnselectAll();
else if (!evt_context_menu) else if (!evt_context_menu)
// Case, when last item was deleted and under GTK was called wxEVT_DATAVIEW_SELECTION_CHANGED, // Case, when last item was deleted and under GTK was called wxEVT_DATAVIEW_SELECTION_CHANGED,
@ -822,8 +822,13 @@ void ObjectList::list_manipulation(bool evt_context_menu/* = false*/)
} }
if (wxOSX && item && col) { if (wxOSX && item && col) {
wxDataViewItemArray sels;
GetSelections(sels);
UnselectAll(); UnselectAll();
Select(item); if (sels.Count() > 1)
SetSelections(sels);
else
Select(item);
} }
const wxString title = col->GetTitle(); const wxString title = col->GetTitle();