}
}
+void wxDataViewColumn::SetAsSortKey(bool WXUNUSED(sort))
+{
+ // see wxGTK native wxDataViewColumn implementation
+ wxFAIL_MSG( "not implemented" );
+}
+
+bool wxDataViewColumn::IsSortKey() const
+{
+ wxDataViewCtrl * const dataViewCtrlPtr(GetOwner());
+ wxMacDataViewDataBrowserListViewControlPointer macDataViewListCtrlPtr(
+ dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(
+ dataViewCtrlPtr->GetPeer()));
+
+ DataBrowserPropertyID propertyID;
+ return macDataViewListCtrlPtr->GetSortProperty(&propertyID) == noErr &&
+ propertyID == m_propertyID;
+}
+
//-----------------------------------------------------------------------------
// wxDataViewCtrl
//-----------------------------------------------------------------------------
void wxDataViewCtrl::EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr)
{
+ ExpandAncestors(item);
+
if (item.IsOk())
{
DataBrowserPropertyID propertyID;
MacDataViewListCtrlPtr->OpenContainer(reinterpret_cast<DataBrowserItemID>(item.GetID()));
}
+bool wxDataViewCtrl::IsExpanded( const wxDataViewItem & item ) const
+{
+ if (item.IsOk())
+ {
+ wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(m_peer));
+
+ DataBrowserItemState state = 0;
+ OSStatus err = ::GetDataBrowserItemState(
+ MacDataViewListCtrlPtr->GetControlRef(),
+ reinterpret_cast<DataBrowserItemID>(item.GetID()),
+ &state );
+ if ((err == 0) && (state & kDataBrowserContainerIsOpen))
+ return true;
+ }
+ return false;
+}
+
wxDataViewColumn* wxDataViewCtrl::GetSortingColumn() const
{
DataBrowserPropertyID propertyID;
{
if (item.IsOk())
{
+ ExpandAncestors(item);
+
DataBrowserItemID itemID(reinterpret_cast<DataBrowserItemID>(item.GetID()));
wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(m_peer));
void wxDataViewCtrl::SetSelections(wxDataViewItemArray const& sel)
{
- size_t const NoOfSelections = sel.GetCount();
+ size_t const NoOfSelections = sel.GetCount();
- DataBrowserItemID* itemIDs;
+ wxDataViewItem last_parent;
- wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(m_peer));
+ size_t i;
+ for (i = 0; i < NoOfSelections; i++)
+ {
+ wxDataViewItem item = sel[i];
+ wxDataViewItem parent = GetModel()->GetParent( item );
+ if (parent)
+ {
+ if (parent != last_parent)
+ ExpandAncestors(item);
+ }
+ last_parent = parent;
+ }
+ DataBrowserItemID* itemIDs;
+ wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(m_peer));
- itemIDs = new DataBrowserItemID[NoOfSelections];
- for (size_t i=0; i<NoOfSelections; ++i)
- itemIDs[i] = reinterpret_cast<DataBrowserItemID>(sel[i].GetID());
- MacDataViewListCtrlPtr->SetSelectedItems(NoOfSelections,itemIDs,kDataBrowserItemsAssign);
- delete[] itemIDs;
+ itemIDs = new DataBrowserItemID[NoOfSelections];
+ for (i=0; i<NoOfSelections; ++i)
+ itemIDs[i] = reinterpret_cast<DataBrowserItemID>(sel[i].GetID());
+ MacDataViewListCtrlPtr->SetSelectedItems(NoOfSelections,itemIDs,kDataBrowserItemsAssign);
+ delete[] itemIDs;
}
void wxDataViewCtrl::Unselect(wxDataViewItem const& item)