+ // Preserve the selection which is lost when changing the mode
+ const int oldSel = GetSelection();
+
+ // Update the style to use icon view for images, report view otherwise
+ long style = wxLC_SINGLE_SEL;
+ if ( imageList )
+ {
+ style |= GetListCtrlIconViewFlags();
+ }
+ else // no image list
+ {
+ style |= GetListCtrlReportViewFlags();
+ }
+
+ list->SetWindowStyleFlag(style);
+ if ( !imageList )
+ list->InsertColumn(0, wxT("Pages"));
+
+ // Restore selection
+ if ( oldSel != wxNOT_FOUND )
+ SetSelection(oldSel);