2 ** char MessageBox (char mode, const char *format, ...)
4 ** Maciej 'YTM/Elysium' Witkowiak, 17.08.2003
11 void _mbprintout(void);
13 static dlgBoxStr _mbdlg_EMPTY = {
15 DB_OPVEC(&RstrFrmDialogue),
16 DB_USRROUT(&_mbprintout),
20 static dlgBoxStr _mbdlg_OK = {
22 DB_USRROUT(&_mbprintout),
23 DB_ICON(OK, DBI_X_1, DBI_Y_2),
27 static dlgBoxStr _mbdlg_OKCANCEL = {
29 DB_USRROUT(&_mbprintout),
30 DB_ICON(OK, DBI_X_0, DBI_Y_2),
31 DB_ICON(CANCEL, DBI_X_2, DBI_Y_2),
35 static dlgBoxStr _mbdlg_YESNO = {
37 DB_USRROUT(&_mbprintout),
38 DB_ICON(YES, DBI_X_0, DBI_Y_2),
39 DB_ICON(NO, DBI_X_2, DBI_Y_2),
43 static dlgBoxStr *_mbboxes[] = {
50 static char _mbbuffer[256];
52 char MessageBox(char mode, const char *format, ...)
57 /* first format out things */
59 vsprintf(_mbbuffer, format, ap);
62 /* replace LFs by CRs */
65 if (*buf==LF) *buf=CR;
73 return DoDlgBox(_mbboxes[mode]);
76 void _mbprintout(void)
79 curWindow.top = DEF_DB_TOP;
80 curWindow.left = DEF_DB_LEFT+10;
81 curWindow.right = DEF_DB_RIGHT-10;
82 curWindow.bot = DEF_DB_BOT;
83 PutString(_mbbuffer, DEF_DB_TOP+10+curFontDesc.height, DEF_DB_LEFT+10 );