X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7a8dce715f3cbe7f7289ab02b4854993f92c981f..d968078adbfb147e913b9a33fc54242a36f117ce:/src/msw/listctrl.cpp diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 1ba0251cdf..84eafb3d90 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -279,7 +279,7 @@ wxEND_HANDLERS_TABLE() wxCONSTRUCTOR_5( wxListCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) /* - TODO : Expose more information of a list's layout etc. via appropriate objects (à la NotebookPageInfo) + TODO : Expose more information of a list's layout etc. via appropriate objects (a la NotebookPageInfo) */ #else IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl) @@ -338,9 +338,17 @@ bool wxListCtrl::Create(wxWindow *parent, // GetTextColour will always return black SetTextColour(GetDefaultAttributes().colFg); + if ( InReportView() ) + MSWSetExListStyles(); + + return true; +} + +void wxListCtrl::MSWSetExListStyles() +{ // for comctl32.dll v 4.70+ we want to have some non default extended // styles because it's prettier (and also because wxGTK does it like this) - if ( InReportView() && wxApp::GetComCtl32Version() >= 470 ) + if ( wxApp::GetComCtl32Version() >= 470 ) { ::SendMessage ( @@ -354,8 +362,6 @@ bool wxListCtrl::Create(wxWindow *parent, LVS_EX_HEADERDRAGDROP ); } - - return true; } WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const @@ -454,6 +460,11 @@ void wxListCtrl::UpdateStyle() if ( dwStyleOld != dwStyleNew ) { ::SetWindowLong(GetHwnd(), GWL_STYLE, dwStyleNew); + + // if we switched to the report view, set the extended styles for + // it too + if ( !(dwStyleOld & LVS_REPORT) && (dwStyleNew & LVS_REPORT) ) + MSWSetExListStyles(); } } }