]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/dataview_osx.cpp
Add support for VT_I8 (long long) values to wxAutomationObject.
[wxWidgets.git] / src / osx / dataview_osx.cpp
index 9d2ea7506c2a961df271232264618443a88d7639..05ad19fcbee1e03fb45b255f550b36e71590bb2c 100644 (file)
@@ -20,6 +20,9 @@
     #include "wx/dcclient.h"
     #include "wx/icon.h"
 #endif
+#if wxOSX_USE_CARBON
+#include "wx/osx/carbon/dataview.h"
+#endif
 
 #include "wx/osx/core/dataview.h"
 #include "wx/osx/private.h"
@@ -351,7 +354,6 @@ void wxDataViewCtrl::Init()
 {
   m_CustomRendererPtr = NULL;
   m_Deleting          = false;
-  m_macIsUserPane     = false;
   m_cgContext         = NULL;
 }
 
@@ -363,6 +365,7 @@ bool wxDataViewCtrl::Create(wxWindow *parent,
                             const wxValidator& validator,
                             const wxString& name)
 {
+  DontCreatePeer();
   if (!(wxControl::Create(parent,id,pos,size,style,validator,name)))
     return false;
   SetPeer(::CreateDataView(this,parent,id,pos,size,style,GetExtraStyle()));
@@ -527,6 +530,11 @@ void wxDataViewCtrl::DoSetCurrentItem(const wxDataViewItem& item)
     GetDataViewPeer()->SetCurrentItem(item);
 }
 
+wxDataViewColumn *wxDataViewCtrl::GetCurrentColumn() const
+{
+    return GetDataViewPeer()->GetCurrentColumn();
+}
+
 wxRect wxDataViewCtrl::GetItemRect(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) const
 {
   if (item.IsOk() && (columnPtr != NULL))
@@ -535,15 +543,9 @@ wxRect wxDataViewCtrl::GetItemRect(wxDataViewItem const& item, wxDataViewColumn
     return wxRect();
 }
 
-wxDataViewItem wxDataViewCtrl::GetSelection() const
+int wxDataViewCtrl::GetSelectedItemsCount() const
 {
-  wxDataViewItemArray itemIDs;
-
-
-  if (GetDataViewPeer()->GetSelections(itemIDs) > 0)
-    return itemIDs[0];
-  else
-    return wxDataViewItem();
+  return GetDataViewPeer()->GetSelectedItemsCount();
 }
 
 int wxDataViewCtrl::GetSelections(wxDataViewItemArray& sel) const
@@ -633,6 +635,11 @@ void wxDataViewCtrl::AddChildren(wxDataViewItem const& parentItem)
   (void) GetModel()->ItemsAdded(parentItem,items);
 }
 
+void wxDataViewCtrl::EditItem(const wxDataViewItem& item, const wxDataViewColumn *column)
+{
+    GetDataViewPeer()->StartEditor(item, GetColumnPosition(column));
+}
+
 void wxDataViewCtrl::FinishCustomItemEditing()
 {
   if (GetCustomRendererItem().IsOk())
@@ -707,12 +714,11 @@ void wxDataViewCtrl::OnMouse(wxMouseEvent& event)
 {
     event.Skip();
 
+#if wxOSX_USE_CARBON
     if (GetModel() == NULL)
         return;
 
-#if 0
-    // Doesn't compile anymore
-    wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(m_peer));
+    wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(GetPeer()));
 
     int NoOfChildren;
     wxDataViewItemArray items;
@@ -737,7 +743,7 @@ void wxDataViewCtrl::OnMouse(wxMouseEvent& event)
 
            Rect itemrect;
            ::GetDataBrowserItemPartBounds( MacDataViewListCtrlPtr->GetControlRef(),
-              reinterpret_cast<DataBrowserItemID>(firstChild.GetID()), column->GetPropertyID(),
+              reinterpret_cast<DataBrowserItemID>(firstChild.GetID()), column->GetNativeData()->GetPropertyID(),
               kDataBrowserPropertyEnclosingPart, &itemrect );
 
            if (abs( event.GetX() - itemrect.right) < 3)
@@ -751,7 +757,6 @@ void wxDataViewCtrl::OnMouse(wxMouseEvent& event)
        }
 
     }
-
     SetCursor( *wxSTANDARD_CURSOR );
 #endif
 }