X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/21f47fb900438b3e517184eace6b82ab74c2c474..6908078e2759d5036152e763337fe12acb2e9b89:/src/mac/carbon/dataview.cpp diff --git a/src/mac/carbon/dataview.cpp b/src/mac/carbon/dataview.cpp index cbcb97d5db..c21aa0f8a3 100644 --- a/src/mac/carbon/dataview.cpp +++ b/src/mac/carbon/dataview.cpp @@ -644,6 +644,7 @@ void wxDataViewColumn::SetSortOrder(bool ascending) else headerDescription.initialOrder = kDataBrowserOrderDecreasing; verify_noerr(macDataViewListCtrlPtr->SetHeaderDesc(this->GetPropertyID(),&headerDescription)); + macDataViewListCtrlPtr->SetSortProperty(this->GetPropertyID()); } /* if */ } /* if */ } /* wxDataViewColumn::SetSortOrder(bool) */ @@ -890,10 +891,20 @@ unsigned int wxDataViewCtrl::GetColumnCount(void) const return this->m_ColumnPointers.size(); } /* wxDataViewCtrl::GetColumnCount(void) const */ -wxDataViewColumn *wxDataViewCtrl::GetSortingColumn() const +int wxDataViewCtrl::GetColumnPosition(wxDataViewColumn const* columnPtr) const { - return NULL; -} + if (columnPtr != NULL) + { + // variable definition and initialization: + DataBrowserTableViewColumnIndex Position; + wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast(this->m_peer)); + + wxCHECK_MSG(MacDataViewListCtrlPtr->GetColumnIndex(columnPtr->GetPropertyID(),&Position) == noErr,-1,_("Could not determine column's position")); + return static_cast(Position); + } /* if */ + else + return wxNOT_FOUND; +} /* wxDataViewCtrl::GetColumnPosition(wxDataViewColumn const*) const */ void wxDataViewCtrl::Collapse(wxDataViewItem const& item) { @@ -927,6 +938,19 @@ void wxDataViewCtrl::Expand(wxDataViewItem const& item) MacDataViewListCtrlPtr->OpenContainer(reinterpret_cast(item.GetID())); } /* wxDataViewCtrl::Expand(wxDataViewItem const&) */ +wxDataViewColumn* wxDataViewCtrl::GetSortingColumn(void) const +{ + DataBrowserPropertyID propertyID; + + wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast(this->m_peer)); + + + if (MacDataViewListCtrlPtr->GetSortProperty(&propertyID) == noErr) + return this->GetColumnPtr(propertyID); + else + return NULL; +} /* wxDataViewCtrl::GetSortingColumn(void) const */ + unsigned int wxDataViewCtrl::GetCount(void) const { ItemCount noOfItems;