From b922ee8ac963635c804dc9eab8c9a1ee13169584 Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Mon, 29 Sep 2014 03:06:27 +0000 Subject: [PATCH] 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 --- src/qt/window.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 76c3ec29be..74a3c91fa6 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -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 ); }