本文整理汇总了C++中MessageBox类的典型用法代码示例。如果您正苦于以下问题:C++ MessageBox类的具体用法?C++ MessageBox怎么用?C++ MessageBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MessageBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppLog
bool
ProfileListForm::DeleteProfile(int index)
{
AppLog("State Changed!!!! - 2");
MessageBox msgbox;
String getDeleteProfileMsg, getDialogTitle;
Application::GetInstance()->GetAppResource()->GetString(IDS_DELETE_PROFILE, getDeleteProfileMsg);
Application::GetInstance()->GetAppResource()->GetString(IDS_DIALOG_TITLE, getDialogTitle);
msgbox.Construct(getDialogTitle, getDeleteProfileMsg, MSGBOX_STYLE_YESNO, 3000);
int modalResult = 0;
msgbox.ShowAndWait(modalResult);
switch(modalResult){
case MSGBOX_RESULT_YES:
{
String sql;
sql.Append(L"DELETE FROM profile WHERE id = ");
Integer* itemId = static_cast<Integer*>(__pIndexList.GetAt(index));
sql.Append(itemId->ToInt());
__pProfileDatabase->BeginTransaction();
__pProfileDatabase->ExecuteSql(sql, true);
__pProfileDatabase->CommitTransaction();
ListUpdate();
__isUpdateMode = false;
}
return true;
}
return false;
}
示例2: getDocumentNK
void DocumentNKController::checkChanges()
{
document = getDocumentNK();
if(this->isEmptyForm())
{
view->reject();
}
else
{
if(!(oldDocument == document)) // jeśli kliknięto anuluj, ale nastąpiły zmiany
{
MessageBox *messageBox = new MessageBox();
if (messageBox->createQuestionBox("Dokonano zmian") == MessageBox::YES)
{
//this->checkRequiredFields(); // jesli bedzie walidacja to tutaj
view->accept();
}
else
view->reject(); // zmiany dokonane, ale użytkowik chce anulować
}
else
{
view->reject(); // nie dokonano zmian, anuluj
}
}
}
示例3: MessageBox
void GUISystem::ShowMessageBox(const CEGUI::String& text, MessageBox::eMessageBoxType type, MessageBox::Callback callback, int32 tag)
{
MessageBox* messageBox = new MessageBox(type, tag);
messageBox->SetText(text);
messageBox->RegisterCallback(callback);
messageBox->Show();
}
示例4: result
GaussianMessage EqualityNode::functionPrecision(int to, const MessageBox &msgs)
{
size_t size = msgs.begin()->second.size();
GaussianMessage result(size, GaussianMessage::GAUSSIAN_PRECISION);
Matrix &mean = result.mean();
Matrix &prec = result.precision();
for (MessageBox::const_iterator it = msgs.begin(); it != msgs.end(); ++it)
{
const int from = it->first;
const GaussianMessage &msg = it->second;
if (from == to)
continue;
const Matrix &msgMean = msg.mean();
const Matrix &msgPrec = msg.precision();
prec += msgPrec;
mean += msgPrec * msgMean;
}
// TODO: mult(in1, in2, out)
mean = pinv(prec) * mean;
return result;
}
示例5: simulate
void UI::simulate(const float t)
{
std::vector<std::vector<MessageBox *>::iterator> delete_list;
std::vector<MessageBox *>::iterator mbi, first, last;
first = active_mb.begin();
last = active_mb.end();
for(mbi = first; mbi != last; mbi++)
{
MessageBox *mb = *mbi;
mb->simulate(t);
if(mb->timed_out())
{
delete_list.push_back(mbi);
}
}
//delete all the message boxes that have timed out
std::vector<std::vector<MessageBox *>::iterator>::iterator mbii;
for(mbii = delete_list.begin(); mbii != delete_list.end(); mbii++)
{
mbi = *mbii;
MessageBox *mb = *mbi;
active_mb.erase(mbi);
delete mb;
}
}
示例6: MessageBox
//-----------------------------------------------------------------------------
// Purpose: Display some information about the editor
//-----------------------------------------------------------------------------
void BuildModeDialog::ShowHelp()
{
char helpText[]= "In the Build Mode Dialog Window:\n"
"Delete button - deletes the currently selected panel if it is deletable.\n"
"Apply button - applies changes to the Context Panel.\n"
"Save button - saves all settings to file. \n"
"Revert to saved- reloads the last saved file.\n"
"Auto Update - any changes apply instantly.\n"
"Typing Enter in any text field applies changes.\n"
"New Control menu - creates a new panel in the upper left corner.\n\n"
"In the Context Panel:\n"
"After selecting and moving a panel Ctrl-z will undo the move.\n"
"Shift clicking panels allows multiple panels to be selected into a group.\n"
"Ctrl-c copies the settings of the last selected panel.\n"
"Ctrl-v creates a new panel with the copied settings at the location of the mouse pointer.\n"
"Arrow keys slowly move panels, holding shift + arrow will slowly resize it.\n"
"Holding right mouse button down opens a dropdown panel creation menu.\n"
" Panel will be created where the menu was opened.\n"
"Delete key deletes the currently selected panel if it is deletable.\n"
" Does nothing to multiple selections.";
MessageBox *helpDlg = new MessageBox ("Build Mode Help", helpText, this);
helpDlg->AddActionSignalTarget(this);
helpDlg->DoModal();
}
示例7: DeleteFriend
void UserForm::DeleteFriend() {
MessageBox messageBox;
String message;
String name, nextName;
JsonParseUtils::GetString(*_pUserJson, L"first_name", name);
name += L" ";
JsonParseUtils::GetString(*_pUserJson, L"last_name", nextName);
name += nextName;
int result = 0, userId;
JsonParseUtils::GetInteger(*_pUserJson, L"id", userId);
message = L"Remove " + name + " from friends?";
messageBox.Construct(L"Confirm", message, MSGBOX_STYLE_OKCANCEL, 10000);
messageBox.ShowAndWait(result);
switch (result) {
case 0:
return;
break;
case MSGBOX_RESULT_OK: {
VKUApi::GetInstance().CreateRequest("friends.delete", this)
->Put(L"user_id", Integer::ToString(userId))
->Submit(REQUEST_DELETE_FRIEND);
}
break;
}
}
示例8: AppAssert
void
ProfileDetailForm::DeleteProfile(void)
{
ProfileListForm *pProfileListForm = static_cast< ProfileListForm* >(Application::GetInstance()->GetAppFrame()->GetFrame()->GetControl(FORM_LIST));
if (pProfileListForm != NULL)
{
if (pProfileListForm->DeleteProfile(__currentID))
{
SceneManager* pSceneManager = SceneManager::GetInstance();
AppAssert(pSceneManager);
pSceneManager->GoBackward(BackwardSceneTransition(SCENE_LIST));
}
}
else
{
MessageBox messageBox;
String getError, getFailDelete;
Application::GetInstance()->GetAppResource()->GetString(IDS_ERROR, getError);
Application::GetInstance()->GetAppResource()->GetString(IDS_FAIL_DELETE, getFailDelete);
messageBox.Construct(getError, getFailDelete, MSGBOX_STYLE_OK, 0);
int doModal;
messageBox.ShowAndWait(doModal);
}
}
示例9: PrintSaleDocumentController
void MainTabSaleItemController::printDocument()
{
PrintSaleDocumentController *pc = new PrintSaleDocumentController(view->getTableView()->getSymbol());
if(view->getTableView()->getSymbol() == "")
{
MessageBox *messageBox = new MessageBox();
messageBox->createInfoBox("Zaznacz dokument do druku");
delete messageBox;
}
else if(view->getTableView()->getSymbol().contains("FK"))
{
DocumentFK doc = fkService->getDocumentFK(view->getTableView()->getSymbol());
pc->print(&doc);
}
else
{
DocumentZAL docZal;
docZal= zalService->getDocumentZAL(view->getTableView()->getSymbol());
if(docZal.getDocumentType().contains("RZL")||docZal.getDocumentType().contains("ZAL"))
{
pc->print(&docZal);
}
else
{
Invoice doc = invoiceService->getInvoice(view->getTableView()->getSymbol());
pc->print(&doc);
}
}
delete pc;
}
示例10: KeyValues
//-----------------------------------------------------------------------------
// Purpose: saves control settings to file
//-----------------------------------------------------------------------------
bool BuildGroup::SaveControlSettings( void )
{
bool bSuccess = false;
if ( m_pResourceName )
{
KeyValues *rDat = new KeyValues( m_pResourceName );
// get the data from our controls
GetSettings( rDat );
char fullpath[ 512 ];
g_pFullFileSystem->RelativePathToFullPath( m_pResourceName, m_pResourcePathID, fullpath, sizeof( fullpath ) );
// save the data out to a file
bSuccess = rDat->SaveToFile( g_pFullFileSystem, fullpath, NULL );
if (!bSuccess)
{
MessageBox *dlg = new MessageBox("BuildMode - Error saving file", "Error: Could not save changes. File is most likely read only.");
dlg->DoModal();
}
rDat->deleteThis();
}
return bSuccess;
}
示例11: HelloForm
HelloForm()
{
caption = $("Sample App using Ecere Toolkit/C++ Bindings");
borderStyle = sizable;
clientSize = { 640, 480 };
hasClose = true;
hasMaximize = true;
hasMinimize = true;
background = formColor;
font = { "Arial", 30 };
button.parent = this;
button.position = { 200, 200 };
button.caption = $("Yay!!");
button.notifyClicked = [](Window & owner, Button & btn, int x, int y, Modifiers mods)
{
HelloForm & self = (HelloForm &)owner;
MessageBox msgBox;
msgBox.caption = self.button.caption;
msgBox.contents = $("C++ Bindings!");
msgBox.modal();
return true;
};
onRedraw = [](Window & w, Surface & surface) { surface.writeTextf(100, 100, $("Instance Method!")); };
}
示例12: AppLogDebug
void LoginForm::loginPlayerFinished(Tizen::Base::String statusCode)
{
AppLogDebug("STAUS : %S",statusCode.GetPointer());
MessageBox msgBox;
int modalResult;
SceneManager* pSceneManager = SceneManager::GetInstance();
AppAssert(pSceneManager);
ArrayList* pList = new (std::nothrow)ArrayList;
AppAssert(pList);
pList->Construct();
if(statusCode != "0") // (로그인 성공 시) 로그인, 개인페이지로 이동
{
String playerKey = statusCode;
pList->Add( new Tizen::Base::String(playerKey) ); // playerId
pSceneManager->GoForward(ForwardSceneTransition(SCENE_PLAYER, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_HISTORY_OPTION_NO_HISTORY), pList);
}
else // (로그인 실패 시) 로그인 실패 팝업
{
msgBox.Construct(L"Login", L"LOGIN fail", MSGBOX_STYLE_OK);
msgBox.ShowAndWait(modalResult);
}
}
示例13: logEntered
void TizenScummVM::OnUserEventReceivedN(RequestId requestId, IList *args) {
logEntered();
MessageBox messageBox;
int modalResult;
String *message;
switch (requestId) {
case USER_MESSAGE_EXIT:
// normal program termination
Terminate();
break;
case USER_MESSAGE_EXIT_ERR:
// assertion failure termination
if (args) {
message = (String *)args->GetAt(0);
}
if (!message) {
message = new String("Unknown error");
}
messageBox.Construct(L"Oops...", *message, MSGBOX_STYLE_OK);
messageBox.ShowAndWait(modalResult);
Terminate();
break;
case USER_MESSAGE_EXIT_ERR_CONFIG:
// the config file was corrupted
messageBox.Construct(L"Config file corrupted",
L"Settings have been reverted, please restart.", MSGBOX_STYLE_OK);
messageBox.ShowAndWait(modalResult);
Terminate();
break;
}
}
示例14: it
QScriptValue MessageBox::constructor(QScriptContext *context, QScriptEngine *engine)
{
MessageBox *messageBox = new MessageBox;
messageBox->setupConstructorParameters(context, engine, context->argument(0));
QScriptValueIterator it(context->argument(0));
while(it.hasNext())
{
it.next();
if(it.name() == "text")
messageBox->mMessageBox->setText(it.value().toString());
else if(it.name() == "detailedText")
messageBox->mMessageBox->setDetailedText(it.value().toString());
else if(it.name() == "informativeText")
messageBox->mMessageBox->setInformativeText(it.value().toString());
else if(it.name() == "buttons")
messageBox->mMessageBox->setStandardButtons(static_cast<QMessageBox::StandardButton>(it.value().toInt32()));
else if(it.name() == "icon")
messageBox->mMessageBox->setIcon(static_cast<QMessageBox::Icon>(it.value().toInt32()));
else if(it.name() == "defaultButton")
messageBox->mMessageBox->setDefaultButton(static_cast<QMessageBox::StandardButton>(it.value().toInt32()));
else if(it.name() == "escapeButton")
messageBox->mMessageBox->setEscapeButton(static_cast<QMessageBox::StandardButton>(it.value().toInt32()));
else if(it.name() == "onClosed")
messageBox->mOnClosed = it.value();
}
return CodeClass::constructor(messageBox, context, engine);
}
示例15: AppLog
void
CameraCapture::OnForeground(void)
{
AppLog( ">>>>>> OnForeground is called.");
__isBackGround = false;
Osp::System::BatteryLevel eBatterLevel;
bool isCharging = false;
Osp::System::Battery::GetCurrentLevel(eBatterLevel);
Osp::System::RuntimeInfo::GetValue(L"IsCharging", isCharging);
if( (BATTERY_CRITICAL != eBatterLevel && BATTERY_EMPTY != eBatterLevel) || isCharging)
{
AppLog("--------------Normal BatterY Condition enum - %d",eBatterLevel);
AppStartUp();
}
else
{
AppLog("--------------Critical BatterY Condition enum - %d",eBatterLevel);
MessageBox msgBoxError;
int msgBoxErrorResult = 0;
if(__pFrame->GetCurrentForm() != __pMainForm)
{
msgBoxError.Construct(L"WARNING",L"Low Battery",MSGBOX_STYLE_NONE,1000);
msgBoxError.ShowAndWait(msgBoxErrorResult);
}
AppHandleLowBattery();
}
}