diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 85bc40acdb..a001760b05 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -1462,9 +1462,7 @@ public: intersection of the item with the specified column. If @NULL, the rectangle spans all the columns. - @note This method is currently not implemented at all in wxGTK and only - implemented for non-@NULL @a col argument in wxOSX. It is fully - implemented in the generic version of the control. + @note This method is currently not implemented in wxGTK. */ virtual wxRect GetItemRect(const wxDataViewItem& item, const wxDataViewColumn* col = NULL) const; diff --git a/src/osx/dataview_osx.cpp b/src/osx/dataview_osx.cpp index f49a360dc6..57a1cf3970 100644 --- a/src/osx/dataview_osx.cpp +++ b/src/osx/dataview_osx.cpp @@ -547,10 +547,24 @@ wxDataViewColumn *wxDataViewCtrl::GetCurrentColumn() const wxRect wxDataViewCtrl::GetItemRect(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) const { - if (item.IsOk() && (columnPtr != NULL)) - return GetDataViewPeer()->GetRectangle(item,columnPtr); - else - return wxRect(); + if ( !item.IsOk() ) + return wxRect(); + + wxRect rect = GetDataViewPeer()->GetRectangle(item, columnPtr ? columnPtr : GetColumn(0)); + + if ( !columnPtr ) + { + const unsigned columnCount = GetColumnCount(); + if ( columnCount != 1 ) + { + // Extend the rectangle to the rightmost part of the last column. + const wxRect rectLastCol = GetDataViewPeer()->GetRectangle(item, GetColumn(columnCount - 1)); + rect.SetRight(rectLastCol.GetRight()); + } + //else: We already have the rectangle we need. + } + + return rect; } int wxDataViewCtrl::GetSelectedItemsCount() const