3 * char MessageBox (char mode, const char *format, ...)
5 * Maciej 'YTM/Elysium' Witkowiak, 17.08.2003
12 void _mbprintout(void);
14 static dlgBoxStr _mbdlg_EMPTY = {
16 DB_OPVEC(&RstrFrmDialogue),
17 DB_USRROUT(&_mbprintout),
21 static dlgBoxStr _mbdlg_OK = {
23 DB_USRROUT(&_mbprintout),
24 DB_ICON(OK, DBI_X_1, DBI_Y_2),
28 static dlgBoxStr _mbdlg_OKCANCEL = {
30 DB_USRROUT(&_mbprintout),
31 DB_ICON(OK, DBI_X_0, DBI_Y_2),
32 DB_ICON(CANCEL, DBI_X_2, DBI_Y_2),
36 static dlgBoxStr _mbdlg_YESNO = {
38 DB_USRROUT(&_mbprintout),
39 DB_ICON(YES, DBI_X_0, DBI_Y_2),
40 DB_ICON(NO, DBI_X_2, DBI_Y_2),
44 static dlgBoxStr *_mbboxes[] = {
51 static char _mbbuffer[256];
53 char MessageBox(char mode, const char *format, ...)
58 /* first format out things */
60 vsprintf(_mbbuffer, format, ap);
63 /* replace LFs by CRs */
66 if (*buf==LF) *buf=CR;
74 return DoDlgBox(_mbboxes[mode]);
77 void _mbprintout(void)
80 curWindow.top = DEF_DB_TOP;
81 curWindow.left = DEF_DB_LEFT+10;
82 curWindow.right = DEF_DB_RIGHT-10;
83 curWindow.bot = DEF_DB_BOT;
84 PutString(_mbbuffer, DEF_DB_TOP+10+curFontDesc.height, DEF_DB_LEFT+10 );