home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Games 3 / cd.iso / os2 / pmgnuchs / create.c < prev    next >
Text File  |  1994-01-25  |  4KB  |  111 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:    Create module (Create.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 <Stdio.h>
  40. #include "PmChess.h"
  41. #include "Defs.h"
  42.  
  43.  
  44. extern HWND hComputerColor;
  45. extern HWND hComputerMove;
  46. extern HWND hWhosTurn;
  47. extern HWND hClockComputer;
  48. extern HWND hClockHuman;
  49. extern HWND hMsgComputer;
  50. extern HWND hMsgHuman;
  51. extern short cyClient;                  /* Height of client area.*/
  52. extern float ScaleFactor;              
  53.  
  54.  
  55. void Create_Children(HWND hWnd, short xchar, short ychar)
  56. {
  57.    POINTL pt;
  58.  
  59.    /* Get the location of lower left conor of client area */
  60.    QueryBoardSize ( &pt);
  61.    
  62.             hComputerColor = WinCreateWindow (hWnd, WC_STATIC,
  63.                          NULL,
  64.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  65.                          0,
  66.                          cyClient - (SHORT)pt.y - ychar * 3 + 5,
  67.                          10*xchar,
  68.                          ychar,
  69.                            hWnd, HWND_TOP, 1000, NULL, NULL);
  70.  
  71.          hWhosTurn = WinCreateWindow (hWnd, WC_STATIC,
  72.                          NULL,
  73.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  74.                          10*xchar,
  75.                          cyClient - (SHORT)pt.y - ychar * 3 + 5,
  76.                          10*xchar,
  77.                          ychar,
  78.                          hWnd, HWND_TOP, 1001, NULL, NULL);
  79.  
  80.          hComputerMove = WinCreateWindow (hWnd, WC_STATIC,
  81.                          NULL,
  82.                          SS_TEXT | DT_LEFT | WS_VISIBLE,
  83.                          320,
  84.                          cyClient - (SHORT)pt.y - ychar * 3 + 5/*pt.y+(3*ychar)/2*/,
  85.                          10*xchar,
  86.                          ychar,
  87.                            hWnd, HWND_TOP, 1003, NULL, NULL);
  88.  
  89.  
  90.          hClockComputer =  WinCreateWindow (hWnd,  WC_STATIC, NULL,
  91.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  92.                         80, 20, 5*xchar, ychar, hWnd,
  93.                         HWND_TOP, 1010, NULL, NULL);
  94.  
  95.          hClockHuman =  WinCreateWindow (hWnd,  WC_STATIC, NULL,
  96.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  97.                         180, 20, 5*xchar, ychar, hWnd,
  98.                         HWND_TOP, 1011, NULL, NULL);
  99.  
  100.          hMsgComputer = WinCreateWindow (hWnd,  WC_STATIC, "Computer:",
  101.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  102.                         0, 20, 6*xchar, ychar, hWnd,
  103.                         HWND_TOP, 1020, NULL, NULL);
  104.  
  105.          hMsgHuman    = WinCreateWindow (hWnd,  WC_STATIC, "You:",
  106.                           SS_TEXT | DT_CENTER | WS_VISIBLE,
  107.                         130, 20, 6*xchar, ychar, hWnd,
  108.                         HWND_TOP, 1021, NULL, NULL);
  109. }
  110.  
  111.