Adjust rectangle coordinates returned by wxDataViewCtrl::GetItemRect()

Because query for item rectangle is executed in the context of wxDataViewCtrl so coordinates of retrieved rectangle should be specified in wxDataViewCtrl client coordinates (not in wxDataViewMainWindow coordinates).
To return correct coordinates it is necessary to convert rectangle coordinates retrieved by wxDataViewMainWindow::GetItemRect() from wxDataViewMainWindow client coordinates to wxDataViewCtrl client coordinates (they can different due to the presence of the header in wxDataViewCtrl client area).
This commit is contained in:
Artur Wieczorek
2016-10-04 23:39:38 +02:00
parent 2ec1bad4d6
commit 25ac053adb
3 changed files with 13 additions and 6 deletions

View File

@@ -1395,11 +1395,8 @@ public:
int GetIndent() const;
/**
Returns item rectangle.
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.
Returns item rectangle. Coordinates of the rectangle are specified in
wxDataViewCtrl client area coordinates.
@param item
A valid item.
@@ -1407,6 +1404,10 @@ public:
If non-@NULL, the rectangle returned corresponds to the
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.
*/
virtual wxRect GetItemRect(const wxDataViewItem& item,
const wxDataViewColumn* col = NULL) const;