]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Fixed relative paths to lib/.
[wxWidgets.git] / src / generic / listctrl.cpp
index 394e27505cde8397c53863c66c1ed48cf09b144b..e2859684843794bbc90d8fa53123c88d73e5ccbc 100644 (file)
@@ -1732,7 +1732,8 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
 
         // for this we need the width of the text
         wxCoord wLabel;
-        dc.GetTextExtent(item.GetText(), &wLabel, NULL);
+       wxCoord hLabel;
+        dc.GetTextExtent(item.GetText(), &wLabel, &hLabel);
         wLabel += 2*EXTRA_WIDTH;
 
         // and the width of the icon, if any
@@ -1797,7 +1798,7 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
         wxDCClipper clipper(dc, x, HEADER_OFFSET_Y, cw, h - 4 );
 
         dc.DrawText( item.GetText(),
-                     xAligned + EXTRA_WIDTH, HEADER_OFFSET_Y + EXTRA_HEIGHT );
+                     xAligned + EXTRA_WIDTH, h / 2 - hLabel / 2 ); //HEADER_OFFSET_Y + EXTRA_HEIGHT );
 
         x += wCol;
     }
@@ -1917,8 +1918,8 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
                 {
                     m_isDragging = TRUE;
                     m_currentX = x;
-                    DrawCurrent();
                     CaptureMouse();
+                    DrawCurrent();
                 }
                 //else: column resizing was vetoed by the user code
             }
@@ -1953,6 +1954,7 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
 void wxListHeaderWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) )
 {
     m_owner->SetFocus();
+    m_owner->Update();
 }
 
 bool wxListHeaderWindow::SendListEvent(wxEventType type, wxPoint pos)