give frame a reasonable default size if none specified

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-09-18 15:40:15 +00:00
parent 9f8276c7d4
commit ca8bf9766e
2 changed files with 30 additions and 6 deletions

View File

@@ -455,12 +455,24 @@ void wxFrame::Init()
bool wxFrame::Create( wxWindow *parent, bool wxFrame::Create( wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString &title, const wxString& title,
const wxPoint &pos, const wxPoint& pos,
const wxSize &size, const wxSize& sizeOrig,
long style, long style,
const wxString &name ) const wxString &name )
{ {
// always create a frame of some reasonable, even if arbitrary, size (at
// least for MSW compatibility)
wxSize size = sizeOrig;
if ( size.x == -1 || size.y == -1 )
{
wxSize sizeDpy = wxGetDisplaySize();
if ( size.x == -1 )
size.x = sizeDpy.x / 3;
if ( size.y == -1 )
size.y = sizeDpy.y / 5;
}
wxTopLevelWindows.Append( this ); wxTopLevelWindows.Append( this );
m_needParent = FALSE; m_needParent = FALSE;

View File

@@ -455,12 +455,24 @@ void wxFrame::Init()
bool wxFrame::Create( wxWindow *parent, bool wxFrame::Create( wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString &title, const wxString& title,
const wxPoint &pos, const wxPoint& pos,
const wxSize &size, const wxSize& sizeOrig,
long style, long style,
const wxString &name ) const wxString &name )
{ {
// always create a frame of some reasonable, even if arbitrary, size (at
// least for MSW compatibility)
wxSize size = sizeOrig;
if ( size.x == -1 || size.y == -1 )
{
wxSize sizeDpy = wxGetDisplaySize();
if ( size.x == -1 )
size.x = sizeDpy.x / 3;
if ( size.y == -1 )
size.y = sizeDpy.y / 5;
}
wxTopLevelWindows.Append( this ); wxTopLevelWindows.Append( this );
m_needParent = FALSE; m_needParent = FALSE;