]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mdi.cpp
minor additions to wxCmdLineParser tests
[wxWidgets.git] / src / msw / mdi.cpp
index 5869306dda4c8cdd0bc7ae0a42e3cd5f803b3654..9edbdbf703ea139e7778265b94d27e594ad23d34 100644 (file)
@@ -67,8 +67,6 @@ extern const wxChar *wxMDIFrameClassName;   // from app.cpp
 extern const wxChar *wxMDIChildFrameClassName;
 extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
 
 extern const wxChar *wxMDIChildFrameClassName;
 extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
 
-extern wxWindow *wxWndHook;                 // from window.cpp
-
 extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
 extern void wxRemoveHandleAssociation(wxWindow *win);
 
 extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
 extern void wxRemoveHandleAssociation(wxWindow *win);
 
@@ -163,10 +161,6 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
                               long style,
                               const wxString& name)
 {
                               long style,
                               const wxString& name)
 {
-  m_defaultIcon = (WXHICON) (wxSTD_MDIPARENTFRAME_ICON
-                                ? wxSTD_MDIPARENTFRAME_ICON
-                                : wxDEFAULT_MDIPARENTFRAME_ICON);
-
   m_clientWindow = NULL;
   m_currentChild = NULL;
 
   m_clientWindow = NULL;
   m_currentChild = NULL;
 
@@ -196,44 +190,22 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
   SetName(name);
   m_windowStyle = style;
 
   SetName(name);
   m_windowStyle = style;
 
-  if (parent) parent->AddChild(this);
+  if ( parent )
+      parent->AddChild(this);
 
   if ( id > -1 )
     m_windowId = id;
   else
 
   if ( id > -1 )
     m_windowId = id;
   else
-    m_windowId = (int)NewControlId();
+    m_windowId = NewControlId();
 
 
-  int x = pos.x;
-  int y = pos.y;
-  int width = size.x;
-  int height = size.y;
+  long exflags;
+  long msflags = MSWGetCreateWindowFlags(&exflags);
 
 
-  DWORD msflags = WS_OVERLAPPED;
-  if (style & wxMINIMIZE_BOX)
-    msflags |= WS_MINIMIZEBOX;
-  if (style & wxMAXIMIZE_BOX)
-    msflags |= WS_MAXIMIZEBOX;
-  if (style & wxTHICK_FRAME)
-    msflags |= WS_THICKFRAME;
-  if (style & wxSYSTEM_MENU)
-    msflags |= WS_SYSMENU;
-  if ((style & wxMINIMIZE) || (style & wxICONIZE))
-    msflags |= WS_MINIMIZE;
-  if (style & wxMAXIMIZE)
-    msflags |= WS_MAXIMIZE;
-  if (style & wxCAPTION)
-    msflags |= WS_CAPTION;
-
-  if (style & wxCLIP_CHILDREN)
-    msflags |= WS_CLIPCHILDREN;
-
-  if ( !wxWindow::MSWCreate(m_windowId,
-                            parent,
-                            wxMDIFrameClassName,
-                            this,
+  if ( !wxWindow::MSWCreate(wxMDIFrameClassName,
                             title,
                             title,
-                            x, y, width, height,
-                            msflags) )
+                            pos, size,
+                            msflags,
+                            exflags) )
   {
       return FALSE;
   }
   {
       return FALSE;
   }
@@ -349,6 +321,12 @@ void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
     event.Skip();
 }
 
     event.Skip();
 }
 
+WXHICON wxMDIParentFrame::GetDefaultIcon() const
+{
+    return (WXHICON)(wxSTD_MDIPARENTFRAME_ICON ? wxSTD_MDIPARENTFRAME_ICON
+                                               : wxDEFAULT_MDIPARENTFRAME_ICON);
+}
+
 // ---------------------------------------------------------------------------
 // MDI operations
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 // MDI operations
 // ---------------------------------------------------------------------------
@@ -647,9 +625,6 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
                              long style,
                              const wxString& name)
 {
                              long style,
                              const wxString& name)
 {
-  m_defaultIcon = (WXHICON)(wxSTD_MDICHILDFRAME_ICON ? wxSTD_MDICHILDFRAME_ICON
-                                                     : wxDEFAULT_MDICHILDFRAME_ICON);
-
   SetName(name);
   wxWindowBase::Show(TRUE); // MDI child frame starts off shown
 
   SetName(name);
   wxWindowBase::Show(TRUE); // MDI child frame starts off shown
 
@@ -663,8 +638,6 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
       parent->AddChild(this);
   }
 
       parent->AddChild(this);
   }
 
-  wxWndHook = this;
-
   int x = pos.x;
   int y = pos.y;
   int width = size.x;
   int x = pos.x;
   int y = pos.y;
   int width = size.x;
@@ -717,15 +690,13 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
   mcs.lParam = 0;
 
 
   mcs.lParam = 0;
 
+  wxWindowCreationHook hook(this);
+
   m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
                                  WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
 
   m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
                                  WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
 
-  wxWndHook = NULL;
   wxAssociateWinWithHandle((HWND) GetHWND(), this);
 
   wxAssociateWinWithHandle((HWND) GetHWND(), this);
 
-  // VZ: what's this? an act of piracy?
-  //SetWindowLong(GetHwnd(), 0, (long)this);
-
   wxModelessWindows.Append(this);
 
   return TRUE;
   wxModelessWindows.Append(this);
 
   return TRUE;
@@ -814,6 +785,12 @@ void wxMDIChildFrame::InternalSetMenuBar()
     parent->m_parentFrameActive = FALSE;
 }
 
     parent->m_parentFrameActive = FALSE;
 }
 
+WXHICON wxMDIChildFrame::GetDefaultIcon() const
+{
+    return (WXHICON)(wxSTD_MDICHILDFRAME_ICON ? wxSTD_MDICHILDFRAME_ICON
+                                              : wxDEFAULT_MDICHILDFRAME_ICON);
+}
+
 // ---------------------------------------------------------------------------
 // MDI operations
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 // MDI operations
 // ---------------------------------------------------------------------------
@@ -1190,7 +1167,7 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
     DWORD exStyle = 0;
 #endif
 
     DWORD exStyle = 0;
 #endif
 
-    wxWndHook = this;
+    wxWindowCreationHook hook(this);
     m_hWnd = (WXHWND)::CreateWindowEx
                        (
                         exStyle,
     m_hWnd = (WXHWND)::CreateWindowEx
                        (
                         exStyle,
@@ -1210,7 +1187,6 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
     }
 
     SubclassWin(m_hWnd);
     }
 
     SubclassWin(m_hWnd);
-    wxWndHook = NULL;
 
     return TRUE;
 }
 
     return TRUE;
 }