Fix vertical rules rendering in generic wxDataViewCtrl.

Vertical rules are now drawn in the last pixel of a column instead of in
the first, so that they align perfectly with native MSW wxHeaderCtrl as
well as for consistency with MSW native list control.  There's no
vertical rule at the most-left side of the control anymore.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2011-01-31 16:54:03 +00:00
parent ec46fd5fce
commit 3999336cb9

View File

@@ -1664,22 +1664,23 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.SetPen(m_penRule);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
int x = x_start;
// NB: Vertical rules are drawn in the last pixel of a column so that
// they align perfectly with native MSW wxHeaderCtrl as well as for
// consistency with MSW native list control. There's no vertical
// rule at the most-left side of the control.
int x = x_start - 1;
for (unsigned int i = col_start; i < col_last; i++)
{
wxDataViewColumn *col = GetOwner()->GetColumnAt(i);
if (col->IsHidden())
continue; // skip it
x += col->GetWidth();
dc.DrawLine(x, GetLineStart( item_start ),
x, GetLineStart( item_last ) );
x += col->GetWidth();
}
// Draw last vertical rule
dc.DrawLine(x, GetLineStart( item_start ),
x, GetLineStart( item_last ) );
}
// redraw the background for the items which are selected/current