本文整理汇总了C++中MessageBox::SetCancelButtonText方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageBox::SetCancelButtonText方法的具体用法?C++ MessageBox::SetCancelButtonText怎么用?C++ MessageBox::SetCancelButtonText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageBox
的用法示例。
在下文中一共展示了MessageBox::SetCancelButtonText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCommand
void CTilegenKVEditorPage::OnCommand( const char *command )
{
if ( !Q_stricmp( command, "Save" ) )
{
KeyValues *pKV = GetKeyValues();
char fullFilePathBuffer [512];
Q_snprintf(fullFilePathBuffer, sizeof(fullFilePathBuffer),"C:\\Program Files\\Steam\\steamapps\\sourcemods\\alienswarmdirectormod\\%s", m_szFilename);
Msg("Saving to [%s]", fullFilePathBuffer);
//if ( pKV != NULL && !pKV->SaveToFile( g_pFullFileSystem, m_szFilename, "GAME" ) )
if ( pKV != NULL && !pKV->SaveToFile( g_pFullFileSystem, fullFilePathBuffer ) )
{
if ( p4 )
{
char fullPath[MAX_PATH];
g_pFullFileSystem->RelativePathToFullPath( m_szFilename, "GAME", fullPath, MAX_PATH );
if ( p4->IsFileInPerforce( fullPath ) )
{
MessageBox *pMessage = new MessageBox( "Check Out?", "File is not writeable. Would you like to check it out from Perforce?", this );
pMessage->SetCancelButtonVisible( true );
pMessage->SetOKButtonText( "#MessageBox_Yes" );
pMessage->SetCancelButtonText( "#MessageBox_No" );
pMessage->SetCommand( new KeyValues( "CheckOutFromP4", "file", fullPath ) );
pMessage->DoModal();
return;
}
}
else
{
VGUIMessageBox( this, "Save Error", "Failed to save %s. Make sure file is checked out from Perforce.", m_szFilename );
}
}
UpdateList();
return;
}
else if ( !Q_stricmp( command, "New" ) )
{
SaveNew();
return;
}
BaseClass::OnCommand( command );
}
示例2: OnFileSelected
void CTilegenLayoutSystemPage::OnFileSelected( const char *pFullPath )
{
if ( g_pFullFileSystem->FileExists( pFullPath ) )
{
VGUIMessageBox( this, "Save Error", "A layout system already exists with filename %s.", pFullPath );
return;
}
// create new keys
KeyValues *pNewKeys = new KeyValues( "Mission" );
// save them at the full path
if ( !pNewKeys->SaveToFile( g_pFullFileSystem, pFullPath ) )
{
VGUIMessageBox( this, "Save Error", "Failed to save new file %s.", pFullPath );
return;
}
m_pEditor->SetMissionData( pNewKeys );
m_pReloadMissionButton->SetVisible( true );
m_pSaveButton->SetVisible( true );
m_pGenerateButton->SetVisible( true );
bool bConverted = g_pFullFileSystem->FullPathToRelativePath( pFullPath, m_szFilename, MAX_PATH );
if ( !bConverted )
{
Warning( "Failed to convert this to a relative path: %s\n", pFullPath );
return;
}
m_pFilenameLabel->SetText( m_szFilename + Q_strlen( "tilegen/" ) );
m_pNewMissionDatabase->AddFile( pNewKeys, m_szFilename );
UpdateList();
if ( p4 )
{
MessageBox *pMessage = new MessageBox( "Add to P4?", "Would you like to add this mission to perforce?", this );
pMessage->SetCancelButtonVisible( true );
pMessage->SetOKButtonText( "#MessageBox_Yes" );
pMessage->SetCancelButtonText( "#MessageBox_No" );
pMessage->SetCommand( new KeyValues( "AddToP4", "file", pFullPath ) );
pMessage->DoModal();
}
}
示例3: OnCommand
void CTilegenKVEditorPage::OnCommand( const char *command )
{
if ( !Q_stricmp( command, "Save" ) )
{
KeyValues *pKV = GetKeyValues();
if ( pKV != NULL && !pKV->SaveToFile( g_pFullFileSystem, m_szFilename, "MOD" ) )
{
if ( p4 )
{
char fullPath[MAX_PATH];
g_pFullFileSystem->RelativePathToFullPath( m_szFilename, "MOD", fullPath, MAX_PATH );
if ( p4->IsFileInPerforce( fullPath ) )
{
MessageBox *pMessage = new MessageBox( "Check Out?", "File is not writeable. Would you like to check it out from Perforce?", this );
pMessage->SetCancelButtonVisible( true );
pMessage->SetOKButtonText( "#MessageBox_Yes" );
pMessage->SetCancelButtonText( "#MessageBox_No" );
pMessage->SetCommand( new KeyValues( "CheckOutFromP4", "file", fullPath ) );
pMessage->DoModal();
return;
}
}
else
{
VGUIMessageBox( this, "Save Error", "Failed to save %s. Make sure file is checked out from Perforce.", m_szFilename );
}
}
UpdateList();
return;
}
else if ( !Q_stricmp( command, "New" ) )
{
SaveNew();
return;
}
BaseClass::OnCommand( command );
}
示例4: 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 );
}