puts up a message box with a title and message.
| 631 | |
| 632 | // puts up a message box with a title and message. |
| 633 | int DoMessageBox(const char *title, const char *msg, int type, ddgr_color title_color, ddgr_color text_color) { |
| 634 | newuiMessageBox mbox; |
| 635 | newuiSheet *sheet; |
| 636 | |
| 637 | int old_screen_mode, res; |
| 638 | char msgbuf[256]; |
| 639 | |
| 640 | // force menu mode |
| 641 | old_screen_mode = GetScreenMode(); |
| 642 | |
| 643 | textaux_WordWrap(msg, msgbuf, NEWUI_MSGBOX_SHEET_W, MONITOR9_NEWUI_FONT); |
| 644 | |
| 645 | // make message box |
| 646 | mbox.Create(title, type); |
| 647 | |
| 648 | sheet = mbox.GetSheet(); |
| 649 | sheet->NewGroup(NULL, 0, 0); |
| 650 | sheet->AddText(msgbuf); |
| 651 | |
| 652 | mbox.Open(); |
| 653 | res = mbox.DoUI(); |
| 654 | mbox.Close(); |
| 655 | |
| 656 | mbox.Destroy(); |
| 657 | |
| 658 | // restore screen |
| 659 | SetScreenMode(old_screen_mode); |
| 660 | |
| 661 | // return correct value. |
| 662 | return ((res == UID_OK) ? 1 : 0); |
| 663 | } |
| 664 | |
| 665 | // puts up a message box with a title and message. |
| 666 | // define text for buttons, btn0_title, btn1_title, ..., until NULL. |
no test coverage detected