]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/datavgen.cpp
Another fix for PCH-less build in markup code.
[wxWidgets.git] / src / generic / datavgen.cpp
index 2531bad861c8f47a64ca1f18dd6e4e86f52edf6e..ca7dc0a9bd50219f3b9dd4b98f6505a7070f4f36 100644 (file)
@@ -145,7 +145,6 @@ protected:
         return *(GetOwner()->GetColumn(idx));
     }
 
-    // FIXME: currently unused
     virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle)
     {
         wxDataViewCtrl * const owner = GetOwner();
@@ -1665,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
@@ -4325,8 +4325,9 @@ void wxDataViewCtrl::InvalidateColBestWidths()
 
     if ( m_headerArea )
     {
-        // this updates visual appearance of columns 0 and up, not just 0
-        m_headerArea->UpdateColumn(0);
+        const unsigned cols = m_headerArea->GetColumnCount();
+        for ( unsigned i = 0; i < cols; i++ )
+            m_headerArea->UpdateColumn(i);
     }
 }