virtual bool IsSortOrderAscending() const = 0;
const wxBitmap &GetBitmap() const { return m_bitmap; }
- unsigned int GetModelColumn() const { return m_model_column; }
+ unsigned int GetModelColumn() const { return static_cast<unsigned int>(m_model_column); }
wxDataViewCtrl *GetOwner() { return m_owner; }
wxDataViewRenderer* GetRenderer() { return m_renderer; }
return false;
}
- virtual bool StartEditing(const wxDataViewItem &WXUNUSED(item), wxRect WXUNUSED(labelRect))
+ virtual bool StartEditing(wxDataViewItem const& WXUNUSED(item), wxRect WXUNUSED(labelRect))
{
return false;
}
{
this->m_propertyID = newID;
}
+ void SetWidthVariable(int NewWidth)
+ {
+ this->m_width = NewWidth;
+ }
protected:
private:
virtual bool DeleteColumn(wxDataViewColumn* columnPtr);
virtual wxDataViewColumn* GetColumn(unsigned int pos) const;
virtual unsigned int GetColumnCount(void) const;
- virtual int GetColumnPosition( const wxDataViewColumn *column ) const;
- virtual wxDataViewColumn *GetSortingColumn() const;
+ virtual int GetColumnPosition(wxDataViewColumn const* columnPtr) const;
virtual void Collapse(wxDataViewItem const& item);
virtual void EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr=NULL);
virtual void Expand(wxDataViewItem const& item);
+ virtual wxDataViewColumn* GetSortingColumn(void) const;
+
virtual unsigned int GetCount(void) const;
virtual wxRect GetItemRect(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) const;
virtual wxDataViewItem GetSelection(void) const;
break;
case kDataBrowserUserStateChanged:
{
+ // variable definitions and initialization:
DataBrowserPropertyID propertyID;
-
+ wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast<wxDataViewCtrl*>(this->GetPeer()));
+
+ wxCHECK_RET(dataViewCtrlPtr != NULL,_("Pointer to data view control not set correctly"));
+ // update column widths:
+ for (size_t i=0; i<dataViewCtrlPtr->GetColumnCount(); ++i)
+ {
+ // constant definition for abbreviational purposes:
+ wxDataViewColumn* const columnPtr = dataViewCtrlPtr->GetColumn(i);
+ // variable definition:
+ UInt16 columnWidth;
+
+ wxCHECK_RET(this->GetColumnWidth(columnPtr->GetPropertyID(),&columnWidth) == noErr,_("Column width could not be determined"));
+ columnPtr->SetWidthVariable(columnWidth);
+ } /* for */
+ // update order status:
if ((this->GetSortProperty(&propertyID) == noErr) && (propertyID >= kMinPropertyID))
{
DataBrowserSortOrder sortOrder;
{
// variable definition and initialization:
wxDataViewColumn* columnPtr;
- wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast<wxDataViewCtrl*>(this->GetPeer()));
-
- wxCHECK_RET(dataViewCtrlPtr != NULL,_("Pointer to data vie wcontrol not set correctly."));
columnPtr = dataViewCtrlPtr->GetColumn(columnIndex);
// check if the sort order has changed:
if ( columnPtr->IsSortOrderAscending() && (sortOrder == kDataBrowserOrderDecreasing) ||
else
headerDescription.initialOrder = kDataBrowserOrderDecreasing;
verify_noerr(macDataViewListCtrlPtr->SetHeaderDesc(this->GetPropertyID(),&headerDescription));
+ macDataViewListCtrlPtr->SetSortProperty(this->GetPropertyID());
} /* if */
} /* if */
} /* wxDataViewColumn::SetSortOrder(bool) */
return this->m_ColumnPointers.size();
} /* wxDataViewCtrl::GetColumnCount(void) const */
-int wxDataViewCtrl::GetColumnPosition( const wxDataViewColumn *column ) const
+int wxDataViewCtrl::GetColumnPosition(wxDataViewColumn const* columnPtr) const
{
- return -1;
-}
-
-wxDataViewColumn *wxDataViewCtrl::GetSortingColumn() const
-{
- return NULL;
-}
+ if (columnPtr != NULL)
+ {
+ // variable definition and initialization:
+ DataBrowserTableViewColumnIndex Position;
+ wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(this->m_peer));
+
+ wxCHECK_MSG(MacDataViewListCtrlPtr->GetColumnIndex(columnPtr->GetPropertyID(),&Position) == noErr,-1,_("Could not determine column's position"));
+ return static_cast<int>(Position);
+ } /* if */
+ else
+ return wxNOT_FOUND;
+} /* wxDataViewCtrl::GetColumnPosition(wxDataViewColumn const*) const */
void wxDataViewCtrl::Collapse(wxDataViewItem const& item)
{
MacDataViewListCtrlPtr->OpenContainer(reinterpret_cast<DataBrowserItemID>(item.GetID()));
} /* wxDataViewCtrl::Expand(wxDataViewItem const&) */
+wxDataViewColumn* wxDataViewCtrl::GetSortingColumn(void) const
+{
+ DataBrowserPropertyID propertyID;
+
+ wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(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;