m_mainWin = NULL;
m_headerWin = NULL;
- m_headerHeight = wxRendererNative::Get().GetHeaderButtonHeight(this);
}
wxGenericListCtrl::~wxGenericListCtrl()
(
this, wxID_ANY, m_mainWin,
wxPoint(0,0),
- wxSize(GetClientSize().x, m_headerHeight),
+ wxSize
+ (
+ GetClientSize().x,
+ wxRendererNative::Get().GetHeaderButtonHeight(this)
+ ),
wxTAB_TRAVERSAL
);
#endif
GetSizer()->Prepend( m_headerWin, 0, wxGROW );
-#ifdef __WXOSX__
- // TODO not tested under other platforms, remove the platform condition if
- // it works on those as well
- GetSizer()->SetItemMinSize( m_headerWin, wxSize(-1,m_headerHeight) );
-#endif
}
else
{
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
GetSizer()->Layout();
}
-
- wxWindow::SetWindowStyleFlag( flag );
}
bool wxGenericListCtrl::GetColumn(int col, wxListItem &item) const
return false;
if ( m_mainWin->HasHeader() )
- rect.y += m_headerHeight + 1;
+ rect.y += m_headerWin->GetSize().y + 1;
return true;
}