Convert about dialog to TaskDialog
This commit is contained in:
@@ -97,6 +97,10 @@
|
||||
#define IDS_2121 2121 // "Save changes\nThis will hard..."
|
||||
#define IDS_2122 2122 // "Discard changes\nAll changes..."
|
||||
#define IDS_2123 2123 // "Cancel\nGo back to the..."
|
||||
#define IDS_2124 2124 // "About " EMU_NAME
|
||||
#define IDS_2125 2125 // EMU_NAME " v" EMU_VERSION
|
||||
#define IDS_2126 2126 // "An emulator of old computers..."
|
||||
#define IDS_2127 2127 // "OK"
|
||||
|
||||
#define IDS_4096 4096 // "Hard disk (%s)"
|
||||
#define IDS_4097 4097 // "%01i:%01i"
|
||||
|
||||
@@ -274,19 +274,6 @@ END
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
DLG_ABOUT DIALOG DISCARDABLE 0, 0, 209, 114
|
||||
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About 86Box"
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,129,94,71,12
|
||||
ICON 100,IDC_ABOUT_ICON,7,7,20,20
|
||||
LTEXT "86Box v" EMU_VERSION " - An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2. See LICENSE for more information.",
|
||||
IDC_ABOUT_ICON,54,7,146,73
|
||||
CONTROL "",IDC_ABOUT_ICON,"Static",SS_BLACKFRAME | SS_SUNKEN,0,
|
||||
86,208,1
|
||||
END
|
||||
|
||||
DLG_STATUS DIALOG DISCARDABLE 0, 0, 186, 386
|
||||
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Status"
|
||||
@@ -974,6 +961,10 @@ BEGIN
|
||||
IDS_2121 "Save changes\nThis will hard reset the emulated machine."
|
||||
IDS_2122 "Discard changes\nAll changes made to the settings will be lost."
|
||||
IDS_2123 "Cancel\nGo back to the Settings window."
|
||||
IDS_2124 "About " EMU_NAME
|
||||
IDS_2125 EMU_NAME " v" EMU_VERSION
|
||||
IDS_2126 "An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2. See LICENSE for more information."
|
||||
IDS_2127 "OK"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#undef BITMAP
|
||||
#include <commctrl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
@@ -31,45 +32,21 @@
|
||||
#include <86box/win.h>
|
||||
|
||||
|
||||
#if defined(__amd64__) || defined(__aarch64__)
|
||||
static LRESULT CALLBACK
|
||||
#else
|
||||
static BOOL CALLBACK
|
||||
#endif
|
||||
AboutDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HWND h;
|
||||
HANDLE ih;
|
||||
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
plat_pause(1);
|
||||
h = GetDlgItem(hdlg, IDC_ABOUT_ICON);
|
||||
ih = LoadImage(hinstance,(PCTSTR)10,IMAGE_ICON,64,64,0);
|
||||
SendMessage(h, STM_SETIMAGE, (WPARAM)IMAGE_ICON,
|
||||
(LPARAM)ih);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
EndDialog(hdlg, 0);
|
||||
plat_pause(0);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AboutDialogCreate(HWND hwnd)
|
||||
{
|
||||
DialogBox(hinstance, (LPCTSTR)DLG_ABOUT, hwnd, AboutDialogProcedure);
|
||||
TASKDIALOGCONFIG tdconfig = {0};
|
||||
TASKDIALOG_BUTTON tdbuttons[] = {{IDCANCEL, MAKEINTRESOURCE(IDS_2127)}};
|
||||
|
||||
tdconfig.cbSize = sizeof(tdconfig);
|
||||
tdconfig.hwndParent = hwnd;
|
||||
tdconfig.hInstance = hinstance;
|
||||
tdconfig.dwCommonButtons = 0;
|
||||
tdconfig.pszWindowTitle = MAKEINTRESOURCE(IDS_2124);
|
||||
tdconfig.pszMainIcon = (PCWSTR) 10;
|
||||
tdconfig.pszMainInstruction = MAKEINTRESOURCE(IDS_2125);
|
||||
tdconfig.pszContent = MAKEINTRESOURCE(IDS_2126);
|
||||
tdconfig.cButtons = ARRAYSIZE(tdbuttons);
|
||||
tdconfig.pButtons = tdbuttons;
|
||||
TaskDialogIndirect(&tdconfig, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user