]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mdi.cpp
Include wx/scrolwin.h and wx/dirdlg.h according to precompiled headers of wx/wx.h...
[wxWidgets.git] / src / msw / mdi.cpp
index 07095b96e76df33c3ac6091f546e6566dda90e4e..5b7dd5e75ec830e8e32fb01850afb2a84fc3c363 100644 (file)
@@ -63,11 +63,8 @@ extern wxMenu *wxCurrentPopupMenu;
 extern const wxChar *wxMDIFrameClassName;   // from app.cpp
 extern const wxChar *wxMDIChildFrameClassName;
 extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
-extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
 extern void wxRemoveHandleAssociation(wxWindow *win);
 
-static HWND invalidHandle = 0;
-
 // ---------------------------------------------------------------------------
 // constants
 // ---------------------------------------------------------------------------
@@ -752,7 +749,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
     msflags |= WS_MINIMIZEBOX;
   if (style & wxMAXIMIZE_BOX)
     msflags |= WS_MAXIMIZEBOX;
-  if (style & wxTHICK_FRAME)
+  if (style & wxRESIZE_BORDER)
     msflags |= WS_THICKFRAME;
   if (style & wxSYSTEM_MENU)
     msflags |= WS_SYSMENU;
@@ -772,7 +769,13 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
   m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
                                  WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
 
-  wxAssociateWinWithHandle((HWND) GetHWND(), this);
+  if ( !m_hWnd )
+  {
+      wxLogLastError(_T("WM_MDICREATE"));
+      return false;
+  }
+
+  SubclassWin(m_hWnd);
 
   return true;
 }
@@ -1112,13 +1115,6 @@ bool wxMDIChildFrame::HandleWindowPosChanging(void *pos)
             lpPos->cx = rectClient.right - rectClient.left;
             lpPos->cy = rectClient.bottom - rectClient.top;
         }
-#if wxUSE_TOOLBAR
-        wxMDIParentFrame* pFrameWnd = (wxMDIParentFrame *)GetParent();
-        if (pFrameWnd && pFrameWnd->GetToolBar() && pFrameWnd->GetToolBar()->IsShown())
-        {
-            pFrameWnd->GetToolBar()->Refresh();
-        }
-#endif
     }
 
     return false;
@@ -1177,8 +1173,6 @@ bool wxMDIChildFrame::MSWTranslateMessage(WXMSG* msg)
 
 void wxMDIChildFrame::MSWDestroyWindow()
 {
-    invalidHandle = GetHwnd();
-
     wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
 
     // Must make sure this handle is invalidated (set to NULL) since all sorts
@@ -1192,8 +1186,6 @@ void wxMDIChildFrame::MSWDestroyWindow()
     if (parent->GetActiveChild() == (wxMDIChildFrame*) NULL)
         ResetWindowStyle((void*) NULL);
 
-    invalidHandle = 0;
-
     if (m_hMenu)
     {
         ::DestroyMenu((HMENU) m_hMenu);