]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't lose selection in wxDataViewCtrl::Select() under Mac.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 9 Aug 2010 21:17:51 +0000 (21:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 9 Aug 2010 21:17:51 +0000 (21:17 +0000)
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
src/osx/cocoa/dataview.mm

index 1bcdf86eb007dc3db619aa1b3bfffd815d132a1c..46a623fdb1dd7825f43c4de700ad1fe18668fdbb 100644 (file)
@@ -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);
 
index 7de547f6acb098f64b6f7f6265ab64059287aef7..f8f8c38b024656508d73b7f96f2b4a7d89269424 100644 (file)
@@ -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()