示例#1
0
void MCStack::setgeom()
{
	if (MCnoui || !opened)
		return;

	// MW-2009-09-25: Ensure things are the right size when doing
	//   remote dialog/menu windows.
	if (window == DNULL)
	{
		state &= ~CS_NEED_RESIZE;
		// MW-2011-08-18: [[ Redraw ]] Update to use redraw.
		MCRedrawLockScreen();
		resize(rect . width, rect . height);
		MCRedrawUnlockScreen();
		mode_setgeom();
		return;
	}

	// IM-2013-10-04: [[ FullscreenMode ]] Use view methods to get / set the stack viewport
	MCRectangle t_old_rect;
	t_old_rect = view_getstackviewport();
	
	rect = view_setstackviewport(rect);
	
	state &= ~CS_NEED_RESIZE;
	
	// IM-2013-10-04: [[ FullscreenMode ]] Return values from view methods are
	// in stack coords so don't need to transform
	if (t_old_rect.x != rect.x || t_old_rect.y != rect.y || t_old_rect.width != rect.width || t_old_rect.height != rect.height)
		resize(t_old_rect.width, t_old_rect.height);
}
示例#2
0
void MCStack::setgeom()
{
	//set stack(window) size or position from script
	if (MCnoui || !opened)
		return;
	
	// MW-2009-09-25: Ensure things are the right size when doing
	//   remote dialog/menu windows.
	if (window == DNULL)
	{
		// MW-2011-08-18: [[ Redraw ]] Update to use redraw.
		MCRedrawLockScreen();
		state &= ~CS_NEED_RESIZE;
		resize(rect . width, rect . height);
		MCRedrawUnlockScreen();
		mode_setgeom();
		return;
	}
	
	// MW-2011-09-12: [[ MacScroll ]] Make sure we apply the current scroll setting.
	applyscroll();
	
	Rect windRect;
	GetPortBounds(GetWindowPort((WindowPtr)window->handle.window), &windRect);
	SetGWorld(GetWindowPort((WindowPtr)window->handle.window), GetMainDevice());
	Point p;
	p.h = windRect.left;
	p.v = windRect.top;
	LocalToGlobal(&p);
	int2 curWidth = windRect.right - windRect.left;
	int2 curHeight = windRect.bottom - windRect.top;
	if (IsWindowVisible((WindowPtr)window->handle.window))
	{
		if (mode != WM_SHEET && mode != WM_DRAWER
		        && (rect.x != p.h || rect.y != p.v))
		{
			MoveWindow((WindowPtr)window->handle.window, rect.x, rect.y, False);
			state |= CS_BEEN_MOVED;
		}
		if (rect.width != curWidth || rect.height != curHeight)
		{
			SizeWindow((WindowPtr)window->handle.window, rect.width, rect.height, True);
			resize(curWidth, curHeight + getscroll());
		}
		state &= ~CS_NEED_RESIZE;
	}
	else
	{
		if (mode != WM_SHEET && mode != WM_DRAWER)
			MoveWindow((WindowPtr)window->handle.window, rect.x, rect.y, False);
		if (rect.width != curWidth || rect.height != curHeight)
		{
			SizeWindow((WindowPtr)window->handle.window, rect.width, rect.height, True);
			resize(curWidth, curHeight + getscroll());

		}
		state &= ~(CS_BEEN_MOVED | CS_NEED_RESIZE);
	}
}
示例#3
0
void MCStack::setgeom()
{
	if (MCnoui || !opened)
		return;

	// MW-2009-09-25: Ensure things are the right size when doing
	//   remote dialog/menu windows.
	if (window == DNULL)
	{
		state &= ~CS_NEED_RESIZE;
		// MW-2011-08-18: [[ Redraw ]] Update to use redraw.
		MCRedrawLockScreen();
		resize(rect . width, rect . height);
		MCRedrawUnlockScreen();
		mode_setgeom();
		return;
	}

	uint32_t wstyle, exstyle;
	getstyle(wstyle, exstyle);
	RECT newrect = getwrect(rect, wstyle, exstyle);
	RECT wrect;
	GetWindowRect((HWND)window->handle.window, &wrect);
	LONG cx = newrect.right - newrect.left;
	LONG cy = newrect.bottom - newrect.top;
	state &= ~CS_NEED_RESIZE;
	if (wrect.right - wrect.left != cx || wrect.bottom - wrect.top != cy
	        || newrect.left != wrect.left || newrect.top != wrect.top)
	{
		state |= CS_NO_CONFIG;
		MoveWindow((HWND)window->handle.window, newrect.left, newrect.top, cx, cy, True);
		if (wrect.right - wrect.left != cx || wrect.bottom - wrect.top != cy)
			resize(uint2(wrect.right - wrect.left), uint2(wrect.bottom - wrect.top));
		state &= ~CS_NO_CONFIG;
	}
}