]> git.saurik.com Git - wxWidgets.git/commitdiff
Insure that top level windows will be at least visible
authorStefan Neis <Stefan.Neis@t-online.de>
Wed, 1 Oct 2003 21:50:56 +0000 (21:50 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Wed, 1 Oct 2003 21:50:56 +0000 (21:50 +0000)
        when relying on default size.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24045 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/toplevel.cpp

index 6dd52d2bd3a010ae7c5d0b7a824f65ba9b215a39..c3bea8a366b4c2af6107cffdd027e347f61d522d 100644 (file)
@@ -581,7 +581,7 @@ bool wxTopLevelWindowOS2::Create(
 , wxWindowID                        vId
 , const wxString&                   rsTitle
 , const wxPoint&                    rPos
-, const wxSize&                     rSize
+, const wxSize&                     rSizeOrig
 , long                              lStyle
 , const wxString&                   rsName
 )
@@ -593,6 +593,19 @@ bool wxTopLevelWindowOS2::Create(
     m_windowStyle = lStyle;
     SetName(rsName);
     m_windowId = vId == -1 ? NewControlId() : vId;
+
+    // always create a frame of some reasonable, even if arbitrary, size (at
+    // least for MSW compatibility)
+    wxSize rSize = rSizeOrig;
+    if ( rSize.x == -1 || rSize.y == -1 )
+    {
+        wxSize sizeDpy = wxGetDisplaySize();
+        if ( rSize.x == -1 )
+            rSize.x = sizeDpy.x / 3;
+        if ( rSize.y == -1 )
+            rSize.y = sizeDpy.y / 5;
+    }
+
     wxTopLevelWindows.Append(this);
     if (pParent)
         pParent->AddChild(this);