home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 7 Games / 07-Games.zip / PMCHESSR.ZIP / CREATE.C < prev    next >
C/C++ Source or Header  |  1990-11-29  |  4KB  |  109 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:    Color Support Logic (Color.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.  
  52.  
  53. void Create_Children(HWND hWnd, short xchar, short ychar)
  54. {
  55.    POINTL pt;
  56.  
  57.    /* Get the location of lower left conor of client area */
  58.    QueryBoardSize ( &pt);
  59.    
  60.             hComputerColor = WinCreateWindow (hWnd, WC_STATIC,
  61.                          NULL,
  62.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  63.                          0,
  64.                          cyClient - (SHORT)pt.y - ychar * 3 + 5,
  65.                          10*xchar,
  66.                          ychar,
  67.                            hWnd, HWND_TOP, 1000, NULL, NULL);
  68.  
  69.          hWhosTurn = WinCreateWindow (hWnd, WC_STATIC,
  70.                          NULL,
  71.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  72.                          10*xchar,
  73.                          cyClient - (SHORT)pt.y - ychar * 3 + 5,
  74.                          10*xchar,
  75.                          ychar,
  76.                          hWnd, HWND_TOP, 1001, NULL, NULL);
  77.  
  78.          hComputerMove = WinCreateWindow (hWnd, WC_STATIC,
  79.                          NULL,
  80.                          SS_TEXT | DT_LEFT | WS_VISIBLE,
  81.                          375 /*0*/,
  82.                          cyClient - (SHORT)pt.y - ychar * 3 + 5/*pt.y+(3*ychar)/2*/,
  83.                          10*xchar,
  84.                          ychar,
  85.                            hWnd, HWND_TOP, 1003, NULL, NULL);
  86.  
  87.  
  88.          hClockComputer =  WinCreateWindow (hWnd,  WC_STATIC, NULL,
  89.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  90.                         390, cyClient - 55 - 4, 6*xchar, ychar, hWnd,
  91.                         HWND_TOP, 1010, NULL, NULL);
  92.  
  93.          hClockHuman =  WinCreateWindow (hWnd,  WC_STATIC, NULL,
  94.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  95.                         390, cyClient - (55+3*ychar) - 4, 6*xchar, ychar, hWnd,
  96.                         HWND_TOP, 1011, NULL, NULL);
  97.  
  98.          hMsgComputer = WinCreateWindow (hWnd,  WC_STATIC, "Computer:",
  99.                          SS_TEXT | DT_CENTER | WS_VISIBLE,
  100.                         390, cyClient - (55-3*ychar/2) - 4, 6*xchar, ychar, hWnd,
  101.                         HWND_TOP, 1020, NULL, NULL);
  102.  
  103.          hMsgHuman    = WinCreateWindow (hWnd,  WC_STATIC, "You:",
  104.                           SS_TEXT | DT_CENTER | WS_VISIBLE,
  105.                         390, cyClient - (55+3*ychar/2) - 4, 6*xchar, ychar, hWnd,
  106.                         HWND_TOP, 1021, NULL, NULL);
  107. }
  108.  
  109.