X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3b17ee74390803c2743455f5f3c744a2dd392ea..ad4a907bb77c5ca10aa02ab8474caa8b92d78c0c:/src/generic/listctrl.cpp diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 20136f0086..3804bf0e6f 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -52,8 +52,6 @@ #ifdef __WXMAC__ #include "wx/osx/private.h" - // for theming support - #include #endif #if defined(__WXMSW__) && !defined(__WXWINCE__) && !defined(__WXUNIVERSAL__) @@ -4274,7 +4272,6 @@ void wxGenericListCtrl::Init() m_mainWin = NULL; m_headerWin = NULL; - m_headerHeight = wxRendererNative::Get().GetHeaderButtonHeight(this); } wxGenericListCtrl::~wxGenericListCtrl() @@ -4301,7 +4298,11 @@ void wxGenericListCtrl::CreateOrDestroyHeaderWindowAsNeeded() ( this, wxID_ANY, m_mainWin, wxPoint(0,0), - wxSize(GetClientSize().x, m_headerHeight), + wxSize + ( + GetClientSize().x, + wxRendererNative::Get().GetHeaderButtonHeight(this) + ), wxTAB_TRAVERSAL ); @@ -4443,6 +4444,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 @@ -4451,8 +4456,6 @@ void wxGenericListCtrl::SetWindowStyleFlag( long flag ) GetSizer()->Layout(); } - - wxWindow::SetWindowStyleFlag( flag ); } bool wxGenericListCtrl::GetColumn(int col, wxListItem &item) const @@ -4589,7 +4592,7 @@ bool wxGenericListCtrl::GetSubItemRect(long item, return false; if ( m_mainWin->HasHeader() ) - rect.y += m_headerHeight + 1; + rect.y += m_headerWin->GetSize().y + 1; return true; }