Message box are common tools that helps us show messages, results and Provide choices to preform actions or not.
Here are some messagebox with examples.
Info box : this is simple box used to display any message other than warnings or error messages.
static void JobInfoBox(Args _args)
{
info (“Hello world”);
}
infoOnce:
This message box is similar to infobox only difference here you can set message header and message details. This message box shows option to disable message box if warning or message is continuously appear in code iteration.
void clicked()
{
Box::infoOnce(“this is message box “, ” For detail click http://tech.alirazazaidi”,” Only once”);
super();
}
infoOnceEx:
This message allows us to display caption of messagebox, header of message, Detail or information, gives us option to stop at execution of code until we click on ok button or move forward by showing message box.
void clicked()
{
// Box::infoOnce(“this is message box “, ” For detail click http://tech.alirazazaidi”,” Only once”);
super();
Box::infoOnceEx(“this is message box”,”http://tech.alirazazaidi.com”,” Hello”,” this is testing”,boolean::true);
}
You can saw caption of Dialog “This is testing” is coming from code.
Ok cancel box: Allows us to option Provide accept and rejection to proceed further
void clicked()
{
DialogButton Button;
super();
Button= Box::okCancel(“This is test”,DialogButton::No);
if (Button == DialogButton::Ok)
info(“Allo”);
else
info(“NotAllo”);
}
Warning:
This messagebox used to show warning message
void clicked()
{
super();
Box::warning(“this is warning”);
}
yesAllNoAllCancel
This message provide option to yes , yes for all, no, no for all or cancel
void clicked()
{
// Box::infoOnce(“this is message box “, ” For detail click http://tech.alirazazaidi”,” Only once”);
DialogButton _Button;
super();
// Box::infoOnceEx(“this is message box”,”http://tech.alirazazaidi.com”,” Hello”,” this is testing”,boolean::true);
_Button= Box::yesAllNoAllCancel(“This is test”,DialogButton::No);
if (_Button == DialogButton::NoToAll)
{
info(“OK”);
}
else if (_Button==DialogButton::YesToAll)
{
info (“Yes to All”);
}
else if (_Button==DialogButton::Cancel)
{
info(“Cancel”);
}
}
Other message box like yesno, yesnoonce has similar options
Error:
One important message box is Error box, Under the hood it use Info box but with error icon is used in infobox.
void clicked()
{
super();
error ( ” This exceptional blog “);
}