]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/frame.cpp
fix for page change not working after veto, #3808
[wxWidgets.git] / src / msw / frame.cpp
index 917fd8220f5a8534c368c2de3f36a5205d4f0492..76615b04fa2c73b2cb5f165e8816d08da46729b4 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));
+        }
     }
 }
 
@@ -835,58 +844,6 @@ bool wxFrame::MSWDoTranslateMessage(wxFrame *frame, WXMSG *pMsg)
 // our private (non virtual) message handlers
 // ---------------------------------------------------------------------------
 
-bool wxFrame::HandlePaint()
-{
-    RECT rect;
-    if ( ::GetUpdateRect(GetHwnd(), &rect, FALSE) )
-    {
-#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
-        if ( m_iconized )
-        {
-            const wxIcon& icon = GetIcon();
-            HICON hIcon = icon.Ok() ? GetHiconOf(icon)
-                                    : (HICON)GetDefaultIcon();
-
-            // Hold a pointer to the dc so long as the OnPaint() message
-            // is being processed
-            PAINTSTRUCT ps;
-            HDC hdc = ::BeginPaint(GetHwnd(), &ps);
-
-            // Erase background before painting or we get white background
-            MSWDefWindowProc(WM_ICONERASEBKGND, (WXWPARAM)ps.hdc, 0L);
-
-            if ( hIcon )
-            {
-                RECT rect;
-                ::GetClientRect(GetHwnd(), &rect);
-
-                // FIXME: why hardcoded?
-                static const int icon_width = 32;
-                static const int icon_height = 32;
-
-                int icon_x = (int)((rect.right - icon_width)/2);
-                int icon_y = (int)((rect.bottom - icon_height)/2);
-
-                ::DrawIcon(hdc, icon_x, icon_y, hIcon);
-            }
-
-            ::EndPaint(GetHwnd(), &ps);
-
-            return true;
-        }
-        else
- #endif
-        {
-            return wxWindow::HandlePaint();
-        }
-    }
-    else
-    {
-        // nothing to paint - processed
-        return true;
-    }
-}
-
 bool wxFrame::HandleSize(int WXUNUSED(x), int WXUNUSED(y), WXUINT id)
 {
 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
@@ -1079,10 +1036,6 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara
             }
             break;
 
-        case WM_PAINT:
-            processed = HandlePaint();
-            break;
-
 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
 #if wxUSE_MENUS
         case WM_INITMENUPOPUP: