From 1e1843000400eabbb7d0ba7bf80d5439f53694fd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 9 Aug 2010 21:17:51 +0000 Subject: [PATCH] Don't lose selection in wxDataViewCtrl::Select() under Mac. Calling Select() for an item should not deselect the other selected items in multiple selection mode. This is consistent with the GTK and generic versions behaviour and also just makes more sense but also document that this is indeed the desired behaviour just in case. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/dataview.h | 4 ++++ src/osx/cocoa/dataview.mm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 1bcdf86eb0..46a623fdb1 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -963,6 +963,10 @@ public: /** Select the given item. + + In single selection mode this changes the (unique) currently selected + item. In multi selection mode, the @a item is selected and the + previously selected items remain selected. */ virtual void Select(const wxDataViewItem& item); diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 7de547f6ac..f8f8c38b02 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -2096,7 +2096,7 @@ void wxCocoaDataViewControl::Select(const wxDataViewItem& item) { if (item.IsOk()) [m_OutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:[m_OutlineView rowForItem:[m_DataSource getDataViewItemFromBuffer:item]]] - byExtendingSelection:NO]; + byExtendingSelection:GetDataViewCtrl()->HasFlag(wxDV_MULTIPLE) ? YES : NO]; } void wxCocoaDataViewControl::SelectAll() -- 2.45.2