X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b741dd400f3eeef66359ee223926307db3a2f488..8cb1060f1e2f2cbbcaebcc668dccefdd79804662:/src/mac/carbon/dataview.cpp diff --git a/src/mac/carbon/dataview.cpp b/src/mac/carbon/dataview.cpp index 3088806ef0..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,6 +891,21 @@ unsigned int wxDataViewCtrl::GetColumnCount(void) const return this->m_ColumnPointers.size(); } /* wxDataViewCtrl::GetColumnCount(void) const */ +int wxDataViewCtrl::GetColumnPosition(wxDataViewColumn const* columnPtr) const +{ + 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) { wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast(this->m_peer)); @@ -922,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;