| version 1.1, 2003/10/16 17:58:58 | version 1.4, 2003/10/30 18:09:06 | 
| Line 1 | Line 1 | 
 | #include        "compiler.h" | #include        "compiler.h" | 
 | #include        "resource.h" | #include        "resource.h" | 
 | #include        "np2.h" | #include        "np2.h" | 
 |  | #include        "np2class.h" | 
 |  | #include        "np2info.h" | 
 | #include        "dialog.h" | #include        "dialog.h" | 
 | #include        "dialogs.h" | #include        "dialogs.h" | 
 | #include        "np2info.h" |  | 
 | #include        "pccore.h" | #include        "pccore.h" | 
 |  |  | 
 |  |  | 
| static  RECT    aboutrct; | static  SIZE    aboutsize; | 
|  |  | 
|  | static const char str_np2title[] = "Neko Project II  "; | 
 | static const char np2infostr[] =                                                                        \ | static const char np2infostr[] =                                                                        \ | 
 | "CPU: !CPU !CLOCK\r\n"                                          \ | "CPU: !CPU !CLOCK\r\n"                                          \ | 
 | "MEM: !MEM1\r\n"                                                        \ | "MEM: !MEM1\r\n"                                                        \ | 
| Line 22  static const char np2infostr[] = | Line 25  static const char np2infostr[] = | 
 | "SCREEN: !DISP"; | "SCREEN: !DISP"; | 
 |  |  | 
 |  |  | 
 | // ---- |  | 
 |  |  | 
 | static void about_init(HWND hWnd) { | static void about_init(HWND hWnd) { | 
 |  |  | 
 | char    work[128]; | char    work[128]; | 
 |  | RECT    rect; | 
 |  | POINT   pt; | 
 |  | RECT    parent; | 
 |  |  | 
| strcpy(work, "Neko Project II  "); | milstr_ncpy(work, str_np2title, sizeof(work)); | 
| strcat(work, np2version); | milstr_ncat(work, np2version, sizeof(work)); | 
| #ifdef NEW286 |  | 
| strcat(work, "+"); |  | 
| #endif |  | 
 | SetDlgItemText(hWnd, IDC_NP2VER, work); | SetDlgItemText(hWnd, IDC_NP2VER, work); | 
| GetWindowRect(hWnd, &aboutrct); | GetWindowRect(hWnd, &rect); | 
| MoveWindow(hWnd, aboutrct.left, aboutrct.top, | aboutsize.cx = rect.right - rect.left; | 
| aboutrct.right - aboutrct.left, 84, TRUE); | aboutsize.cy = rect.bottom - rect.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, 84); | 
 | SetFocus(GetDlgItem(hWnd, IDOK)); | SetFocus(GetDlgItem(hWnd, IDOK)); | 
 | } | } | 
 |  |  | 
 | static void about_more(HWND hWnd) { | static void about_more(HWND hWnd) { | 
 |  |  | 
 | char    infostr[1024]; | char    infostr[1024]; | 
 |  | RECT    rect; | 
 |  |  | 
 | np2info(infostr, np2infostr, sizeof(infostr)); | np2info(infostr, np2infostr, sizeof(infostr)); | 
 | SetDlgItemText(hWnd, IDC_NP2INFO, infostr); | SetDlgItemText(hWnd, IDC_NP2INFO, infostr); | 
 | EnableWindow(GetDlgItem(hWnd, IDC_MORE), FALSE); | EnableWindow(GetDlgItem(hWnd, IDC_MORE), FALSE); | 
| MoveWindow(hWnd, aboutrct.left, aboutrct.top, | GetWindowRect(hWnd, &rect); | 
| aboutrct.right - aboutrct.left, | np2class_move(hWnd, rect.left, rect.top, aboutsize.cx, aboutsize.cy); | 
| aboutrct.bottom - aboutrct.top, TRUE); |  | 
 | SetFocus(GetDlgItem(hWnd, IDOK)); | SetFocus(GetDlgItem(hWnd, IDOK)); | 
 | } | } | 
 |  |  | 
| Line 57  LRESULT CALLBACK AboutDialogProc(HWND hW | Line 66  LRESULT CALLBACK AboutDialogProc(HWND hW | 
 |  |  | 
 | switch (msg) { | switch (msg) { | 
 | case WM_INITDIALOG: | case WM_INITDIALOG: | 
 | ShowWindow(GetDlgItem(hWnd, IDC_EXTICON), SW_HIDE); |  | 
 | about_init(hWnd); | about_init(hWnd); | 
 | return(FALSE); | return(FALSE); | 
 |  |  | 
| Line 66  LRESULT CALLBACK AboutDialogProc(HWND hW | Line 74  LRESULT CALLBACK AboutDialogProc(HWND hW | 
 | case IDOK: | case IDOK: | 
 | EndDialog(hWnd, IDOK); | EndDialog(hWnd, IDOK); | 
 | break; | break; | 
 |  |  | 
 | case IDC_MORE: | case IDC_MORE: | 
 | about_more(hWnd); | about_more(hWnd); | 
 | break; | break; | 
 |  |  | 
 | default: | default: | 
 | return(FALSE); | return(FALSE); | 
 | } | } |