Correctly handle default position values of -1 in wxQT, thanks @seandepagnier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mariano Reingart 2014-09-29 03:06:27 +00:00
parent 2d83f86841
commit b922ee8ac9

View File

@ -227,7 +227,11 @@ bool wxWindowQt::Create( wxWindowQt * parent, wxWindowID id, const wxPoint & pos
parent->AddChild( this );
DoMoveWindow( pos.x, pos.y, size.GetWidth(), size.GetHeight() );
wxPoint p;
if(pos != wxDefaultPosition)
p = pos;
DoMoveWindow( p.x, p.y, size.GetWidth(), size.GetHeight() );
PostCreation();
@ -808,6 +812,14 @@ void wxWindowQt::DoSetSize(int x, int y, int width, int height, int sizeFlags )
if ( height == wxDefaultCoord && ( sizeFlags & wxSIZE_AUTO_HEIGHT ))
height = BEST_SIZE.y;
}
int w, h;
GetSize(&w, &h);
if (width == -1)
width = w;
if (height == -1)
height = h;
DoMoveWindow( x, y, width, height );
}