X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5276b0a53cef4815230e39b54d2ecda14f72cbd1..a5655d37db9baabce654849fd66173f95f74e230:/src/osx/nonownedwnd_osx.cpp diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index 638af1d7ac..5ed8b5993f 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -101,8 +101,8 @@ void wxNonOwnedWindow::Init() bool wxNonOwnedWindow::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, + const wxPoint& posOrig, + const wxSize& sizeOrig, long style, const wxString& name) { @@ -114,22 +114,23 @@ bool wxNonOwnedWindow::Create(wxWindow *parent, m_windowStyle = style; m_isShown = false; - // create frame. - int x = (int)pos.x; - int y = (int)pos.y; - - wxRect display = wxGetClientDisplayRect() ; - - if ( x == wxDefaultPosition.x ) - x = display.x ; + // use the appropriate defaults for the position and size if necessary + wxPoint pos(posOrig); + if ( !pos.IsFullySpecified() ) + pos.SetDefaults(wxGetClientDisplayRect().GetPosition()); - if ( y == wxDefaultPosition.y ) - y = display.y ; + wxSize size(sizeOrig); + if ( !size.IsFullySpecified() ) + size.SetDefaults(wxTopLevelWindow::GetDefaultSize()); - int w = WidthDefault(size.x); - int h = HeightDefault(size.y); - - m_nowpeer = wxNonOwnedWindowImpl::CreateNonOwnedWindow(this, parent, wxPoint(x,y) , wxSize(w,h) , style , GetExtraStyle(), name ); + // create frame. + m_nowpeer = wxNonOwnedWindowImpl::CreateNonOwnedWindow + ( + this, parent, + pos , size, + style, GetExtraStyle(), + name + ); wxNonOwnedWindowImpl::Associate( m_nowpeer->GetWXWindow() , m_nowpeer ) ; m_peer = wxWidgetImpl::CreateContentView(this);