home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / komix / DATA.Z / TicTacToe_MainMenu.srm < prev    next >
Text File  |  1997-09-30  |  4KB  |  193 lines

  1. $PBExportHeader$tictactoe_mainmenu.srm
  2. $PBExportComments$Generated by ObjectTeam
  3. forward
  4. global type tictactoe_mainmenu from menu
  5. end type
  6. type game from menu within tictactoe_mainmenu
  7. end type
  8. type new from menu within game
  9. end type
  10. type game from menu within tictactoe_mainmenu
  11. new new
  12. end type
  13. type opponent from menu within tictactoe_mainmenu
  14. end type
  15. type human from menu within opponent
  16. end type
  17. type computer_x from menu within opponent
  18. end type
  19. type computer_o from menu within opponent
  20. end type
  21. type opponent from menu within tictactoe_mainmenu
  22. human human
  23. computer_x computer_x
  24. computer_o computer_o
  25. end type
  26. end forward
  27.  
  28. shared variables
  29. // User defined attributes
  30.  
  31. // Non modeled user defined attributes
  32.  
  33. end variables
  34.  
  35. global type tictactoe_mainmenu from menu
  36. game game
  37. opponent opponent
  38. end type
  39. global tictactoe_mainmenu tictactoe_mainmenu
  40.  
  41. type variables
  42. // User defined attributes
  43.  
  44. // Association attributes
  45.  
  46. // Non modeled user defined attributes
  47.  
  48. // Control to class mappings
  49. //    tictactoe_mainmenu --> TicTacToe_MainMenu
  50. //    game --> TicTacToe_GameMenu
  51. //    new --> TicTacToe_New
  52. //    opponent --> TicTacToe_OpponentMenu
  53. //    human --> TicTacToe_Opponent
  54. //    computer_x --> TicTacToe_Opponent
  55. //    computer_o --> TicTacToe_Opponent
  56. end variables
  57.  
  58. on tictactoe_mainmenu.create
  59. tictactoe_mainmenu=this
  60. this.game=create game
  61. this.opponent=create opponent
  62. this.Item[]={ this.game,&
  63. this.opponent}
  64. this.Text = "TicTacToe_MainMenu"
  65. end on
  66.  
  67. on tictactoe_mainmenu.destroy
  68. destroy(this.game)
  69. destroy(this.opponent)
  70. end on
  71.  
  72. type game from menu within tictactoe_mainmenu
  73. new new
  74. end type
  75.  
  76. on game.create
  77. this.new=create new
  78. this.Item[]={ this.new}
  79. this.Text = "&Game"
  80. this.Microhelp = "new game"
  81. end on
  82.  
  83. on game.destroy
  84. destroy(this.new)
  85. end on
  86.  
  87. type new from menu within game
  88. end type
  89.  
  90. on new.create
  91. this.Text = "&New~tCtrl+N"
  92. this.Shortcut = 334
  93. end on
  94.  
  95. event clicked;//
  96. tictactoe_gui gui
  97. gui = ParentWindow
  98. tictactoe_game game
  99. tictactoe_computer computer
  100. game = gui.game
  101. computer = gui.computer
  102. game.startGame()
  103. computer.checkturn()
  104.  
  105. end event
  106.  
  107. type opponent from menu within tictactoe_mainmenu
  108. human human
  109. computer_x computer_x
  110. computer_o computer_o
  111. end type
  112.  
  113. on opponent.create
  114. this.human=create human
  115. this.computer_x=create computer_x
  116. this.computer_o=create computer_o
  117. this.Item[]={ this.human,&
  118. this.computer_x,&
  119. this.computer_o}
  120. this.Text = "&Opponent"
  121. end on
  122.  
  123. on opponent.destroy
  124. destroy(this.human)
  125. destroy(this.computer_x)
  126. destroy(this.computer_o)
  127. end on
  128.  
  129. type human from menu within opponent
  130. end type
  131.  
  132. on human.create
  133. this.Text = "&Human~tCtrl+H"
  134. this.Checked = true
  135. this.Shortcut = 328
  136. end on
  137.  
  138. event clicked;//
  139. parent.human.Checked      = TRUE
  140. parent.computer_x.Checked = FALSE
  141. parent.computer_o.Checked = FALSE
  142.  
  143. tictactoe_gui gui
  144. tictactoe_computer computer
  145. gui = ParentWindow
  146. computer = gui.computer
  147. computer.id = ''
  148. computer.checkturn()
  149. end event
  150.  
  151. type computer_x from menu within opponent
  152. end type
  153.  
  154. on computer_x.create
  155. this.Text = "Computer &X~tCtrl+X"
  156. this.Shortcut = 344
  157. end on
  158.  
  159. event clicked;//
  160. parent.human.Checked      = FALSE
  161. parent.computer_x.Checked = TRUE
  162. parent.computer_o.Checked = FALSE
  163.  
  164. tictactoe_gui gui
  165. tictactoe_computer computer
  166. gui = ParentWindow
  167. computer = gui.computer
  168. computer.id = 'X'
  169. computer.checkturn()
  170. end event
  171.  
  172. type computer_o from menu within opponent
  173. end type
  174.  
  175. on computer_o.create
  176. this.Text = "Computer &O~tCtrl+O"
  177. this.Shortcut = 335
  178. end on
  179.  
  180. event clicked;//
  181. parent.human.Checked      = FALSE
  182. parent.computer_x.Checked = FALSE
  183. parent.computer_o.Checked = TRUE
  184.  
  185. tictactoe_gui gui
  186. tictactoe_computer computer
  187. gui = ParentWindow
  188. computer = gui.computer
  189. computer.id = 'O'
  190. computer.checkturn()
  191. end event
  192.  
  193.