예제 #1
0
void
__glutFinishMenu(Window win, int x, int y)
{

  unmapMenu(__glutMappedMenu);

  /* XXX Put in a GdiFlush just in case.  Probably unnecessary. -mjk  */
  GdiFlush();

  if (__glutMenuStatusFunc) {
    __glutSetWindow(__glutMenuWindow);
    __glutSetMenu(__glutMappedMenu);

    /* Setting __glutMappedMenu to NULL permits operations that
       change menus or destroy the menu window again. */
    __glutMappedMenu = NULL;

    __glutMenuStatusFunc(GLUT_MENU_NOT_IN_USE, x, y);
  }
  /* Setting __glutMappedMenu to NULL permits operations that
     change menus or destroy the menu window again. */
  __glutMappedMenu = NULL;

  /* If an item is selected and it is not a submenu trigger,
     generate menu callback. */
  if (__glutItemSelected && !__glutItemSelected->isTrigger) {
    __glutSetWindow(__glutMenuWindow);
    /* When menu callback is triggered, current menu should be
       set to the callback menu. */
    __glutSetMenu(__glutItemSelected->menu);
    __glutItemSelected->menu->select(__glutItemSelected->value);
  }
  __glutMenuWindow = NULL;
}
예제 #2
0
void fgFinishMenu(SFG_Window *win, int x, int y)
{	
	unmapMenu(fgMappedMenu);
	
	if(fgState.MenuStatusCallback) 
	{
		fgSetWindow(fgMenuWindow);
		fgSetMenu(fgMappedMenu);
		
		/* Setting fgMappedMenu to NULL permits operations that
		change menus or destroy the menu window again. */
		fgMappedMenu = NULL;
		
		fgState.MenuStatusCallback(GLUT_MENU_NOT_IN_USE, x, y);
	}
	/* Setting fgMappedMenu to NULL permits operations that
	change menus or destroy the menu window again. */
	fgMappedMenu = NULL;
	
	/* If an item is selected and it is not a submenu trigger,
	generate menu callback. */
	if(fgItemSelected && !fgItemSelected->IsTrigger) 
	{
		fgSetWindow(fgMenuWindow);
		/* When menu callback is triggered, current menu should be
		set to the callback menu. */
		fgSetMenu(fgItemSelected->Menu);
		fgItemSelected->Menu->Select(fgItemSelected->Value);
	}
	fgMenuWindow = NULL;
}
예제 #3
0
static void
unmapMenu(GLUTmenu * menu)
{
  if (menu->cascade) {
    unmapMenu(menu->cascade);
    menu->cascade = NULL;
  }
  menu->anchor = NULL;
  menu->highlighted = NULL;
}
예제 #4
0
static void unmapMenu(SFG_WinMenu * menu)
{
	if (menu->Cascade) 
	{
		unmapMenu(menu->Cascade);
		menu->Cascade = NULL;
	}
	menu->Anchor = NULL;
	menu->Highlighted = NULL;
}