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


C++ MenuManager类代码示例

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


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

示例1: Quit

//=============================================================================
// MenuManager::Quit
//
//=============================================================================
int GameEngine::Quit(void)
{
	char c='\0';

	BM.TypeString(63, 6, "               \0", m_color(R_BLUE,R_GREY,0,1));
	BM.TypeString(79, 6, "_", m_color(R_BLUE, R_BROWN, 1,1));
	BM.TypeString(64, 6, "End this game?\0", m_color(R_BLUE,R_GREY,0,1));

	// check answer
	while ( (c!='y') && (c!='Y') && (c!='n') && (c!='N') )
	{
		// read a key from the keyboard buffer.
		c=MM.GetChar();
	}

	// if yes was typed, pass the exit code to the calling loop.
	if (c=='y' || c=='Y')
		return 1;
	else
	{
		// otherwise, redraw the GAMNEMENU and return the exit code.
		MM.DrawMenu(GAMEMENU);
		return 0;
	}
}
开发者ID:wbovela,项目名称:zztpp,代码行数:29,代码来源:ge.cpp

示例2: TRACEST

ITSMenu& PlayListPane::GetInternalMenu(MenusEnum mnu)
{
	TRACEST(_T("PlayListPane::GetMenu."), mnu);
	ASSERT(mnu < M_Last);
	PrgAPI* pAPI = PRGAPI();
	if (m_pMenu[mnu] == NULL)
		m_pMenu[mnu] = pAPI->CreatePopupMenu();
	ITSMenu& curMenu = *m_pMenu[mnu];
	if (curMenu.GetInternalHandler() != NULL)
		return curMenu;
	curMenu.Create();
	switch (mnu)
	{
	case M_Main:
		{
			MenuManager* pMM = pAPI->GetMenuManager();
			curMenu.AppendMenu(ITSMenu::MIT_Menu, 
				(INT)pMM->GetMenu(MenuManager::MNU_PlayListModes).GetInternalHandler(), (LPTSTR)pAPI->GetString(IDS_MODE));
			
			curMenu.AppendMenu(ITSMenu::MIT_Menu, 
				(INT)pMM->GetMenu(MenuManager::MNU_PlayListSerialization).GetInternalHandler(), (LPTSTR)pAPI->GetString(IDS_PLAYLIST));

			curMenu.AppendMenu(ITSMenu::MIT_Separator, NULL, NULL);
			curMenu.AppendMenu(ITSMenu::MIT_String, MI_ShowNumbers, (LPTSTR)pAPI->GetString(IDS_SHOWNUMBERS));
		}
		break;
	default:
		ASSERT(0);
	}
	return curMenu;
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:31,代码来源:PlayListPane.cpp

示例3: switch

ITSMenu* PlayListPane::GetMenu(UINT idx)
{
	switch (idx)
	{
	case BTN_Options:
		{
			PrgAPI* pAPI = PRGAPI();
			MediaPlayer* pPlayer = pAPI->GetMediaPlayer();
			MenuManager* pMM = pAPI->GetMenuManager();
			MenuCommandsEnum cmd = (MenuCommandsEnum) idx;
			ITSMenu& mnu = GetInternalMenu(M_Main);
			pMM->PreparePlayerCommands(*pPlayer);
			mnu.CheckMenuItem(MI_ShowNumbers, m_PlayList.GetConfigurationOption(CPlayListListCtrl::C_ShowNumbers) != 0);
			return &mnu;
		}
		break;
	case BTN_QuickSearch:
		{
			PrgAPI* pAPI = PRGAPI();
			QuickSearchDlg* pQSDlg = pAPI->GetQuickSearchDlg();
			pQSDlg->SetSearchText(_T(""));
			pQSDlg->ShowRelative(AfxGetMainWnd(), QuickSearchDlg::RP_Centered);
			return NULL;
		}
		break;
	default:
		return NULL;
	}
	return NULL;
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:30,代码来源:PlayListPane.cpp

示例4: main

int main()
{
	sf::VideoMode videoMode(WINDOW_WIDTH, WINDOW_HEIGHT);
	sf::RenderWindow window(videoMode, "~~~Tower Defense!~~~");
	window.setFramerateLimit(FRAME_RATE);

	shared_ptr<AudioManager> audio = AudioManager::getAudioManager();
	audio->play();

	MenuManager* menuManager = MenuManager::getMenuManager();
	menuManager->addMenu(make_shared<StartMenu>(START_MENU_TEXTURE, sf::Vector2u(1100, 600), sf::Vector2i(0, 0)));

	while (window.isOpen())
	{
		window.clear();

		sf::Event event;
		while (window.pollEvent(event))
		{
			if ((event.type == sf::Event::Closed) ||
				(menuManager->getExitFlag() == true))
				window.close();
			
			menuManager->resolveEvent(event);
		}

		menuManager->display(window);
		window.display();
	
	}
	return EXIT_SUCCESS;
}
开发者ID:eorielle,项目名称:TowerDefense,代码行数:32,代码来源:main.cpp

示例5: startGame

void StartMenu::startGame()
{
	MenuManager* m = MenuManager::getMenuManager();

	m->popMenu();
	m->addMenu(make_shared<GameMenu>(GAME_MENU_DEFAULT_TEXTURE, sf::Vector2u(WINDOW_WIDTH, WINDOW_HEIGHT), sf::Vector2i(0, 0)));

	//this -> ~StartMenu();
}
开发者ID:shisisarah,项目名称:TowerDefense,代码行数:9,代码来源:StartMenu.cpp

示例6: onContactBeginPro_Wall

bool ContactManager::onContactBeginPro_Wall(){

    target_pro = node_Pro->getScheduler()->pauseAllTargets();
    MenuManager menuManager;
    
    Node* layer =menuManager.create_Menu(FAIL_LAYER);
    node_else->getParent()->addChild(layer);
    
    MenuManager::move_in(layer);

    return false;
}
开发者ID:yjq13,项目名称:PrisonBreak_v1.1,代码行数:12,代码来源:ContactManager.cpp

示例7: main

int main(int, char*[]) {
   try {
      //Manager manager;
      //manager.play();
	  MenuManager menuManager;
      menuManager.play();
   }
   catch (const string& msg) { std::cout << msg << std::endl; }
   catch (...) {
      std::cout << "Oops, someone threw an exception!" << std::endl;
   }
   return 0;
}
开发者ID:xljutopia,项目名称:2D-Video-Game,代码行数:13,代码来源:main.cpp

示例8: PRGAPI

void CTeenSpiritDlg::ShowTrayMenu(CPoint& pt)
{

	PrgAPI* pAPI = PRGAPI();
	MenuManager* pMM = pAPI->GetMenuManager();
	ITSMenu& trayMenu = pMM->GetMenu(MenuManager::MNU_Tray);
	pMM->PrepareMenu(MenuManager::MNU_Tray);
	pMM->PreparePlayerCommands(*pAPI->GetMediaPlayer());
	//=== This handling is done because otherwise the menu will not disappear when the user clicks outside
	SetForegroundWindow();
	trayMenu.TrackPopupMenu(pt.x, pt.y, GetSafeHwnd());
	PostMessage(WM_NULL, 0, 0);
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:13,代码来源:TeenSpiritDlg.cpp

示例9: getScore

bool ContactManager::onContactBeginPro_End(){
    
    target_pro = node_Pro->getScheduler()->pauseAllTargets();
    MenuManager menuManager;
    
    Node* layer =menuManager.create_Menu(SUCCESS_LAYER);
    
    getScore();
    strstream ss;
    string score;
    ss<<SCORE_GET;
    ss>>score;
    
    auto text_score=layer->getChildByName<ui::TextBMFont*>("Text_Score");
    text_score->setString(score);

    
    if(GameManager::stepNow==STEP){
        STEP++;
    }

    //此处应该有个算星星的方法
    int stateN = getState();
     strstream ss1;
    string state;
    ss1<<stateN;
    ss1>>state;
    CCLOG("星星:%d",stateN);
    auto text_state=layer->getChildByName<ui::TextBMFont*>("Text_State");
    text_state->setString(state);
    GameVo gVo;
    GameVo gvoG = getGameInfo(GameManager::stepNow);
    
    if(gvoG._score<SCORE_GET){
        gVo.setData(SCORE_GET, 3, getState());
        setGameInfo(gVo,GameManager::stepNow);
    }
    
    updateConstant();
    
    node_else->getParent()->addChild(layer);
    
    MenuManager::move_in(layer);

    
    
    return false;
}
开发者ID:yjq13,项目名称:PrisonBreak_v1.1,代码行数:48,代码来源:ContactManager.cpp

示例10: RenderDirectX

void DirectxFunctions::RenderDirectX()
{
	DirectX.Device->BeginScene();
	if (GetForegroundWindow() == Target.Window)
	{
		mMenuManager.Render();

		if (crosshair == true)
		{
			float centerx = Overlay.Width / 2, centery = Overlay.Height / 2;
			Drawing::Line(centerx - 3, centery, centerx - 10, centery, Color::Red);
			Drawing::Line(centerx + 3, centery, centerx + 10, centery, Color::Red);
			Drawing::Line(centerx, centery - 3, centerx, centery - 10, Color::Red);
			Drawing::Line(centerx, centery + 3, centerx, centery + 10, Color::Red);
		}

		if (trigger == true)
		{
			Yarin(&lPlayer, &InCH);
		}
		
	
	}


	DirectX.Device->EndScene();
	DirectX.Device->PresentEx(0, 0, 0, 0, 0);
	DirectX.Device->Clear(0, 0, D3DCLEAR_TARGET, 0, 1.0f, 0);
}
开发者ID:qfrtt,项目名称:Framework,代码行数:29,代码来源:DirectX.cpp

示例11: TRACEST

BOOL CTeenSpiritDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
	TRACEST(_T("CTeenSpiritDlg::OnCommand"), wParam);
	PrgAPI* pAPI = PRGAPI();

	switch (wParam)
	{
	case CToolbarWnd::CMD_About:
		return pAPI->GetActionManager()->ShowAboutDlg(this);
	case CToolbarWnd::CMD_Collections:
		return pAPI->GetActionManager()->ShowCollectionsDlg(this);
	case CToolbarWnd::CMD_Search:
		return pAPI->GetAdvancedSearchDlg()->ShowWindow(SW_SHOW);
	case CToolbarWnd::CMD_History:
		return pAPI->GetActionManager()->ShowHistoryDlg(this);
	case CToolbarWnd::CMD_Options:
		return pAPI->GetActionManager()->ShowOptionsDlg(this);
	case CToolbarWnd::CMD_Games:
		return pAPI->GetActionManager()->ShowGamesDlg(this);

	case CToolbarWnd::CMD_Min:
		return SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
	case CToolbarWnd::CMD_Restore:
		return SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0);
	case CToolbarWnd::CMD_Close:
		return SendMessage(WM_SYSCOMMAND, SC_CLOSE, 0);
		break;

	default:
		{
			if (wParam > MENU_First && wParam < MENU_Last)
			{
				MenuManager* pMM = pAPI->GetMenuManager();
				MenuCommandsEnum cmd = (MenuCommandsEnum) wParam;
				if (pMM->HandleGeneralCommands(cmd) || pMM->HandlePlayerCommands(*pAPI->GetMediaPlayer(), cmd, 0))
					return TRUE;
			}
		}
		return CDialog::OnCommand(wParam, lParam);
	}
	return TRUE;
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:42,代码来源:TeenSpiritDlg.cpp

示例12: runMenuCommand

bool NotepadPlusWrapper::runMenuCommand(boost::python::str menuName, boost::python::str menuOption, bool refreshCache)
{
	bool retVal = false;
	MenuManager *menuManager = MenuManager::getInstance();
	if (!menuName.is_none() && !menuOption.is_none())
	{
		std::shared_ptr<TCHAR> tmenuName = WcharMbcsConverter::char2tchar(boost::python::extract<const char *>(menuName));
		std::shared_ptr<TCHAR> tmenuOption = WcharMbcsConverter::char2tchar(boost::python::extract<const char *>(menuOption));
		GILRelease release;
		idx_t commandID = menuManager->findMenuCommand(tmenuName.get(), tmenuOption.get(), refreshCache);
		if (commandID)
		{
			::SendMessage(m_nppHandle, WM_COMMAND, commandID, 0);
			retVal = true;
		}

	}
	return retVal;

}
开发者ID:bruderstein,项目名称:PythonScript,代码行数:20,代码来源:NotepadPlusWrapper.cpp

示例13: onContactBeginPro_Jailer

bool ContactManager::onContactBeginPro_Jailer(){
    //node_Pro->getScheduler()->setTimeScale(0.0f);
    if(node_else->isVisible()){
        SpriteManager::setStopJailer(node_else->getTag());
        
        SchedulerManager::stopTimeLine(node_else->getTag());
        node_else->setVisible(false);
        target_pro = node_Pro->getScheduler()->pauseAllTargets();
        MenuManager menuManager;
        
        Node* layer =menuManager.create_Menu(FAIL_LAYER);
        node_else->getParent()->addChild(layer);
        
        MenuManager::move_in(layer);
    }
    
    //layer->setVisible(true);

    return false;
}
开发者ID:yjq13,项目名称:PrisonBreak_v1.1,代码行数:20,代码来源:ContactManager.cpp

示例14: LogoutClickListener

//Callback for the LeftClick event listener on the logout button
//param:buttonClicked->Pointer to the button clicked
//param:thisClass->Main menu class, in case we need it
 void MainMenu::LogoutClickListener(MenuButton* buttonClicked, void* thisClass)
 {
	MenuManager* networkManager = MenuManager::GetInstance();

	//Make sure we aren't logged in
	if(networkManager->GetLoggedIn())
	{
		//Create a Login Data Gamedata stucture to indicate logout
		GameData dataToSend = GameDataBuilder::CreateLoginData(
			networkManager->network.GetClientID(), false, (char*)networkManager->GetUsername().c_str(),
			"");

		//Send the login
		networkManager->network.SendData(dataToSend);
	}
	else
	{
		std::cout<< "Not Logged In" << std::endl;
	}
 }
开发者ID:VagabondOfHell,项目名称:SpaceGladiators,代码行数:23,代码来源:MainMenu.cpp

示例15: TRACEST

ITSMenu& WebPane::GetInternalMenu(MenusEnum mnu)
{
	TRACEST(_T("PlayListPane::GetMenu."), mnu);
	ASSERT(mnu < M_Last);
	PrgAPI* pAPI = PRGAPI();
	if (m_pMenu[mnu] == NULL)
		m_pMenu[mnu] = pAPI->CreatePopupMenu();
	ITSMenu& curMenu = *m_pMenu[mnu];
	if (curMenu.GetInternalHandler() != NULL)
		return curMenu;
	curMenu.Create();
	switch (mnu)
	{
	case M_Main:
		{
			MenuManager* pMM = pAPI->GetMenuManager();
			curMenu.AppendMenu(ITSMenu::MIT_Menu, 
				(INT)pMM->GetMenu(MenuManager::MNU_ArtistServices).GetInternalHandler(), (LPTSTR)pAPI->GetString(IDS_ARTIST));

			curMenu.AppendMenu(ITSMenu::MIT_Menu, 
				(INT)pMM->GetMenu(MenuManager::MNU_AlbumServices).GetInternalHandler(), (LPTSTR)pAPI->GetString(IDS_ALBUM));

			curMenu.AppendMenu(ITSMenu::MIT_Menu, 
				(INT)pMM->GetMenu(MenuManager::MNU_TrackServices).GetInternalHandler(), (LPTSTR)pAPI->GetString(IDS_TITLE));
			
			curMenu.AppendMenu(ITSMenu::MIT_Separator, NULL, NULL);
			
			curMenu.AppendMenu(ITSMenu::MIT_String, MI_SyncWithSectionChanger, (LPTSTR)pAPI->GetString(IDS_SYNCWITHSECTIONS));
			curMenu.AppendMenu(ITSMenu::MIT_String, MI_SyncWithTracksChanger, (LPTSTR)pAPI->GetString(IDS_SYNCWITHTRACKS));
			curMenu.AppendMenu(ITSMenu::MIT_String, MI_SyncWithPlayer, (LPTSTR)pAPI->GetString(IDS_SYNCWITHPLAYER));
			
			curMenu.AppendMenu(ITSMenu::MIT_Separator, NULL, NULL);
			
			curMenu.AppendMenu(ITSMenu::MIT_String, MI_UseAsWebViewer, (LPTSTR)pAPI->GetString(IDS_WEBVIEWER));
		}
		break;
	default:
		ASSERT(0);
	}
	return curMenu;
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:41,代码来源:WebPane.cpp


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