Refresh wxListCtrl with wxLC_HRULES in SetColumnWidth() in wxMSW

This is necessary to avoid corrupted rules display after changing the column
width.

See #17158.
This commit is contained in:
Andreas Falkenhahn
2015-09-20 13:35:01 +02:00
committed by Vadim Zeitlin
parent d72006f5b8
commit 02c8973a57

View File

@@ -623,7 +623,15 @@ bool wxListCtrl::SetColumnWidth(int col, int width)
else if ( width == wxLIST_AUTOSIZE_USEHEADER)
width = LVSCW_AUTOSIZE_USEHEADER;
return ListView_SetColumnWidth(GetHwnd(), col, width) != 0;
if ( !ListView_SetColumnWidth(GetHwnd(), col, width) )
return false;
// Failure to explicitly refresh the control with horizontal rules results
// in corrupted rules display.
if ( HasFlag(wxLC_HRULES) )
Refresh();
return true;
}
// ----------------------------------------------------------------------------