]> git.saurik.com Git - wxWidgets.git/commitdiff
MSWGetCreateWindowCoords is already setting CW_USEDEFAULT as needed
authorRobin Dunn <robin@alldunn.com>
Mon, 15 Mar 2004 21:34:27 +0000 (21:34 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 15 Mar 2004 21:34:27 +0000 (21:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/toplevel.cpp

index 9ac4d707b2809badecbfa88ecd463ea3ccc04769..7246affec86b384874db50edad8c57ba91d14a25 100644 (file)
@@ -392,34 +392,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
 
     // move the dialog to its initial position without forcing repainting
     int x, y, w, h;
-    if ( !MSWGetCreateWindowCoords(pos, size, x, y, w, h) )
-    {
-        x =
-        w = (int)CW_USEDEFAULT;
-    }
-
-    // we can't use CW_USEDEFAULT here as we're not calling CreateWindow()
-    // and passing CW_USEDEFAULT to MoveWindow() results in resizing the
-    // window to (0, 0) size which breaks quite a lot of things, e.g. the
-    // sizer calculation in wxSizer::Fit()
-    if ( w == (int)CW_USEDEFAULT )
-    {
-        // the exact number doesn't matter, the dialog will be resized
-        // again soon anyhow but it should be big enough to allow
-        // calculation relying on "totalSize - clientSize > 0" work, i.e.
-        // at least greater than the title bar height
-        w =
-        h = 100;
-    }
-
-    if ( x == (int)CW_USEDEFAULT )
-    {
-        // centre it on the screen - what else can we do?
-        wxSize sizeDpy = wxGetDisplaySize();
-
-        x = (sizeDpy.x - w) / 2;
-        y = (sizeDpy.y - h) / 2;
-    }
+    (void)MSWGetCreateWindowCoords(pos, size, x, y, w, h);
 
     if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) )
     {