]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxMaximizeEvent generation
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 15 Sep 2004 22:14:05 +0000 (22:14 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 15 Sep 2004 22:14:05 +0000 (22:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/msw/frame.cpp
src/msw/window.cpp

index ab450d5a7d59c56007c987033aeca9f4891195bb..0f9d1197218849ac417257fbd9a972df40b0b606 100644 (file)
@@ -272,6 +272,7 @@ wxMSW:
 - fixed flat style for toolbars under XP, Windows Classic style
 - fixed truncation of transferred data in wxConnection under unicode build
 - wxChoice and wxComboBox dropdown background can be set now too (Adrian Lupei)
+- fixed wxMaximizeEvent generation in wxFrame
 
 wxUniv/X11:
 
index 0fd73e50bcd5ae46e0988a69dddfade59ee32e92..042978c4e884ad39e9525589d059da436a697d49 100644 (file)
@@ -658,6 +658,8 @@ void wxFrame::PositionToolBar()
 // on the desktop, but are iconized/restored with it
 void wxFrame::IconizeChildFrames(bool bIconize)
 {
+    m_iconized = bIconize;
+
     for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
           node;
           node = node->GetNext() )
@@ -788,14 +790,13 @@ bool wxFrame::HandlePaint()
     }
 }
 
-bool wxFrame::HandleSize(int x, int y, WXUINT id)
+bool wxFrame::HandleSize(int WXUNUSED(x), int WXUNUSED(y), WXUINT id)
 {
-    bool processed = false;
 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
-
     switch ( id )
     {
-        case SIZENORMAL:
+        case SIZE_RESTORED:
+        case SIZE_MAXIMIZED:
             // only do it it if we were iconized before, otherwise resizing the
             // parent frame has a curious side effect of bringing it under it's
             // children
@@ -806,23 +807,14 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id)
             IconizeChildFrames(false);
 
             (void)SendIconizeEvent(false);
-
-            // fall through
-
-        case SIZEFULLSCREEN:
-            m_iconized = FALSE;
             break;
 
-        case SIZEICONIC:
+        case SIZE_MINIMIZED:
             // iconize all child frames too
             IconizeChildFrames(true);
-
-            (void)SendIconizeEvent();
-
-            m_iconized = true;
             break;
     }
-#endif
+#endif // !__WXWINCE__
 
     if ( !m_iconized )
     {
@@ -848,13 +840,11 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id)
             }
 
         }
-#endif
-
-
-        processed = wxWindow::HandleSize(x, y, id);
+#endif // WINCE_WITH_COMMANDBAR
     }
 
-    return processed;
+    // call the base class version to generate the appropriate events
+    return false;
 }
 
 bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
index 2bc19adc48a90a8800c2414138ef74a7e93b9482..ede0741c546bd69903780860457bf5db09fac6f8 100644 (file)
@@ -2285,31 +2285,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
 #endif
 
         case WM_SIZE:
-            switch ( wParam )
-            {
-                case SIZE_MAXHIDE:
-                case SIZE_MAXSHOW:
-                    // we're not interested in these messages at all
-                    break;
-
-                case SIZE_MINIMIZED:
-                    // we shouldn't send sizev events for these messages as the
-                    // client size may be negative which breaks existing code
-                    //
-                    // OTOH we might send another (wxMinimizedEvent?) one or
-                    // add an additional parameter to wxSizeEvent if this is
-                    // useful to anybody
-                    break;
-
-                default:
-                    wxFAIL_MSG( _T("unexpected WM_SIZE parameter") );
-                    // fall through nevertheless
-
-                case SIZE_MAXIMIZED:
-                case SIZE_RESTORED:
-                    processed = HandleSize(LOWORD(lParam), HIWORD(lParam),
-                                           wParam);
-            }
+            processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
             break;
 
 #if !defined(__WXWINCE__)
@@ -4187,16 +4163,40 @@ bool wxWindowMSW::HandleMoving(wxRect& rect)
     return rc;
 }
 
-bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h),
-                             WXUINT WXUNUSED(flag))
+bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
 {
-    // don't use w and h parameters as they specify the client size while
-    // according to the docs EVT_SIZE handler is supposed to receive the total
-    // size
-    wxSizeEvent event(GetSize(), m_windowId);
-    event.SetEventObject(this);
+    bool processed = false;
 
-    return GetEventHandler()->ProcessEvent(event);
+    switch ( wParam )
+    {
+        default:
+            wxFAIL_MSG( _T("unexpected WM_SIZE parameter") );
+            // fall through nevertheless
+
+        case SIZE_MAXHIDE:
+        case SIZE_MAXSHOW:
+            // we're not interested in these messages at all
+            break;
+
+        case SIZE_MINIMIZED:
+            processed = HandleMinimize();
+            break;
+
+        case SIZE_MAXIMIZED:
+            processed = HandleMaximize();
+            // fall through to send a normal size event as well
+
+        case SIZE_RESTORED:
+            // don't use w and h parameters as they specify the client size
+            // while according to the docs EVT_SIZE handler is supposed to
+            // receive the total size
+            wxSizeEvent event(GetSize(), m_windowId);
+            event.SetEventObject(this);
+
+            processed = GetEventHandler()->ProcessEvent(event);
+    }
+
+    return processed;
 }
 
 bool wxWindowMSW::HandleSizing(wxRect& rect)