当前位置: 首页>>代码示例>>C++>>正文


C++ MainMenu::Show方法代码示例

本文整理汇总了C++中MainMenu::Show方法的典型用法代码示例。如果您正苦于以下问题:C++ MainMenu::Show方法的具体用法?C++ MainMenu::Show怎么用?C++ MainMenu::Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainMenu的用法示例。


在下文中一共展示了MainMenu::Show方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ShowMenu

void Game::ShowMenu() {
    MainMenu mainMenu;
    MainMenu::MenuResult result=mainMenu.Show(_mainWindow);
    if(result == MainMenu::Exit) {
        _gameState = Game::Exiting;
    }
    if(result == MainMenu::newGame) {
        _gameState = Game::newGame;
    }
    if(result == MainMenu::joinGame) {
        _gameState = Game::joinGame;
    }
}
开发者ID:umapriyadarsi,项目名称:Operation-Stronghold,代码行数:13,代码来源:Game.cpp

示例2: ShowMenu

void Game::ShowMenu()
{
	MainMenu mainMenu;
	MainMenu::MenuResult result = mainMenu.Show(_mainWindow);
	switch(result)
	{
	case MainMenu::Exit:
		_gameState = Game::Exiting;
		break;
	case MainMenu::Play1:
		_gameState = Game::Playing;
		break;
	}
}
开发者ID:dragoon20,项目名称:codeur-de-chevalier-tower-defense,代码行数:14,代码来源:Game.cpp

示例3: ShowMenu

void Game::ShowMenu()
{
  MainMenu mainMenu;
  MainMenu::MenuResult result = mainMenu.Show(_mainWindow);
  switch(result)
  {
  case MainMenu::Exit:
     _gameState = Game::Exiting;
     break;
   case MainMenu::Play:
	InstructionScreen instructionScreen;
	instructionScreen.Show(_mainWindow);
    ResetGame();
    _gameState = Game::Playing;
     break;
   case MainMenu::Music:
	 _gameState = Game::ShowingMenu;
	 if(ServiceLocator::GetAudio()->IsSongPlaying())
	 {
		ServiceLocator::GetAudio()->StopAllSounds();
	 }
	 break;
  }
}
开发者ID:NicodySazawa,项目名称:Paint_Wars_C_Plus_Plus_Sample,代码行数:24,代码来源:game.cpp

示例4: ufusr

//------------------------------- DIALOG LAUNCHING ---------------------------------
//
//    Before invoking this application one needs to open any part/empty part in NX
//    because of the behavior of the blocks.
//
//    Make sure the dlx file is in one of the following locations:
//        1.) From where NX session is launched
//        2.) $UGII_USER_DIR/application
//        3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly
//            recommended. This variable is set to a full directory path to a file 
//            containing a list of root directories for all custom applications.
//            e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_ROOT_DIR\menus\custom_dirs.dat
//
//    You can create the dialog using one of the following way:
//
//    1. USER EXIT
//
//        1) Create the Shared Library -- Refer "Block UI Styler programmer's guide"
//        2) Invoke the Shared Library through File->Execute->NX Open menu.
//
//------------------------------------------------------------------------------
extern "C" DllExport void  ufusr(char *param, int *retcod, int param_len)
{
    NXCoCADTest *theNXCoCADTest = NULL;
	taskNum = 1;
	char buffer[255];
	int temp;
	int i = 0;
	DWORD test = 0;    ///< 0 represents the first thread
	HANDLE handle;
	DWORD numThreadId = 0;
	myUI = UI::GetUI();
	message = myUI->NXMessageBox();

    try
    {
        //theNXCoCADTest = new NXCoCADTest();
		//handle = CreateThread(NULL, 0, ThreadProc, (LPVOID)&test, 0, &numThreadId);

        // The following method shows the dialog immediately
        //theNXCoCADTest->Show();
        //if(bTimerEnable)
        //{
            //KillTimer(NULL, nTimerID);
        //}
		g_timer_id = SetTimer(NULL, 0 ,2000, timer_cb);
		if(!Initialize())
		{
			NXCoCADTest::theUI->NXMessageBox()->Show("Iniliazation Failed", NXOpen::NXMessageBox::DialogTypeError, "Iniliazation Failed");
			return;
		}
		 MainMenu *theMainMenu = NULL;
		 theMainMenu = new MainMenu();
		 theMainMenu->Show();
    }
    catch(exception& ex)
    {
        //---- Enter your exception handling code here -----
        NXCoCADTest::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
    }


	if (handle)
	{
		message->Show("提示",NXMessageBox::DialogTypeQuestion,"delete subThread");
		CloseHandle(handle);
	}


    if(theNXCoCADTest != NULL)
    {
        delete theNXCoCADTest;
        theNXCoCADTest = NULL;
        //if(bTimerEnable)
        //{
        //    KillTimer(NULL, nTimerID);
        //}
        Terminate();
        //Terminate();
    }
	KillTimer(NULL,g_timer_id);
}
开发者ID:sinery0320,项目名称:nxcocadapp,代码行数:82,代码来源:NXCoCADTest.cpp


注:本文中的MainMenu::Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。