// Created: 30.12.01
// RCS-ID: $Id$
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
-// License: wxWindows license
+// License: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
#include "wx/frame.h"
#include "wx/control.h"
#include "wx/containr.h" // wxSetFocusToChild()
- #include "wx/module.h" // wxSetFocusToChild()
#endif //WX_PRECOMP
+#include "wx/module.h" // wxSetFocusToChild()
#include "wx/os2/private.h"
// ----------------------------------------------------------------------------
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError("Error creating frame. Error: %s\n", sError);
+ wxLogError("Error creating frame. Error: %s\n", sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError("Error creating frame. Error: %s\n", sError);
+ wxLogError("Error creating frame. Error: %s\n", sError.c_str());
return FALSE;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError("Error sizing frame. Error: %s\n", sError);
+ wxLogError("Error sizing frame. Error: %s\n", sError.c_str());
return FALSE;
}
lStyle = ::WinQueryWindowULong( m_hWnd
, wxWindowID vId
, const wxString& rsTitle
, const wxPoint& rPos
-, const wxSize& rSize
+, const wxSize& rSizeOrig
, long lStyle
, const wxString& rsName
)
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);
// We can't maximize the hidden frame because it shows it as well, so
// just remember that we should do it later in this case
//
- m_bMaximizeOnShow = TRUE;
+ m_bMaximizeOnShow = bMaximize;
}
} // end of wxTopLevelWindowOS2::Maximize