本文整理汇总了C++中MessageBox::setMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageBox::setMessage方法的具体用法?C++ MessageBox::setMessage怎么用?C++ MessageBox::setMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageBox
的用法示例。
在下文中一共展示了MessageBox::setMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ok
//--------------------------------------------------------------------------
void BaseFileDialog::ok()
{
MyGUI::LanguageManager& lang = MyGUI::LanguageManager::getInstance();
if(mCurrentBasename.empty())
{
MessageBox* msgbox = new MessageBox;
msgbox->setIcon(MessageBoxIcon::INFO);
msgbox->setMessage("#{SelectFileBefore}");
msgbox->addButton(MessageBoxButton::OK);
return;
}
size_t pos = mCurrentBasename.rfind('.');
if(pos == String::npos)
{
if(mCurrentFilter < getNumFilters())
{
const Filter& filter = getFilter(mCurrentFilter);
mCurrentBasename += filter.getDefaultExt();
}
}
String filename = getCurrentFilename();
if(mType == LOAD)
{
if(!ResourceGroupManager::getSingleton().resourceExists(mResourceGroup, filename))
{
MessageBox* msgbox = new MessageBox;
msgbox->setIcon(MessageBoxIcon::ERROR);
msgbox->setMessage("#{FileNotFound}", "1", filename);
msgbox->addButton(MessageBoxButton::OK);
return;
}
}
else if(mType == SAVE)
{
if(ResourceGroupManager::getSingleton().resourceExists(mResourceGroup, filename))
{
MessageBox* msgbox = new MessageBox;
msgbox->setIcon(MessageBoxIcon::QUEST);
msgbox->setMessage("#{ConfirmOverwriteFile}", "1", filename);
msgbox->addButton(MessageBoxButton::YES);
msgbox->addButton(MessageBoxButton::NO);
msgbox->eventChoice = MyGUI::newDelegate(this, &BaseFileDialog::notifyFileOverwriteMessageButton);
return;
}
}
ok_final();
}
示例2: messageBox
int Script::messageBox(lua_State* L){
#ifdef _CLIENT_
string msg = string(luaL_checkstring(L, 1));
MessageBox* mb = new MessageBox();
mb->setMessage(msg);
CGE::Engine::instance()->addGuiListener(mb, false);
#endif
return 0;
}
示例3: _processWindowClosing
//----------------------------------------------------------------------------
void WorldViewWindowManager::_processWindowClosing()
{
World* changedWorld = nullptr;
size_t i = mWindows.size();
while(i != 0)
{
WorldViewWindow* window = mWindows[--i];
if(window->isClosing())
{
World* world = window->getWorld();
if(!world->isChanged())
WorldManager::getSingleton().destroyWorld(world);
else
{
changedWorld = world;
break;
}
}
}
if(!changedWorld)
{
if(mAppExitAfterWindowClosing)
InputSystem::getSingleton().setExitFlag();
return;
}
WorldManager::getSingleton().setActiveWorld(changedWorld);
MessageBox* msgbox = new MessageBox;
msgbox->addButton(MessageBoxButton::BUTTON1, "#{Save}");
msgbox->addButton(MessageBoxButton::BUTTON2, "#{DontSave}");
msgbox->addButton(MessageBoxButton::CANCEL);
msgbox->setIcon(MessageBoxIcon::QUEST);
msgbox->setMessage("#{ConfirmSaveChanges}", "1", changedWorld->getName());
msgbox->eventChoice = MyGUI::newDelegate(this, &WorldViewWindowManager::notifyMessageBoxChoice);
}