bool wxNonOwnedWindow::Create(wxWindow *parent,
wxWindowID id,
- const wxPoint& pos,
- const wxSize& size,
+ const wxPoint& posOrig,
+ const wxSize& sizeOrig,
long style,
const wxString& name)
{
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);
long style,
const wxString& name)
{
- int w = WidthDefault(size.x);
- int h = HeightDefault(size.y);
-
- if ( !wxNonOwnedWindow::Create(parent, id, pos, wxSize(w,h), style, name) )
+ if ( !wxNonOwnedWindow::Create(parent, id, pos, size, style, name) )
return false;
wxWindow::SetLabel( title ) ;