]> git.saurik.com Git - wxWidgets.git/commitdiff
fix (?) for MDI children style problems
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 29 Jan 2001 17:43:53 +0000 (17:43 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 29 Jan 2001 17:43:53 +0000 (17:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/msw/mdi.cpp

index 82dea25942c17cf015f41268326acc06867c6656..8b7de0efe65778bc5e68d228f9df25b24bede9fe 100644 (file)
@@ -16,6 +16,7 @@ wxBase:
 wxMSW:
 
 - threads: bug in wxCondition::Broadcast fixed (Pieter van der Meulen)
+- fixed bug in MDI children flags (mis)handling
 
 2.2.0
 -----
index 2aa8a208f79aa56444bccdad069a41992dfbd650..8ce7cfc8e9f3bc78adc1d4de00a82715cceb5f5b 100644 (file)
@@ -1088,7 +1088,8 @@ bool wxMDIChildFrame::ResetWindowStyle(void *vrect)
     wxMDIChildFrame* pChild = pFrameWnd->GetActiveChild();
     if (!pChild || (pChild == this))
     {
-        DWORD dwStyle = ::GetWindowLong(GetWinHwnd(pFrameWnd->GetClientWindow()), GWL_EXSTYLE);
+        HWND hwndClient = GetWinHwnd(pFrameWnd->GetClientWindow());
+        DWORD dwStyle = ::GetWindowLong(hwndClient, GWL_STYLE);
         DWORD dwThisStyle = ::GetWindowLong(GetHwnd(), GWL_STYLE);
         DWORD dwNewStyle = dwStyle;
         if (pChild != NULL && (dwThisStyle & WS_MAXIMIZE))
@@ -1098,15 +1099,16 @@ bool wxMDIChildFrame::ResetWindowStyle(void *vrect)
 
         if (dwStyle != dwNewStyle)
         {
-            HWND hwnd = GetWinHwnd(pFrameWnd->GetClientWindow());
-            ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);
-            ::SetWindowLong(hwnd, GWL_EXSTYLE, dwNewStyle);
-            ::SetWindowPos(hwnd, NULL, 0, 0, 0, 0,
+            // force update of everything
+            ::RedrawWindow(hwndClient, NULL, NULL,
+                           RDW_INVALIDATE | RDW_ALLCHILDREN);
+            ::SetWindowLong(hwndClient, GWL_EXSTYLE, dwNewStyle);
+            ::SetWindowPos(hwndClient, NULL, 0, 0, 0, 0,
                            SWP_FRAMECHANGED | SWP_NOACTIVATE |
                            SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
                            SWP_NOCOPYBITS);
             if (rect)
-                ::GetClientRect(hwnd, rect);
+                ::GetClientRect(hwndClient, rect);
 
             return TRUE;
         }