]> git.saurik.com Git - wxWidgets.git/commitdiff
Very lame fix for windows with -1 for a component of position or size
authorDavid Elliott <dfe@tgwbd.org>
Thu, 13 Nov 2003 14:33:30 +0000 (14:33 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Thu, 13 Nov 2003 14:33:30 +0000 (14:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/toplevel.mm

index ddb40bff3b48525053ebf860e6bbf8a59ee72412..c1ef688bda803a6dfd3082e0edda3ad09c14107d 100644 (file)
@@ -100,8 +100,19 @@ bool wxTopLevelWindowCocoa::Create(wxWindow *parent,
     if(style & wxFRAME_TOOL_WINDOW)
         cocoaStyle |= NSUtilityWindowMask;
 
+    wxPoint realpos = pos;
+    wxSize realsize = size;
+    // FIXME: this is lame
+    if(realpos.x==-1)
+        realpos.x=100;
+    if(realpos.y==-1)
+        realpos.y=100;
+    if(realsize.x==-1)
+        realsize.x=200;
+    if(realsize.y==-1)
+        realsize.y=200;
     // NOTE: y-origin needs to be flipped.
-    NSRect cocoaRect = [NSWindow contentRectForFrameRect:NSMakeRect(pos.x,pos.y,size.x,size.y) styleMask:cocoaStyle];
+    NSRect cocoaRect = [NSWindow contentRectForFrameRect:NSMakeRect(realpos.x,realpos.y,realsize.x,realsize.y) styleMask:cocoaStyle];
 
     m_cocoaNSWindow = NULL;
     m_cocoaNSView = NULL;