]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toplevel.cpp
applied ANI images patch and added wxUSE_ICO_CUR
[wxWidgets.git] / src / msw / toplevel.cpp
index 4482e103d9e1ec1feb45945cb2f5e253ecc0d43f..5a6f77cf954e30b695e967fe819dbd5bc4b8108b 100644 (file)
@@ -170,8 +170,8 @@ long wxTopLevelWindowMSW::MSWGetCreateWindowFlags(long *exflags) const
             *exflags |= WS_EX_TOPMOST;
 
 #ifdef __WIN32__
-      if ( m_exStyle & wxFRAME_EX_CONTEXTHELP )
-        *exflags |= WS_EX_CONTEXTHELP;
+        if ( m_exStyle & wxFRAME_EX_CONTEXTHELP )
+            *exflags |= WS_EX_CONTEXTHELP;
 #endif // __WIN32__
     }
 
@@ -196,11 +196,18 @@ bool wxTopLevelWindowMSW::CreateDialog(const wxChar *dlgTemplate,
     {
         parent = wxTheApp->GetTopWindow();
 
-        // but don't use the window which is currently hidden as then the
-        // dialog would be hidden as well
-        if ( parent && !parent->IsShown() )
+        if ( parent )
         {
-            parent = NULL;
+            // don't use transient windows as parents, this is dangerous as it
+            // can lead to a crash if the parent is destroyed before the child
+            //
+            // also don't use the window which is currently hidden as then the
+            // dialog would be hidden as well
+            if ( (parent->GetExtraStyle() & wxWS_EX_TRANSIENT) ||
+                    !parent->IsShown() )
+            {
+                parent = NULL;
+            }
         }
     }
 
@@ -379,42 +386,6 @@ wxTopLevelWindowMSW::~wxTopLevelWindowMSW()
     }
 }
 
-// ----------------------------------------------------------------------------
-// wxTopLevelWindowMSW geometry
-// ----------------------------------------------------------------------------
-
-void wxTopLevelWindowMSW::DoSetClientSize(int width, int height)
-{
-    HWND hWnd = GetHwnd();
-
-    RECT rectClient;
-    ::GetClientRect(hWnd, &rectClient);
-
-    RECT rectTotal;
-    ::GetWindowRect(hWnd, &rectTotal);
-
-    // Find the difference between the entire window (title bar and all)
-    // and the client area; add this to the new client size to move the
-    // window
-    width += rectTotal.right - rectTotal.left - rectClient.right;
-    height += rectTotal.bottom - rectTotal.top - rectClient.bottom;
-
-    // note that calling GetClientAreaOrigin() takes the toolbar into account
-    wxPoint pt = GetClientAreaOrigin();
-    width += pt.x;
-    height += pt.y;
-
-    if ( !::MoveWindow(hWnd, rectTotal.left, rectTotal.top,
-                       width, height, TRUE /* redraw */) )
-    {
-        wxLogLastError(_T("MoveWindow"));
-    }
-
-    wxSizeEvent event(wxSize(width, height), m_windowId);
-    event.SetEventObject(this);
-    (void)GetEventHandler()->ProcessEvent(event);
-}
-
 // ----------------------------------------------------------------------------
 // wxTopLevelWindowMSW showing
 // ----------------------------------------------------------------------------