]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mdi.cpp
Also update focus rect when changing selection in single selection mode, fixes #11332
[wxWidgets.git] / src / msw / mdi.cpp
index aa931d6eaf6e414005decdb96556c0d550d700cb..ad76a20f54d2e16b2a3d1691e06460ccdddd24fe 100644 (file)
@@ -138,6 +138,14 @@ END_EVENT_TABLE()
 // the children
 // ===========================================================================
 
+void wxMDIParentFrame::Init()
+{
+#if wxUSE_MENUS && wxUSE_ACCEL
+  // the default menu doesn't have any accelerators (even if we have it)
+  m_accelWindowMenu = NULL;
+#endif // wxUSE_MENUS && wxUSE_ACCEL
+}
+
 bool wxMDIParentFrame::Create(wxWindow *parent,
                               wxWindowID id,
                               const wxString& title,
@@ -162,11 +170,6 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
       m_windowMenu->Append(wxID_MDI_WINDOW_PREV, _("&Previous"));
   }
 
-#if wxUSE_MENUS && wxUSE_ACCEL
-  // the default menu doesn't have any accelerators (even if we have it)
-  m_accelWindowMenu = NULL;
-#endif // wxUSE_MENUS && wxUSE_ACCEL
-
   if (!parent)
     wxTopLevelWindows.Append(this);
 
@@ -186,7 +189,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
   msflags &= ~WS_VSCROLL;
   msflags &= ~WS_HSCROLL;
 
-  if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(_T("wxMDIFrame")),
+  if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(wxT("wxMDIFrame")),
                             title.wx_str(),
                             pos, size,
                             msflags,
@@ -495,7 +498,7 @@ void wxMDIParentFrame::Cascade()
 void wxMDIParentFrame::Tile(wxOrientation orient)
 {
     wxASSERT_MSG( orient == wxHORIZONTAL || orient == wxVERTICAL,
-                  _T("invalid orientation value") );
+                  wxT("invalid orientation value") );
 
     ::SendMessage(GetWinHwnd(GetClientWindow()), WM_MDITILE,
                   orient == wxHORIZONTAL ? MDITILE_HORIZONTAL
@@ -792,7 +795,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
   MDICREATESTRUCT mcs;
 
   wxString className =
-      wxApp::GetRegisteredClassName(_T("wxMDIChildFrame"), COLOR_WINDOW);
+      wxApp::GetRegisteredClassName(wxT("wxMDIChildFrame"), COLOR_WINDOW);
   if ( !(style & wxFULL_REPAINT_ON_RESIZE) )
       className += wxApp::GetNoRedrawClassSuffix();
 
@@ -846,7 +849,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
   if ( !m_hWnd )
   {
-      wxLogLastError(_T("WM_MDICREATE"));
+      wxLogLastError(wxT("WM_MDICREATE"));
       return false;
   }
 
@@ -902,6 +905,14 @@ bool wxMDIChildFrame::Show(bool show)
     return true;
 }
 
+void
+wxMDIChildFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags)
+{
+    // we need to disable client area origin adjustments used for the child
+    // windows for the frame itself
+    wxMDIChildFrameBase::DoSetSize(x, y, width, height, sizeFlags);
+}
+
 // Set the client size (i.e. leave the calculation of borders etc.
 // to wxWidgets)
 void wxMDIChildFrame::DoSetClientSize(int width, int height)
@@ -1424,11 +1435,11 @@ void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow)
                             (WPARAM)hmenuFrame,
                             (LPARAM)hmenuWindow) )
         {
-#ifdef __WXDEBUG__
             DWORD err = ::GetLastError();
             if ( err )
-                wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err);
-#endif // __WXDEBUG__
+            {
+                wxLogApiError(wxT("SendMessage(WM_MDISETMENU)"), err);
+            }
         }
     }
 
@@ -1466,7 +1477,7 @@ void MDIInsertWindowMenu(wxWindow *win, WXHMENU hMenu, HMENU menuWin)
                 inserted = true;
                 ::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING,
                              (UINT_PTR)menuWin,
-                             wxGetTranslation(WINDOW_MENU_LABEL).wx_str());
+                             wxString(wxGetTranslation(WINDOW_MENU_LABEL)).wx_str());
                 break;
             }
         }
@@ -1475,7 +1486,7 @@ void MDIInsertWindowMenu(wxWindow *win, WXHMENU hMenu, HMENU menuWin)
         {
             ::AppendMenu(hmenu, MF_POPUP,
                          (UINT_PTR)menuWin,
-                         wxGetTranslation(WINDOW_MENU_LABEL).wx_str());
+                         wxString(wxGetTranslation(WINDOW_MENU_LABEL)).wx_str());
         }
     }