Fix toggling the header in the generic wxListCtrl.

We need to update the lfags first before deciding whether we should create or
destroy the header.

Also add a test for toggling the header to the listctrl sample.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-03-06 00:31:00 +00:00
parent 98e956503d
commit 1bab36277c
3 changed files with 32 additions and 8 deletions

View File

@@ -4446,6 +4446,10 @@ void wxGenericListCtrl::SetSingleStyle( long style, bool add )
void wxGenericListCtrl::SetWindowStyleFlag( long flag )
{
// update the window style first so that the header is created or destroyed
// corresponding to the new style
wxWindow::SetWindowStyleFlag( flag );
if (m_mainWin)
{
// m_mainWin->DeleteEverything(); wxMSW doesn't do that
@@ -4454,8 +4458,6 @@ void wxGenericListCtrl::SetWindowStyleFlag( long flag )
GetSizer()->Layout();
}
wxWindow::SetWindowStyleFlag( flag );
}
bool wxGenericListCtrl::GetColumn(int col, wxListItem &item) const