]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dataview.cpp
Harmonize wxDataViewCtrl::GetSelection() behaviour in all ports.
[wxWidgets.git] / src / osx / carbon / dataview.cpp
index 2d316d9e0cb6e306cb2cb48d675b14faea68b250..dd288d8e17f243e3d549bb7c302b1d2694e09590 100644 (file)
@@ -1107,6 +1107,23 @@ void wxMacDataViewDataBrowserListViewControl::SetCurrentItem(const wxDataViewIte
     wxFAIL_MSG( "unimplemented for Carbon" );
 }
 
+int wxMacDataViewDataBrowserListViewControl::GetSelectedItemsCount() const
+{
+  Handle handle(::NewHandle(0));
+
+  if ( GetItems(kDataBrowserNoItem,true,kDataBrowserItemIsSelected,handle) != noErr )
+  {
+      wxFAIL_MSG( "failed to get selected items" );
+      return 0;
+  }
+
+  size_t noOfItems = static_cast<size_t>(::GetHandleSize(handle)/sizeof(DataBrowserItemID));
+  HUnlock(handle);
+  DisposeHandle(handle);
+
+  return noOfItems;
+}
+
 int wxMacDataViewDataBrowserListViewControl::GetSelections(wxDataViewItemArray& sel) const
 {
   size_t noOfSelectedItems;