diff --git a/include/wx/msw/headerctrl.h b/include/wx/msw/headerctrl.h index ad58d06ea3..80d042eee9 100644 --- a/include/wx/msw/headerctrl.h +++ b/include/wx/msw/headerctrl.h @@ -72,10 +72,6 @@ private: // Events. void OnSize(wxSizeEvent& event); - // Style flag helper function. - long ApplyHeaderReorderFlagToStyle(long style); - - // The native header control. wxMSWHeaderCtrl* m_nativeControl; friend class wxMSWHeaderCtrl; diff --git a/src/msw/headerctrl.cpp b/src/msw/headerctrl.cpp index 58afd7e608..501151de33 100644 --- a/src/msw/headerctrl.cpp +++ b/src/msw/headerctrl.cpp @@ -1048,10 +1048,12 @@ bool wxHeaderCtrl::Create(wxWindow *parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, - ApplyHeaderReorderFlagToStyle(wxNO_BORDER), + wxNO_BORDER, wxMSWHeaderCtrlNameStr) ) return false; + SetWindowStyle(newStyle); + Bind(wxEVT_SIZE, &wxHeaderCtrl::OnSize, this); return true; @@ -1136,16 +1138,18 @@ void wxHeaderCtrl::SetWindowStyleFlag(long style) // Update the native control style. long flags = m_nativeControl->GetWindowStyleFlag(); - flags = ApplyHeaderReorderFlagToStyle(flags); - m_nativeControl->SetWindowStyleFlag(flags); -} -long wxHeaderCtrl::ApplyHeaderReorderFlagToStyle(long style) -{ if ( HasFlag(wxHD_ALLOW_REORDER) ) - return style | wxHD_ALLOW_REORDER; + flags |= wxHD_ALLOW_REORDER; + else + flags &= ~wxHD_ALLOW_REORDER; - return style & ~wxHD_ALLOW_REORDER; + if ( HasFlag(wxHD_BITMAP_ON_RIGHT) ) + flags |= wxHD_BITMAP_ON_RIGHT; + else + flags &= ~wxHD_BITMAP_ON_RIGHT; + + m_nativeControl->SetWindowStyleFlag(flags); } #endif // wxHAS_GENERIC_HEADERCTRL