From 3999336cb9ff3ef20d707d3eea470b2609a9c7c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 31 Jan 2011 16:54:03 +0000 Subject: [PATCH] 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 --- src/generic/datavgen.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index d026036799..ca7dc0a9bd 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -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 -- 2.47.2