]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mdi.cpp
Unicode fixes
[wxWidgets.git] / src / msw / mdi.cpp
index 0a434266202269f3d0ca2febc1475649b834a430..44a6a21faac4db995a5f7205972bce79ef249db0 100644 (file)
@@ -537,10 +537,7 @@ bool wxMDIParentFrame::MSWTranslateMessage(WXMSG* msg)
         return TRUE;
     }
 
-    if ( m_acceleratorTable.Ok() &&
-         ::TranslateAccelerator(GetHwnd(),
-                                GetTableHaccel(m_acceleratorTable),
-                                pMsg) )
+    if ( m_acceleratorTable.Translate(this, msg) )
     {
         return TRUE;
     }
@@ -732,25 +729,35 @@ void wxMDIChildFrame::InternalSetMenuBar()
 // MDI operations
 // ---------------------------------------------------------------------------
 
-void wxMDIChildFrame::Maximize()
+void wxMDIChildFrame::Maximize(bool maximize)
 {
     wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
     if ( parent && parent->GetClientWindow() )
-        ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIMAXIMIZE, (WPARAM) GetHwnd(), 0);
+    {
+        ::SendMessage(GetWinHwnd(parent->GetClientWindow()),
+                      maximize ? WM_MDIMAXIMIZE : WM_MDIRESTORE,
+                      (WPARAM)GetHwnd(), 0);
+    }
 }
 
 void wxMDIChildFrame::Restore()
 {
     wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
     if ( parent && parent->GetClientWindow() )
-        ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIRESTORE, (WPARAM) GetHwnd(), 0);
+    {
+        ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIRESTORE,
+                      (WPARAM) GetHwnd(), 0);
+    }
 }
 
 void wxMDIChildFrame::Activate()
 {
     wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
     if ( parent && parent->GetClientWindow() )
-        ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIACTIVATE, (WPARAM) GetHwnd(), 0);
+    {
+        ::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIACTIVATE,
+                      (WPARAM) GetHwnd(), 0);
+    }
 }
 
 // ---------------------------------------------------------------------------
@@ -993,15 +1000,7 @@ long wxMDIChildFrame::MSWDefWindowProc(WXUINT message, WXUINT wParam, WXLPARAM l
 
 bool wxMDIChildFrame::MSWTranslateMessage(WXMSG* msg)
 {
-    MSG *pMsg = (MSG *)msg;
-    if ( m_acceleratorTable.Ok() )
-    {
-        return ::TranslateAccelerator(GetWinHwnd(GetParent()),
-                                      GetTableHaccel(m_acceleratorTable),
-                                      pMsg) != 0;
-    }
-
-    return FALSE;
+    return m_acceleratorTable.Translate(GetParent(), msg);
 }
 
 // ---------------------------------------------------------------------------