]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/frame.cpp
Call RecreateControls() if relevant window style flag was toggled
[wxWidgets.git] / src / msw / frame.cpp
index 4cf00e18b3e4e040303c699fb89f529afd9e04ff..2477f815d82dbd1588f6245520f40b8081a1665a 100644 (file)
@@ -310,15 +310,24 @@ void wxFrame::Raise()
 }
 
 // generate an artificial resize event
-void wxFrame::SendSizeEvent()
+void wxFrame::SendSizeEvent(int flags)
 {
     if ( !m_iconized )
     {
         RECT r = wxGetWindowRect(GetHwnd());
 
-        (void)::PostMessage(GetHwnd(), WM_SIZE,
-                            IsMaximized() ? SIZE_MAXIMIZED : SIZE_RESTORED,
-                            MAKELPARAM(r.right - r.left, r.bottom - r.top));
+        if ( flags & wxSEND_EVENT_POST )
+        {
+            ::PostMessage(GetHwnd(), WM_SIZE,
+                          IsMaximized() ? SIZE_MAXIMIZED : SIZE_RESTORED,
+                          MAKELPARAM(r.right - r.left, r.bottom - r.top));
+        }
+        else // send it
+        {
+            ::SendMessage(GetHwnd(), WM_SIZE,
+                          IsMaximized() ? SIZE_MAXIMIZED : SIZE_RESTORED,
+                          MAKELPARAM(r.right - r.left, r.bottom - r.top));
+        }
     }
 }
 
@@ -819,13 +828,10 @@ bool wxFrame::MSWDoTranslateMessage(wxFrame *frame, WXMSG *pMsg)
         return true;
 
 #if wxUSE_MENUS && wxUSE_ACCEL && !defined(__WXUNIVERSAL__)
-    // try the menu bar accels
+    // try the menu bar accelerators
     wxMenuBar *menuBar = GetMenuBar();
-    if ( menuBar )
-    {
-        const wxAcceleratorTable& acceleratorTable = menuBar->GetAccelTable();
-        return acceleratorTable.Translate(frame, pMsg);
-    }
+    if ( menuBar && menuBar->GetAcceleratorTable()->Translate(frame, pMsg) )
+        return true;
 #endif // wxUSE_MENUS && wxUSE_ACCEL
 
     return false;