Add custom buttons to overwrite confirmation questions
This commit is contained in:
@@ -134,6 +134,8 @@
|
|||||||
#define IDS_4117 4117 // "Remember to partition and format..."
|
#define IDS_4117 4117 // "Remember to partition and format..."
|
||||||
#define IDS_4118 4118 // "The selected file will be..."
|
#define IDS_4118 4118 // "The selected file will be..."
|
||||||
#define IDS_4119 4119 // "Unsupported disk image"
|
#define IDS_4119 4119 // "Unsupported disk image"
|
||||||
|
#define IDS_4120 4120 // "Overwrite"
|
||||||
|
#define IDS_4121 4121 // "Cancel"
|
||||||
|
|
||||||
#define IDS_4352 4352 // "MFM/RLL"
|
#define IDS_4352 4352 // "MFM/RLL"
|
||||||
#define IDS_4353 4353 // "XT IDE"
|
#define IDS_4353 4353 // "XT IDE"
|
||||||
|
@@ -1021,6 +1021,8 @@ BEGIN
|
|||||||
IDS_4117 "Remember to partition and format the newly-created drive."
|
IDS_4117 "Remember to partition and format the newly-created drive."
|
||||||
IDS_4118 "The selected file will be overwritten. Are you sure you want to use it?"
|
IDS_4118 "The selected file will be overwritten. Are you sure you want to use it?"
|
||||||
IDS_4119 "Unsupported disk image"
|
IDS_4119 "Unsupported disk image"
|
||||||
|
IDS_4120 "Overwrite"
|
||||||
|
IDS_4121 "Cancel"
|
||||||
|
|
||||||
IDS_4352 "MFM/RLL"
|
IDS_4352 "MFM/RLL"
|
||||||
IDS_4353 "XTA"
|
IDS_4353 "XTA"
|
||||||
|
@@ -531,6 +531,23 @@ new_floppy_msgbox_header(HWND hwnd, int flags, void *header, void *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
new_floppy_msgbox_ex(HWND hwnd, int flags, void *header, void *message, void *btn1, void *btn2, void *btn3)
|
||||||
|
{
|
||||||
|
HWND h;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
h = hwndMain;
|
||||||
|
hwndMain = hwnd;
|
||||||
|
|
||||||
|
i = ui_msgbox_ex(flags, header, message, btn1, btn2, btn3);
|
||||||
|
|
||||||
|
hwndMain = h;
|
||||||
|
|
||||||
|
return(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(__amd64__) || defined(__aarch64__)
|
#if defined(__amd64__) || defined(__aarch64__)
|
||||||
static LRESULT CALLBACK
|
static LRESULT CALLBACK
|
||||||
#else
|
#else
|
||||||
@@ -637,7 +654,7 @@ NewFloppyDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
f = _wfopen(wopenfilestring, L"rb");
|
f = _wfopen(wopenfilestring, L"rb");
|
||||||
if (f != NULL) {
|
if (f != NULL) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
if (new_floppy_msgbox_header(hdlg, MBX_QUESTION, (wchar_t *) IDS_4111, (wchar_t *) IDS_4118) != 0) /* yes */
|
if (new_floppy_msgbox_ex(hdlg, MBX_QUESTION, (wchar_t *) IDS_4111, (wchar_t *) IDS_4118, (wchar_t *) IDS_4120, (wchar_t *) IDS_4121, NULL) != 0) /* yes */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
SendMessage(h, WM_SETTEXT, 0, (LPARAM) wopenfilestring);
|
SendMessage(h, WM_SETTEXT, 0, (LPARAM) wopenfilestring);
|
||||||
|
@@ -194,6 +194,23 @@ settings_msgbox_header(int flags, void *header, void *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
settings_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, void *btn3)
|
||||||
|
{
|
||||||
|
HWND h;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
h = hwndMain;
|
||||||
|
hwndMain = hwndParentDialog;
|
||||||
|
|
||||||
|
i = ui_msgbox_ex(flags, header, message, btn1, btn2, btn3);
|
||||||
|
|
||||||
|
hwndMain = h;
|
||||||
|
|
||||||
|
return(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* This does the initial read of global variables into the temporary ones. */
|
/* This does the initial read of global variables into the temporary ones. */
|
||||||
static void
|
static void
|
||||||
win_settings_init(void)
|
win_settings_init(void)
|
||||||
@@ -3043,7 +3060,7 @@ win_settings_hard_disks_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
|
|||||||
f = _wfopen(wopenfilestring, L"rb");
|
f = _wfopen(wopenfilestring, L"rb");
|
||||||
if (f != NULL) {
|
if (f != NULL) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
if (settings_msgbox_header(MBX_QUESTION, (wchar_t *) IDS_4111, (wchar_t *) IDS_4118) != 0) /* yes */
|
if (settings_msgbox_ex(MBX_QUESTION_YN, (wchar_t *) IDS_4111, (wchar_t *) IDS_4118, (wchar_t *) IDS_4120, (wchar_t *) IDS_4121, NULL) != 0) /* yes */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user