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


C++ MessageBox::SetCancelCommand方法代码示例

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


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

示例1: OnCommand


//.........这里部分代码省略.........
		DoFileOpen();
		return;
	}
	else if ( Q_stricmp( command, "OpenCurrentMapLayout" ) == 0 )
	{
		// todo: check the current map is saved, print a warning if not?
		
		// clear the current map layout, if any
		delete m_pMapLayout;
		m_pMapLayout = new CMapLayout();
		char mapname[ 255 ];
		Q_snprintf( mapname, sizeof( mapname ), "maps/%s.layout", engine->GetLevelNameShort() );
		// load in the new one
		if ( !m_pMapLayout->LoadMapLayout( mapname ) )
		{
			MessageBox *pMessage = new MessageBox ("Error", "Error loading map layout", this);
			pMessage->DoModal();
			return;
		}

		// make sure each placed CRoom has a UI panel
		GetMapLayoutPanel()->CreateAllUIPanels();

		return;
	}	
	else if ( Q_stricmp( command, "SaveMapLayout" ) == 0 )
	{
		if (Q_strlen(m_pMapLayout->m_szFilename) <= 0)
		{
			DoFileSaveAs();
		}
		else
		{
			m_pMapLayout->SaveMapLayout(m_pMapLayout->m_szFilename);
		}
		return;
	}
	else if ( Q_stricmp( command, "SaveMapLayoutAs" ) == 0 )
	{
		DoFileSaveAs();
		return;
	}
	else if ( Q_stricmp( command, "GenerateThumbnails" ) == 0 )
	{
		if ( p4 )
		{
			MessageBox *pMessage = new MessageBox( "Add to P4?", "Would you like to add the thumbnails to perforce?", this );
			pMessage->SetCancelButtonVisible( true );
			pMessage->SetOKButtonText( "#MessageBox_Yes" );
			pMessage->SetCancelButtonText( "#MessageBox_No" );
			pMessage->SetCommand( new KeyValues( "AddToP4", "add", "1" ) );
			pMessage->SetCancelCommand( new KeyValues( "AddToP4", "add", "0" ) );
			pMessage->DoModal();
			return;
		}

		GenerateRoomThumbnails();
		return;
	}
	else if ( !Q_stricmp( command, "PushEncountersApart" ) )
	{
		CASWMissionChooserNPCs::PushEncountersApart( m_pMapLayout );
	}
	else if ( Q_stricmp( command, "LocationLayoutEditor" ) == 0 )
	{
		vgui::Frame *pFrame = new CLocation_Editor_Frame( this, "LocationEditorFrame" );
		pFrame->MoveToCenterOfScreen();
		pFrame->Activate();
		return;
	}
	else if ( Q_stricmp( command, "ZoomIn" ) == 0 )
	{
		Zoom( 10 );
		return;
	}
	else if ( Q_stricmp( command, "ZoomOut" ) == 0 )
	{
		Zoom( -10 );
		return;
	}
	else if ( !Q_stricmp( command, "TileCheck" ) )
	{
		vgui::Frame *pFrame = new CTile_Check_Frame( this, "TileCheckFrame" );
		pFrame->MoveToCenterOfScreen();
		pFrame->Activate();
		return;
	}
	else if ( !Q_stricmp( command, "ShowOptionalParameters" ) )
	{
		m_pLayoutSystemPage->GetEditor()->ShowOptionalValues( m_pToolsMenu->IsChecked( m_nShowDefaultParametersMenuItemID ) );
		return;
	}
	else if ( !Q_stricmp( command, "ShowAddButtons" ) )
	{
		m_pLayoutSystemPage->GetEditor()->ShowAddButtons( m_pToolsMenu->IsChecked( m_nShowAddButtonsMenuItemID ) );
		return;
	}

	BaseClass::OnCommand( command );
}
开发者ID:BenLubar,项目名称:riflemod,代码行数:101,代码来源:TileGenDialog.cpp


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