]> git.saurik.com Git - wxWidgets.git/commitdiff
generate size event when the dialog is shown for consistency with frames and other...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 May 2008 01:30:49 +0000 (01:30 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 May 2008 01:30:49 +0000 (01:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dialog.cpp

index 0a923fccce87413cb2ca49c6031f4217c065fee3..d89e8ede2c441173a7f25cd59a8475d50af5a440 100644 (file)
@@ -256,13 +256,15 @@ bool wxDialog::Show(bool show)
 
     if ( show )
     {
-        // dialogs don't get WM_SIZE message after creation unlike most (all?)
-        // other windows and so could start their life non laid out correctly
-        // if we didn't call Layout() from here
+        // dialogs don't get WM_SIZE message from ::ShowWindow() for some
+        // reason so generate it ourselves for consistency with frames and
+        // dialogs in other ports
         //
         // NB: normally we should call it just the first time but doing it
         //     every time is simpler than keeping a flag
-        Layout();
+        const wxSize size = GetClientSize();
+        ::SendMessage(GetHwnd(), WM_SIZE,
+                      SIZE_RESTORED, MAKELPARAM(size.x, size.y));
     }
 
     return true;
@@ -520,20 +522,6 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar
             }
             break;
 
-        case WM_WINDOWPOSCHANGED:
-            {
-                WINDOWPOS * const wp = wx_reinterpret_cast(WINDOWPOS *, lParam);
-                if ( wp->flags & SWP_SHOWWINDOW )
-                {
-                    // we should only show it now to ensure that it's really
-                    // positioned underneath under all the other controls in
-                    // the dialog, if we showed it before it could overlap them
-                    if ( m_hGripper )
-                        ShowGripper(true);
-                }
-            }
-            break;
-
 #ifndef __WXMICROWIN__
         case WM_SETCURSOR:
             // we want to override the busy cursor for modal dialogs: