]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Removed the SaveBG hack. The real incompatibility is that the MemoryDC
[wxWidgets.git] / src / generic / listctrl.cpp
index bdb873316985fd0631ca6c164419bed598513e23..4c7760728a28156abd50b6746954a7f99a993f8d 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)
@@ -3067,6 +3069,9 @@ void wxListMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event)
     {
         ChangeCurrent(newCurrent);
 
+       // refresh the old focus to remove it
+       RefreshLine( oldCurrent );
+       
         // select all the items between the old and the new one
         if ( oldCurrent > newCurrent )
         {
@@ -3084,8 +3089,8 @@ void wxListMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event)
 
         ChangeCurrent(newCurrent);
 
-        // refresh the old focus to remove it
-        RefreshLine( oldCurrent );
+       // refresh the old focus to remove it
+       RefreshLine( oldCurrent );
 
         if ( !event.ControlDown() )
         {
@@ -3093,6 +3098,7 @@ void wxListMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event)
         }
     }
 
+       
     RefreshLine( m_current );
 
     MoveToFocus();
@@ -4533,17 +4539,6 @@ wxGenericListCtrl::wxGenericListCtrl()
     m_headerHeight = 0;
 }
 
-wxGenericListCtrl::wxGenericListCtrl(wxWindow *parent,
-                                     wxWindowID winid,
-                                     const wxPoint &pos,
-                                     const wxSize &size,
-                                     long style,
-                                     const wxValidator& validator,
-                                     const wxString &name)
-{
-    Create(parent, winid, pos, size, style, validator, name);
-}
-
 wxGenericListCtrl::~wxGenericListCtrl()
 {
     if (m_ownsImageListNormal)
@@ -5393,39 +5388,5 @@ void wxGenericListCtrl::Thaw()
     m_mainWin->Thaw();
 }
 
-#if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__)
-
-wxListCtrl::wxListCtrl()
-{
-}
-
-wxListCtrl::wxListCtrl(wxWindow *parent,
-                       wxWindowID winid,
-                       const wxPoint& pos,
-                       const wxSize& size,
-                       long style,
-                       const wxValidator &validator,
-                       const wxString &name)
-                       : wxGenericListCtrl(parent, winid, pos, size, style, validator, name)
-{
-}
-
-#endif // !__WXMSW__ || __WIN16__ || __WXUNIVERSAL__
-
-wxListView::wxListView()
-{
-}
-
-wxListView::wxListView(wxWindow *parent,
-                       wxWindowID winid,
-                       const wxPoint& pos,
-                       const wxSize& size,
-                       long style,
-                       const wxValidator& validator,
-                       const wxString &name)
-{
-    Create(parent, winid, pos, size, style, validator, name);
-}
-
 #endif // wxUSE_LISTCTRL