Diff for /np2/win9x/dialog/d_about.cpp between versions 1.1.1.1 and 1.14

version 1.1.1.1, 2003/10/16 17:58:58 version 1.14, 2007/10/26 14:38:34
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
 #include        "resource.h"  #include        "resource.h"
 #include        "np2.h"  #include        "np2.h"
   #include        "oemtext.h"
   #include        "np2class.h"
 #include        "dialog.h"  #include        "dialog.h"
 #include        "dialogs.h"  #include        "dialogs.h"
 #include        "np2info.h"  #include        "np2ver.h"
 #include        "pccore.h"  #include        "pccore.h"
   #include        "np2info.h"
   
   
 static  RECT    aboutrct;  static  SIZE    s_szAbout;
 static const char np2infostr[] =                                                                        \  
                                                 "CPU: !CPU !CLOCK\r\n"                                          \  static const OEMCHAR str_np2title[] = OEMTEXT(PROJECTNAME) \
                                                 "MEM: !MEM1\r\n"                                                        \                                                                                  OEMTEXT(PROJECTSUBNAME) \
                                                 "GDC: !GDC\r\n"                                                         \                                                                                  OEMTEXT("  ");
                                                 "TEXT: !TEXT\r\n"                                                       \  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%");
                                                 "GRPH: !GRPH\r\n"                                                       \  
                                                 "SOUND: !EXSND\r\n"                                                     \  
                                                 "\r\n"                                                                          \  static void onInitDialog(HWND hWnd)
                                                 "BIOS: !BIOS\r\n"                                                       \  {
                                                 "RHYTHM: !RHYTHM\r\n"                                           \          OEMCHAR szWork[128];
                                                 "\r\n"                                                                          \          RECT    rect;
                                                 "SCREEN: !DISP";          RECT    rectMore;
           RECT    rectInfo;
           int             nHeight;
 // ----          POINT   pt;
   #if defined(OSLANG_UTF8)
 static void about_init(HWND hWnd) {          TCHAR   szWork2[128];
   #endif  // defined(OSLANG_UTF8)
         char    work[128];  
           milstr_ncpy(szWork, str_np2title, NELEMENTS(szWork));
         strcpy(work, "Neko Project II  ");          milstr_ncat(szWork, np2version, NELEMENTS(szWork));
         strcat(work, np2version);  #if defined(NP2VER_WIN9X)
 #ifdef NEW286          milstr_ncat(szWork, NP2VER_WIN9X, NELEMENTS(szWork));
         strcat(work, "+");  #endif
   #if defined(OSLANG_UTF8)
           oemtotchar(szWork2, NELEMENTS(szWork2), szWork, -1);
           SetDlgItemText(hWnd, IDC_NP2VER, szWork2);
   #else
           SetDlgItemText(hWnd, IDC_NP2VER, szWork);
 #endif  #endif
         SetDlgItemText(hWnd, IDC_NP2VER, work);  
         GetWindowRect(hWnd, &aboutrct);  
         MoveWindow(hWnd, aboutrct.left, aboutrct.top,  
                                                                 aboutrct.right - aboutrct.left, 84, TRUE);  
         SetFocus(GetDlgItem(hWnd, IDOK));  
 }  
   
 static void about_more(HWND hWnd) {          GetWindowRect(hWnd, &rect);
           s_szAbout.cx = rect.right - rect.left;
           s_szAbout.cy = rect.bottom - rect.top;
   
           if ((dlgs_getitemrect(hWnd, IDC_MORE, &rectMore)) &&
                   (dlgs_getitemrect(hWnd, IDC_NP2INFO, &rectInfo)))
           {
                   nHeight = s_szAbout.cy - (rectInfo.bottom - rectMore.bottom);
                   GetClientRect(GetParent(hWnd), &rect);
                   pt.x = (rect.right - rect.left - s_szAbout.cx) / 2;
                   pt.y = (rect.bottom - rect.top - s_szAbout.cy) / 2;
                   ClientToScreen(GetParent(hWnd), &pt);
                   np2class_move(hWnd, pt.x, pt.y, s_szAbout.cx, nHeight);
           }
   
         char    infostr[1024];          SetFocus(GetDlgItem(hWnd, IDOK));
   }
   
         np2info(infostr, np2infostr, sizeof(infostr));  static void onMore(HWND hWnd)
         SetDlgItemText(hWnd, IDC_NP2INFO, infostr);  {
           OEMCHAR szInfo[1024];
           RECT    rect;
   #if defined(OSLANG_UTF8)
           TCHAR   szInfo2[1024];
   #endif  // defined(OSLANG_UTF8)
   
           np2info(szInfo, np2infostr, NELEMENTS(szInfo), NULL);
   #if defined(OSLANG_UTF8)
           oemtotchar(szInfo2, NELEMENTS(szInfo2), szInfo, -1);
           SetDlgItemText(hWnd, IDC_NP2INFO, szInfo2);
   #else
           SetDlgItemText(hWnd, IDC_NP2INFO, szInfo);
   #endif
         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, s_szAbout.cx, s_szAbout.cy);
                                                         aboutrct.bottom - aboutrct.top, TRUE);  
         SetFocus(GetDlgItem(hWnd, IDOK));          SetFocus(GetDlgItem(hWnd, IDOK));
 }  }
   
 LRESULT CALLBACK AboutDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {  LRESULT CALLBACK AboutDialogProc(HWND hWnd, UINT uMsg,
                                                                                                   WPARAM wParam, LPARAM lParam)
         switch (msg) {  {
           switch(uMsg)
           {
                 case WM_INITDIALOG:                  case WM_INITDIALOG:
                         ShowWindow(GetDlgItem(hWnd, IDC_EXTICON), SW_HIDE);                          onInitDialog(hWnd);
                         about_init(hWnd);                          break;
                         return(FALSE);  
   
                 case WM_COMMAND:                  case WM_COMMAND:
                         switch (LOWORD(wp)) {                          switch (LOWORD(wParam))
                           {
                                 case IDOK:                                  case IDOK:
                                         EndDialog(hWnd, IDOK);                                          EndDialog(hWnd, IDOK);
                                         break;                                          return TRUE;
   
                                 case IDC_MORE:                                  case IDC_MORE:
                                         about_more(hWnd);                                          onMore(hWnd);
                                         break;                                          break;
                                 default:  
                                         return(FALSE);  
                         }                          }
                         break;                          break;
   
                 case WM_CLOSE:                  case WM_CLOSE:
                         PostMessage(hWnd, WM_COMMAND, IDOK, 0);                          PostMessage(hWnd, WM_COMMAND, IDOK, 0);
                         break;                          break;
   
                 default:  
                         return(FALSE);  
         }          }
         return(TRUE);          return FALSE;
 }  }
   

Removed from v.1.1.1.1  
changed lines
  Added in v.1.14


RetroPC.NET-CVS <cvs@retropc.net>