- RecreateWindow();
-}
-
-void wxListCtrl::RecreateWindow()
-{
- if ( GetHWND() )
- {
- long oldStyle = 0;
- long style = ConvertToMSWStyle(oldStyle, m_windowStyle);
- style |= m_baseStyle;
- // ::SetWindowLong((HWND) GetHWND(), GWL_STYLE, style);
-
- // The following recreation of the window appears to be necessary
- // because SetWindowLong doesn't seem to do it.
-
- int x, y, width, height;
- GetPosition(&x, &y);
- GetSize(&width, &height);
-
- UnsubclassWin();
- ::DestroyWindow((HWND) GetHWND());
-
- // Experimental
- // Recreate the ListView control: unfortunately I can't
- // make it work by using SetWindowLong.
- bool want3D;
- WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
- HWND hWndListControl = CreateWindowEx(exStyle,
- WC_LISTVIEW,
- "",
- style,
- x, y, width, height,
- (HWND) GetParent()->GetHWND(),
- (HMENU)m_windowId,
- wxGetInstance(),
- NULL );
-
- m_hWnd = (WXHWND) hWndListControl;
- SubclassWin((WXHWND) m_hWnd);
-
-#ifdef ListView_SetExtendedListViewStyle
- if ( style & LVS_REPORT )
- {
- ListView_SetExtendedListViewStyle((HWND)GetHWND(),
- LVS_EX_FULLROWSELECT);
- }
-#endif // ListView_SetExtendedListViewStyle
-
- if ( m_imageListNormal )
- SetImageList(m_imageListNormal, wxIMAGE_LIST_NORMAL);
- if ( m_imageListSmall )
- SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL);
- if ( m_imageListState )
- SetImageList(m_imageListState, wxIMAGE_LIST_STATE);
- }