#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"
{
m_CustomRendererPtr = NULL;
m_Deleting = false;
- m_macIsUserPane = false;
m_cgContext = NULL;
}
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()));
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))
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
(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())
{
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;
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)
}
}
-
SetCursor( *wxSTANDARD_CURSOR );
#endif
}