Revert "Convert existing MessageBox calls to TaskDialog"

This reverts commit af6cead246.
This commit is contained in:
RichardG867
2020-03-24 19:13:58 -03:00
parent 0b5d648a49
commit 2b6258139e
2 changed files with 35 additions and 61 deletions

View File

@@ -43,36 +43,34 @@ int
ui_msgbox(int flags, void *arg)
{
WCHAR temp[512];
WCHAR *icon = NULL;
TASKDIALOG_COMMON_BUTTON_FLAGS buttons = TDCBF_OK_BUTTON;
DWORD fl = 0;
WCHAR *str = NULL;
WCHAR *instr = NULL;
int res = 0;
WCHAR *cap = NULL;
switch(flags & 0x1f) {
case MBX_INFO: /* just an informational message */
icon = TD_INFORMATION_ICON;
instr = plat_get_string(IDS_STRINGS); /* "86Box" */
fl = (MB_OK | MB_ICONINFORMATION);
cap = plat_get_string(IDS_STRINGS); /* "86Box" */
break;
case MBX_ERROR: /* error message */
if (flags & MBX_FATAL) {
icon = TD_ERROR_ICON;
instr = plat_get_string(IDS_2050); /* "Fatal Error"*/
fl = (MB_OK | MB_ICONERROR);
cap = plat_get_string(IDS_2050); /* "Fatal Error"*/
} else {
icon = TD_WARNING_ICON;
instr = plat_get_string(IDS_2049); /* "Error" */
fl = (MB_OK | MB_ICONWARNING);
cap = plat_get_string(IDS_2049); /* "Error" */
}
break;
case MBX_QUESTION: /* question */
buttons = TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON;
instr = plat_get_string(IDS_STRINGS); /* "86Box" */
fl = (MB_YESNOCANCEL | MB_ICONQUESTION);
cap = plat_get_string(IDS_STRINGS); /* "86Box" */
break;
case MBX_QUESTION_YN: /* question */
buttons = TDCBF_YES_BUTTON | TDCBF_NO_BUTTON;
instr = plat_get_string(IDS_STRINGS); /* "86Box" */
fl = (MB_YESNO | MB_ICONQUESTION);
cap = plat_get_string(IDS_STRINGS); /* "86Box" */
break;
}
@@ -101,21 +99,17 @@ ui_msgbox(int flags, void *arg)
}
/* At any rate, we do have a valid (wide) string now. */
TaskDialog(hwndMain, /* our main window */
NULL, /* no icon resource */
plat_get_string(IDS_STRINGS), /* window caption */
instr, /* main instruction */
str, /* error message */
buttons,
icon,
&res); /* pointer to result */
fl = MessageBox(hwndMain, /* our main window */
str, /* error message etc */
cap, /* window caption */
fl);
/* Convert return values to generic ones. */
if (res == IDNO) res = 1;
else if (res == IDCANCEL) res = -1;
else res = 0;
if (fl == IDNO) fl = 1;
else if (fl == IDCANCEL) fl = -1;
else fl = 0;
return(res);
return(fl);
}

View File

@@ -843,14 +843,10 @@ ui_init(int nCmdShow)
if (settings_only) {
if (! pc_init_modules()) {
/* Dang, no ROMs found at all! */
TaskDialog(hwnd,
NULL,
plat_get_string(IDS_STRINGS),
plat_get_string(IDS_2050),
MessageBox(hwnd,
plat_get_string(IDS_2056),
TDCBF_OK_BUTTON,
TD_ERROR_ICON,
NULL);
plat_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
return(6);
}
@@ -937,14 +933,10 @@ ui_init(int nCmdShow)
ridev.dwFlags = RIDEV_NOHOTKEYS;
ridev.hwndTarget = NULL; /* current focus window */
if (! RegisterRawInputDevices(&ridev, 1, sizeof(ridev))) {
TaskDialog(hwnd,
NULL,
plat_get_string(IDS_STRINGS),
plat_get_string(IDS_2050),
MessageBox(hwndMain,
plat_get_string(IDS_2114),
TDCBF_OK_BUTTON,
TD_ERROR_ICON,
NULL);
plat_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
return(4);
}
keyboard_getkeymap();
@@ -955,14 +947,10 @@ ui_init(int nCmdShow)
/* Load the accelerator table */
haccel = LoadAccelerators(hinstance, ACCEL_NAME);
if (haccel == NULL) {
TaskDialog(hwnd,
NULL,
plat_get_string(IDS_STRINGS),
plat_get_string(IDS_2050),
MessageBox(hwndMain,
plat_get_string(IDS_2113),
TDCBF_OK_BUTTON,
TD_ERROR_ICON,
NULL);
plat_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
return(3);
}
@@ -992,27 +980,19 @@ ui_init(int nCmdShow)
/* All done, fire up the actual emulated machine. */
if (! pc_init_modules()) {
/* Dang, no ROMs found at all! */
TaskDialog(hwnd,
NULL,
plat_get_string(IDS_STRINGS),
plat_get_string(IDS_2050),
MessageBox(hwnd,
plat_get_string(IDS_2056),
TDCBF_OK_BUTTON,
TD_ERROR_ICON,
NULL);
plat_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
return(6);
}
/* Initialize the configured Video API. */
if (! plat_setvid(vid_api)) {
TaskDialog(hwnd,
NULL,
plat_get_string(IDS_STRINGS),
plat_get_string(IDS_2050),
MessageBox(hwnd,
plat_get_string(IDS_2095),
TDCBF_OK_BUTTON,
TD_ERROR_ICON,
NULL);
plat_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
return(5);
}