From dbe8e30b5680e6c5f991f6c92ab56adcac313d56 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 13 Dec 2021 13:51:38 +0000 Subject: [PATCH] Allow using column sort indicators in virtual wxListCtrl too There doesn't seem to be any reason to not show sort indicators in the columns of virtual list controls, so simply remove the test for IsVirtual() in DrawSortArrow(). This allows d8ec0aa001 (Support sort indicators in wxListCtrl header, 2021-11-28) to work for wxListCtrl with wxLC_VIRTUAL too. --- src/generic/listctrl.cpp | 2 +- src/msw/listctrl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index f62ad4408d..1e078b9f9a 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1104,7 +1104,7 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) #endif wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE; - if ( !m_owner->IsVirtual() && m_enableSortCol && i == m_sortCol ) + if ( m_enableSortCol && i == m_sortCol ) { if ( m_sortAsc ) sortArrow = wxHDR_SORT_ICON_UP; diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 756c517d37..82900b7c96 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -3432,7 +3432,7 @@ void wxListCtrl::DrawSortArrow() { if ( ListView_GetColumn(GetHwnd(), col, &lvCol) ) { - if ( !IsVirtual() && m_enableSortCol && col == m_sortCol ) + if ( m_enableSortCol && col == m_sortCol ) { if ( m_sortAsc ) lvCol.fmt = (lvCol.fmt & ~HDF_SORTDOWN) | HDF_SORTUP;