home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_BAS / DGDEMO.ZIP / TGDEMO99.FRM (.txt) < prev    next >
Visual Basic Form  |  1994-01-25  |  12KB  |  162 lines

  1. Demo99
  2. TrueGrid Chess!
  3. Form15
  4. Table1
  5. TgDemo
  6. WhitePiece
  7. wwwwwwwwwwp
  8. wwwwwwwwwwp
  9. WhitePiece
  10. wwwwwwwwwwp
  11. wwwwwwwwwwp
  12. WhitePiece
  13. wwwwwwwwwwp
  14. wwwwwwwwwwp
  15. WhitePiece
  16. wwwwwwwwwwp
  17. wwwwwwwwwwp
  18. WhitePiece
  19. wwwwwwwwwwp
  20. wwwwwwwwwwp
  21. WhitePiece
  22. wwwwwwwwwwp
  23. wwwwwwwwwwp
  24. BlackPiece
  25. wwwwwwwwwwp
  26. wwwwwwwwwwp
  27. BlackPiece
  28. wwwwwwwwwwp
  29. wwwwwwwwwwp
  30. wwwwww
  31. wwwwww
  32. BlackPiece
  33. wwwwwwwwwwp
  34. wwwwwwwwwwp
  35. wpwwp
  36. BlackPiece
  37. wwwwwwwwwwp
  38. wwwwwwwwwwp
  39. BlackPiece
  40. wwwwwwwwwwp
  41. wwwwwwwwwwp
  42. wwwwwp
  43. BlackPiece
  44. wwwwwwwwwwp
  45. wwwwwwwwwwp
  46. wwwwwp
  47. wwwwww
  48. ppwppw
  49. @    Form_Loadq
  50. Pieces
  51. QUEEN
  52. BISHOP
  53. KNIGHT
  54. ROOK}
  55. Table1_Click>
  56. Table1_Fetchk
  57. Value
  58. Table1
  59. Picture
  60. WhitePieceN
  61. BlackPiece
  62. Table1_FetchAttributes
  63. StatusS
  64. Splitv
  65. FgColor
  66. BgColor0
  67.     FontStyleF
  68. DK_BLUE'
  69. ColumnCellAttrs
  70. Table1_DragCellj
  71. dragRow
  72. dragColw
  73. MarqueeStyle`
  74. GMQ_HIGHCELL
  75. DRAG_BEGIN
  76. BEGIN_DRAGV
  77. Table1_DragOver"
  78. Source
  79. Control
  80. State
  81. LEAVE
  82. GMQ_NONE
  83. ENTER
  84. PointX
  85. PointY
  86.     dragToRow
  87. RowAtPoint
  88.     dragToCol
  89. ColumnAtPoint
  90. Table1_DragDrop
  91. dragToCell6
  92. RefreshColZ
  93. RefreshColumn
  94. RowIndex
  95. ColumnIndexP
  96. dragging
  97. WhitePiece_Click
  98. Index|
  99. SendMessagem
  100. wParam
  101. lParam
  102. GRM_REFRESHCELL
  103. RefreshCell
  104. TgDemo
  105. ignore
  106. subIf
  107. Form_Unload
  108. Cancel
  109. QuitCurrentDemoB
  110.  Pieces contains the piece index numbers.  0 if empty square.R
  111.  i% is used as a work variable
  112.  Information about pieces in transit
  113.  Piece indices: must match Index of WhitePiece and
  114.  BlackPiece controls
  115.  These two definitions are used by the RefreshCell routine. 
  116. Form_Load
  117.  Fixed number of rows ... 8n
  118.  Set all columns so that cell colors are queried
  119.  each time they are needed.l
  120.  *** Set up the chess board ***o
  121.  First, position the pawns. 
  122.  Position the black pieces
  123.  Position the white pieces.
  124. Form_Unload
  125. RefreshCell
  126.  This is a "trick" to refresh a cell within TrueGrid.  It uses
  127.  an undocumented TrueGrid message (I thought this was OK since
  128.  this is one of the more frivolous demos).  However, thiss
  129.  technique will work with all versions of TrueGrid tot
  130.  refresh only the specified cell.s
  131. Table1_DragCell
  132.  Only start dragging if there is a piece at this
  133.  location.
  134.  Set drag parameters so other events know we'res
  135.  dragging.
  136.  Start drag
  137. Table1_DragDrop
  138.  Drop only if there's a valid cell under the cursor.
  139.  Overwrite the current piece with the new piece.
  140.  Clear the old piece if we didn't drop on top of
  141.  ourselves.o
  142.  Refresh the old and new cells so that Fetch isf
  143.  call to redisplay them.
  144. Table1_DragOver
  145.  When dragging, we always update the dragToRow and
  146.  dragToCol so other events know where we are.w
  147.  reentry ... turn dragging on againr
  148.  exiting while dragging ... suspend drag
  149.  calculate the cell which the cursor isg
  150.  now pointing to.l
  151.  Refresh the old current cell and the new
  152.  current cell to change the highlighting.
  153. Table1_Fetch
  154.  Fetch a piece.  Pieces contains the index into
  155.  an array of pictures (WhitePiece/BlackPiece) that
  156.  contain the actual pictures of the pieces.e
  157.  Postive values are white, negatives are black.h
  158. Table1_FetchAttributes
  159.  If dragging, then always highlight the currenth
  160.  cell by letting the background color show through.
  161.  This code sets BgColor to obtain a checkerboard effect.
  162.