Exemplo n.º 1
0
void MCStacklist::hidepalettes(Boolean hide)
{
	active = !hide;
	if (stacks == NULL)
		return;
	MCStacknode *tptr = stacks;
	// only hide palettes if a non-palette is open
	Boolean dohide = False;
	do
	{
		MCStack *sptr = tptr->getstack();
		if (sptr->getrealmode() < WM_PALETTE)
		{
			dohide = True;
			break;
		}
		tptr = tptr->next();
	}
	while (tptr != stacks);
	if (!dohide)
		return;

	restart = False;
	tptr = stacks;
	do
	{
		MCStack *sptr = tptr->getstack();
		if (sptr->getrealmode() == WM_PALETTE && sptr->getflag(F_VISIBLE))
			if (MChidepalettes)
			{
				// Show the window non-active (to avoid messing with the focus),
				// then send a synthetic activate event to force a title-bar redraw
				ShowWindow((HWND)sptr->getw()->handle.window, hide ? SW_HIDE : SW_SHOWNA);
				PostMessageA((HWND)sptr->getw()->handle.window, WM_NCACTIVATE, 1, 0);
				// When closing or opening a window, Win32 delivers messages that can
				// change stack list, and we need to start over if this happened
				if (restart)
				{
					hidepalettes(hide);
					return;
				}

			}
			else if (sptr->getw() != NULL)
			{
				// OK-2007-04-19: Bug 4728, When hiding a palette with a windowShape
				// sptr->getw() can return null, causing crash here.
				PostMessageA((HWND)sptr->getw()->handle.window, WM_NCACTIVATE, !hide, 0);
			}
				
		tptr = tptr->next();
	}
	while (tptr != stacks);
}
Exemplo n.º 2
0
void MCRedrawDirtyScreen(void)
{
	MCStacknode *t_stacks;
	t_stacks = MCstacks -> topnode();
	if (t_stacks == nil)
		return;

	// MW-2011-10-17: [[ Bug 9810 ]] Make sure we don't miss any stacks
	//   (was previously looping back to t_stacks, not prev(t_stacks).
	MCStacknode *tptr = t_stacks->prev();
	do
	{
		MCStack *sptr = tptr->getstack();
		sptr -> dirtyall();
		tptr = tptr->prev();
	}
	while (tptr != t_stacks -> prev());
}
Exemplo n.º 3
0
void MCStacklist::hidepalettes(Boolean hide)
{
	active = !hide;
	if (stacks == NULL)
		return;
	MCStacknode *tptr = stacks;

	// only hide palettes if a non-palette is open
	Boolean dohide = False;
	do
	{
		MCStack *sptr = tptr->getstack();
		if (sptr->getrealmode() < WM_PALETTE)
		{
			dohide = True;
			break;
		}
		tptr = tptr->next();
	}
	while (tptr != stacks);
	if (!dohide)
		return;

	restart = False;
	tptr = stacks;
	do
	{
		MCStack *sptr = tptr->getstack();
		if (sptr->getrealmode() == WM_PALETTE && sptr->getflag(F_VISIBLE))
			if (MChidepalettes)
			{
				if (hide)
					MCscreen->closewindow(sptr->getw());
				else
					sptr -> openwindow(False);
			}

		tptr = tptr->next();
	}
	while (tptr != stacks);
}
Exemplo n.º 4
0
void MCRedrawDoUpdateScreen(void)
{
	if (MClockscreen != 0)
		return;

	if (!s_screen_is_dirty)
		return;
	
	if (s_screen_updates_disabled)
		return;
		
	MCStacknode *t_stacks;
	t_stacks = MCstacks -> topnode();
	if (t_stacks == nil)
		return;

	MCStacknode *tptr = t_stacks->prev();
	do
	{
		MCStack *sptr = tptr->getstack();

		if (sptr->getstate(CS_NEED_RESIZE))
		{
			sptr->setgeom();
			sptr->openrect(sptr->getrect(), WM_LAST, NULL, WP_DEFAULT, OP_NONE);
			MCRedrawUpdateScreen();
			return;
		}

		sptr -> applyupdates();

		tptr = tptr->prev();
	}
	while (tptr != t_stacks->prev());

	s_screen_is_dirty = false;
	
	MCredrawupdatescreenneeded = MClockscreen == 0 && s_screen_is_dirty && !s_screen_updates_disabled;
}