X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cd318cd31b8fd9876af7ba5f4878b90f446bd0f5..fb2e90c1745beb2c1db7bba7cf35587be392c819:/src/generic/listctrl.cpp?ds=sidebyside diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 33b696bd23..4c7760728a 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -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(); @@ -4595,6 +4601,8 @@ bool wxGenericListCtrl::Create(wxWindow *parent, m_mainWin = (wxListMainWindow*) NULL; m_headerWin = (wxListHeaderWindow*) NULL; + m_headerHeight = 0; + if ( !(style & wxLC_MASK_TYPE) ) { style = style | wxLC_LIST;