--- np2/win9x/dialog/d_about.cpp 2003/10/16 17:58:58 1.1 +++ np2/win9x/dialog/d_about.cpp 2005/02/09 20:11:36 1.11 @@ -1,55 +1,65 @@ #include "compiler.h" #include "resource.h" #include "np2.h" +#include "np2class.h" #include "dialog.h" #include "dialogs.h" -#include "np2info.h" +#include "np2ver.h" #include "pccore.h" +#include "np2info.h" -static RECT aboutrct; -static const char np2infostr[] = \ - "CPU: !CPU !CLOCK\r\n" \ - "MEM: !MEM1\r\n" \ - "GDC: !GDC\r\n" \ - "TEXT: !TEXT\r\n" \ - "GRPH: !GRPH\r\n" \ - "SOUND: !EXSND\r\n" \ - "\r\n" \ - "BIOS: !BIOS\r\n" \ - "RHYTHM: !RHYTHM\r\n" \ - "\r\n" \ - "SCREEN: !DISP"; +static SIZE aboutsize; +#if !defined(SUPPORT_PC9821) +static const OEMCHAR str_np2title[] = OEMTEXT("Neko Project II "); +#else +static const OEMCHAR str_np2title[] = OEMTEXT("Neko Project 21 "); +#endif +static const OEMCHAR np2infostr[] = OEMTEXT("CPU: %CPU% %CLOCK%\nMEM: %MEM1%\nGDC: %GDC%\n %GDC2%\nTEXT: %TEXT%\nGRPH: %GRPH%\nSOUND: %EXSND%\n\nBIOS: %BIOS%\nRHYTHM: %RHYTHM%\n\nSCREEN: %DISP%"); -// ---- static void about_init(HWND hWnd) { - char work[128]; - - strcpy(work, "Neko Project II "); - strcat(work, np2version); -#ifdef NEW286 - strcat(work, "+"); + OEMCHAR work[128]; + RECT rectwindow; + RECT rectclient; + POINT pt; + RECT parent; + + milstr_ncpy(work, str_np2title, NELEMENTS(work)); + milstr_ncat(work, np2version, NELEMENTS(work)); +#if defined(NP2VER_WIN9X) + milstr_ncat(work, NP2VER_WIN9X, NELEMENTS(work)); #endif SetDlgItemText(hWnd, IDC_NP2VER, work); - GetWindowRect(hWnd, &aboutrct); - MoveWindow(hWnd, aboutrct.left, aboutrct.top, - aboutrct.right - aboutrct.left, 84, TRUE); + GetWindowRect(hWnd, &rectwindow); + GetClientRect(hWnd, &rectclient); + aboutsize.cx = rectwindow.right - rectwindow.left; + aboutsize.cy = rectwindow.bottom - rectwindow.top; + pt.x = 0; + pt.y = 0; + ClientToScreen(GetParent(hWnd), &pt); + GetClientRect(GetParent(hWnd), &parent); + np2class_move(hWnd, + pt.x + ((parent.right - parent.left - aboutsize.cx) / 2), + pt.y + ((parent.bottom - parent.top - aboutsize.cy) / 2), + aboutsize.cx, + aboutsize.cy + 60 - (rectclient.bottom - rectclient.top)); + SetFocus(GetDlgItem(hWnd, IDOK)); } static void about_more(HWND hWnd) { - char infostr[1024]; + OEMCHAR infostr[1024]; + RECT rect; - np2info(infostr, np2infostr, sizeof(infostr)); + np2info(infostr, np2infostr, NELEMENTS(infostr), NULL); SetDlgItemText(hWnd, IDC_NP2INFO, infostr); EnableWindow(GetDlgItem(hWnd, IDC_MORE), FALSE); - MoveWindow(hWnd, aboutrct.left, aboutrct.top, - aboutrct.right - aboutrct.left, - aboutrct.bottom - aboutrct.top, TRUE); + GetWindowRect(hWnd, &rect); + np2class_move(hWnd, rect.left, rect.top, aboutsize.cx, aboutsize.cy); SetFocus(GetDlgItem(hWnd, IDOK)); } @@ -57,7 +67,6 @@ LRESULT CALLBACK AboutDialogProc(HWND hW switch (msg) { case WM_INITDIALOG: - ShowWindow(GetDlgItem(hWnd, IDC_EXTICON), SW_HIDE); about_init(hWnd); return(FALSE); @@ -66,9 +75,11 @@ LRESULT CALLBACK AboutDialogProc(HWND hW case IDOK: EndDialog(hWnd, IDOK); break; + case IDC_MORE: about_more(hWnd); break; + default: return(FALSE); }