home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Games 3 / cd.iso / os2 / pmgnuchs / stats.c < prev    next >
Text File  |  1994-01-05  |  3KB  |  91 lines

  1. //
  2. //  Copyright (C) 1986, 1987, 1988, 1989, 1990 Free Software Foundation, Inc.
  3. //  Copyright (c) 1988, 1989, 1990  John Stanback
  4. //
  5. //  Project:    OS/2 PM Port of GNU CHESS 3.1 (PmChess)
  6. //
  7. //  Version:    1990-11-17
  8. //
  9. //   Module:    Stats Dialog Logic (Stats.c)
  10. //
  11. //   Porter:    Ported to Windows 3.0 by Darly Baker
  12. //
  13. //   Porter:    Ported to OS/2 1.2+ by Kent Cedola
  14. //
  15. //   System:    OS2 1.2 using Microsoft C 6.0
  16. //
  17. //  Remarks:    This code converted from Windows to PM using a straight port
  18. //              method with some editing improvements.
  19. //
  20. //  License:
  21. //
  22. //    CHESS is distributed in the hope that it will be useful, but WITHOUT ANY
  23. //    WARRANTY.  No author or distributor accepts responsibility to anyone for
  24. //    the consequences of using it or for whether it serves any particular
  25. //    purpose or works at all, unless he says so in writing.  Refer to the
  26. //    CHESS General Public License for full details.
  27. //
  28. //    Everyone is granted permission to copy, modify and redistribute CHESS,
  29. //    but only under the conditions described in the CHESS General Public
  30. //    License.  A copy of this license is supposed to have been given to you
  31. //    along with CHESS so you can know your rights and responsibilities.  It
  32. //    should be in a file named COPYING.  Among other things, the copyright
  33. //    notice and this notice must be preserved on all copies.
  34. //
  35.  
  36. #define INCL_DOS
  37. #define INCL_PM
  38. #include <os2.h>
  39. #include "PmChess.h"
  40. #include "GnuChess.h"
  41. #include "Resource.h"
  42.  
  43.  
  44. HWND hStats = NULL;
  45.  
  46. //
  47. //  Define dialog procedure's prototypes.
  48. //
  49. MRESULT EXPENTRY StatProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  50.  
  51.  
  52. int StatDialog(HWND hWnd)
  53.   {
  54.   hStats = WinLoadDlg(HWND_DESKTOP, hWnd, StatProc, 0, IDD_STATS, NULL);
  55.  
  56.   return (0);
  57.   }
  58.  
  59.  
  60. //***************************************************************************
  61. //
  62. //  Routine: StatProc(In, In, In, In)
  63. //
  64. //  Remarks: This routine displays the stat dialog that is updated during
  65. //           the computers think time.
  66. //
  67. //  Returns: Depends on the message.
  68. //
  69. MRESULT EXPENTRY StatProc(HWND hDlg, ULONG msg, MPARAM mp1, MPARAM mp2)
  70.   {
  71.   switch (msg)
  72.     {
  73.     case WM_COMMAND:
  74.       switch (SHORT1FROMMP(mp1))
  75.         {
  76.         case IDC_OK:
  77.           WinDismissDlg(hDlg, TRUE);
  78.           break;
  79.         }
  80.       return (0);
  81.  
  82.     case WM_CLOSE:
  83.     case WM_DESTROY:
  84.       hStats = NULL;
  85.       flag.post = false;
  86.       break;
  87.     }
  88.  
  89.   return (WinDefDlgProc(hDlg, msg, mp1, mp2));
  90.   }
  91.