From b119ee87a55eb961034672abdc22c5c44ba203ea Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 13 Jun 2008 22:38:33 +0000 Subject: [PATCH] don't clear the list control when wxLC_[HV]RULES style is toggled (#4688) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 985fa5d7e9..8c40c96c48 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -5088,7 +5088,17 @@ void wxGenericListCtrl::SetSingleStyle( long style, bool add ) else flag &= ~style; - SetWindowStyleFlag( flag ); + // some styles can be set without recreating everything (as happens in + // SetWindowStyleFlag() which calls wxListMainWindow::DeleteEverything()) + if ( !(style & ~(wxLC_HRULES | wxLC_VRULES)) ) + { + Refresh(); + wxWindow::SetWindowStyleFlag(flag); + } + else + { + SetWindowStyleFlag( flag ); + } } void wxGenericListCtrl::SetWindowStyleFlag( long flag ) -- 2.45.2