+
+ const long flagsNew = GetListCtrlFlags();
+
+ wxListView * const list = GetListView();
+
+ // We may need to change the list control mode if the image list presence
+ // has changed.
+ if ( flagsNew != flagsOld )
+ {
+ // Preserve the selection which is lost when changing the mode
+ const int oldSel = GetSelection();
+
+ list->SetWindowStyleFlag(flagsNew);
+ if ( list->InReportView() )
+ list->InsertColumn(0, wxS("Pages"));
+
+ // Restore selection
+ if ( oldSel != wxNOT_FOUND )
+ SetSelection(oldSel);
+ }
+
+ list->SetImageList(imageList, wxIMAGE_LIST_NORMAL);