Very lame fix for windows with -1 for a component of position or size

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2003-11-13 14:33:30 +00:00
parent 46cdffaf79
commit 9f13cca8f6

View 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;