bool wxDataViewCtrl::AppendColumn(wxDataViewColumn* columnPtr)
{
- return InsertColumn( kDataBrowserListViewAppendColumn, columnPtr );
+ return wxDataViewCtrl::InsertColumn( GetColumnCount(), columnPtr );
}
bool wxDataViewCtrl::PrependColumn(wxDataViewColumn* columnPtr)
{
- return InsertColumn( 0, columnPtr );
+ return wxDataViewCtrl::InsertColumn( 0, columnPtr );
}
bool wxDataViewCtrl::InsertColumn(unsigned int pos, wxDataViewColumn* columnPtr)
// full column variable initialization:
columnPtr->SetPropertyID(NewPropertyID);
// add column to wxWidget's internal structure:
- wxCHECK_MSG(this->wxDataViewCtrlBase::AppendColumn(columnPtr) &&
+ wxCHECK_MSG(this->wxDataViewCtrlBase::InsertColumn(pos,columnPtr) &&
m_ColumnPointers.insert(ColumnPointerHashMapType::value_type(NewPropertyID,columnPtr)).second,false,_("Could not add column to internal structures."));
// create a column description and add column to the native control:
wxCHECK_MSG(::InitializeColumnDescription(columnDescription,columnPtr,NewPropertyID,title), false,_("Column description could not be initialized."));
void wxDataViewCtrl::EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr)
{
- wxDataViewCtrlBase::EnsureVisible(item,columnPtr);
+ ExpandAncestors(item);
if (item.IsOk())
{
{
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)