]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mdi.cpp
Get rid of the CVS merge characters that have worked their way into this causing...
[wxWidgets.git] / src / msw / mdi.cpp
index 502ad620dea46ac465e1d7dc2b3baae934576bda..4eaf3c777902851631519414d7c2b823f1d5677f 100644 (file)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        mdi.cpp
-// Purpose:     MDI classes
+// Name:        src/msw/mdi.cpp
+// Purpose:     MDI classes for wxMSW
 // Author:      Julian Smart
 // Modified by:
 // Created:     04/01/98
@@ -180,12 +180,12 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
   {
       m_windowMenu = new wxMenu;
 
-      m_windowMenu->Append(IDM_WINDOWCASCADE, wxT("&Cascade"));
-      m_windowMenu->Append(IDM_WINDOWTILEHOR, wxT("Tile &Horizontally"));
-      m_windowMenu->Append(IDM_WINDOWTILEVERT, wxT("Tile &Vertically"));
+      m_windowMenu->Append(IDM_WINDOWCASCADE, _("&Cascade"));
+      m_windowMenu->Append(IDM_WINDOWTILEHOR, _("Tile &Horizontally"));
+      m_windowMenu->Append(IDM_WINDOWTILEVERT, _("Tile &Vertically"));
       m_windowMenu->AppendSeparator();
-      m_windowMenu->Append(IDM_WINDOWICONS, wxT("&Arrange Icons"));
-      m_windowMenu->Append(IDM_WINDOWNEXT, wxT("&Next"));
+      m_windowMenu->Append(IDM_WINDOWICONS, _("&Arrange Icons"));
+      m_windowMenu->Append(IDM_WINDOWNEXT, _("&Next"));
   }
 
   m_parentFrameActive = TRUE;
@@ -300,11 +300,14 @@ void wxMDIParentFrame::SetWindowMenu(wxMenu* menu)
     {
         m_windowMenu = menu;
         if (GetMenuBar())
-            InsertWindowMenu(GetClientWindow(), m_hMenu, (HMENU) m_windowMenu->GetHMenu());
+        {
+            InsertWindowMenu(GetClientWindow(), m_hMenu,
+                             GetHmenuOf(m_windowMenu));
+        }
     }
 }
 
-void wxMDIParentFrame::OnSize(wxSizeEvent& event)
+void wxMDIParentFrame::OnSize(wxSizeEvent&)
 {
     if ( GetClientWindow() )
     {
@@ -692,7 +695,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
   else
       mcs.cy = CW_USEDEFAULT;
 
-  DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN;
+  DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_THICKFRAME;
   if (style & wxMINIMIZE_BOX)
     msflags |= WS_MINIMIZEBOX;
   if (style & wxMAXIMIZE_BOX)
@@ -722,6 +725,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
   //SetWindowLong(GetHwnd(), 0, (long)this);
 
   wxModelessWindows.Append(this);
+
   return TRUE;
 }
 
@@ -999,6 +1003,8 @@ bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate),
     wxActivateEvent event(wxEVT_ACTIVATE, activated, m_windowId);
     event.SetEventObject( this );
 
+    ResetWindowStyle((void *)NULL);
+
     return GetEventHandler()->ProcessEvent(event);
 }
 
@@ -1094,7 +1100,7 @@ bool wxMDIChildFrame::ResetWindowStyle(void *vrect)
         // we want to test whether there is a maximized child, so just set
         // dwThisStyle to 0 if there is no child at all
         DWORD dwThisStyle = pChild
-            ? ::GetWindowLong(GetWinHwnd(pChild), GWL_STYLE) : NULL;
+            ? ::GetWindowLong(GetWinHwnd(pChild), GWL_STYLE) : 0;
         DWORD dwNewStyle = dwStyle;
         if ( dwThisStyle & WS_MAXIMIZE )
             dwNewStyle &= ~(WS_EX_CLIENTEDGE);
@@ -1140,7 +1146,7 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
         ccs.hWindowMenu = (HMENU) parent->GetWindowMenu()->GetHMenu();
     ccs.idFirstChild = wxFIRST_MDI_CHILD;
 
-    DWORD msStyle = WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN;
+    DWORD msStyle = /* MDIS_ALLCHILDSTYLES | */ WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN;
     if ( style & wxHSCROLL )
         msStyle |= WS_HSCROLL;
     if ( style & wxVSCROLL )
@@ -1260,6 +1266,7 @@ static void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow)
     wxWindow *parent = win->GetParent();
     wxCHECK_RET( parent, wxT("MDI client without parent frame? weird...") );
 
+    ::SendMessage(GetWinHwnd(win), WM_MDIREFRESHMENU, 0, 0L);
     ::DrawMenuBar(GetWinHwnd(parent));
 }
 
@@ -1306,7 +1313,6 @@ static void RemoveWindowMenu(wxWindow *win, WXHMENU menu)
     // Try to insert Window menu in front of Help, otherwise append it.
     HMENU hmenu = (HMENU)menu;
     int N = GetMenuItemCount(hmenu);
-    bool success = FALSE;
     for ( int i = 0; i < N; i++ )
     {
         wxChar buf[256];
@@ -1320,7 +1326,6 @@ static void RemoveWindowMenu(wxWindow *win, WXHMENU menu)
 
         if ( wxStripMenuCodes(wxString(buf)).IsSameAs(_("Window")) )
         {
-            success = TRUE;
             ::RemoveMenu(hmenu, i, MF_BYPOSITION);
             break;
         }