Fix wxDV_ROW_LINES drawing when horizontally scrolled in generic version.

Use the correct, i.e. logical, as wxDC does the translation to physical
internally, coordinates for drawing the highlighted rows.

Closes #16815.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78501 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2015-02-15 22:54:39 +00:00
parent 1cfd935c26
commit c2a4475d08
2 changed files with 9 additions and 3 deletions

View File

@@ -603,6 +603,7 @@ wxMSW:
- Fix inserting tools removed from wxToolBar back into it (sbrowne).
- Fix disabling submenu items in the menus (Artur Wieczorek).
- Fix wxEVT_TREE_STATE_IMAGE_CLICK generation (Antal).
- Fix wxDV_ROW_LINES in horizontally scrolled wxDataViewCtrl.
wxOSX:

View File

@@ -1790,9 +1790,11 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
wxDataViewModel *model = GetModel();
wxAutoBufferedPaintDC dc( this );
const wxSize size = GetClientSize();
dc.SetBrush(GetOwner()->GetBackgroundColour());
dc.SetPen( *wxTRANSPARENT_PEN );
dc.DrawRectangle(GetClientSize());
dc.DrawRectangle(size);
if ( IsEmpty() )
{
@@ -1878,13 +1880,16 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(wxBrush(altRowColour));
// We only need to draw the visible part, so limit the rectangle to it.
const int xRect = m_owner->CalcUnscrolledPosition(wxPoint(0, 0)).x;
const int widthRect = size.x;
for (unsigned int item = item_start; item < item_last; item++)
{
if ( item % 2 )
{
dc.DrawRectangle(x_start,
dc.DrawRectangle(xRect,
GetLineStart(item),
GetClientSize().GetWidth(),
widthRect,
GetLineHeight(item));
}
}