home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / mag&info / etc130.zip / NOTESTUT.ETC < prev    next >
Text File  |  1993-03-08  |  5KB  |  172 lines

  1. ; This program is a demo of how to create a tutorial using EtCetera.
  2.  
  3. ; $P stores the path where the WAV files are
  4. $P = ActiveDirectory & "\"
  5.  
  6. ; This portion confirms that we are using VGA
  7. #A = SCRW + SCRH
  8. If #A = 1120 Then Goto CheckETCVer 
  9. Message "This tutorial requires a VGA display."
  10. End
  11.  
  12. ; This portion confirms that we are using EtCetera 2.00 or higher
  13. :CheckETCVer
  14. If ETCVer >= 200 Then Goto CheckNotepad
  15. Message "This tutorial requires EtCetera version 2.00 or higher."
  16. End
  17.  
  18. ; Here, we change to the Windows directory and confirm that Notepad
  19. ; is in this directory...
  20. :CheckNotepad
  21. CD WinDirectory
  22. Match "NOTEPAD.EXE", $A
  23. If $A Then Goto OKToStart
  24. Message "This tutorial requires Notepad, but Notepad is not in the Windows directory."
  25. End
  26.  
  27. ; Since we passed the three requirements...
  28. :OKToStart
  29. Message "Click OK to begin the Notepad Tutorial"
  30.  
  31. ; This section hides all currently open windows.
  32. TitleFill 100
  33. For #A = 100 to LINES + 99
  34. Hide $[#A]
  35. Next
  36.  
  37. Goto ThisHereLoc
  38.  
  39. ; This demo uses Notepad, so let's bring it up!
  40. If IsOpen "Notepad" Then Goto AlreadyRunning
  41. Run "NOTEPAD.EXE", MAX
  42. :AlreadyRunning
  43. Activate "Notepad"
  44.  
  45. ; Get the mouse out of the way
  46. Mouse MOVE 0, 0
  47.  
  48. ; And create the window where we display messages to the user
  49. CreateWindow @A, 200, 200, 240, 80
  50.  
  51. ; This clears the window...
  52. PaintWindow @A, WHITE
  53.  
  54. ; The next three lines display our first message to the user
  55. WriteText @A, "Welcome to the Notepad Tutorial.", 10, 10
  56. WriteText @A, "We will show you how to use the", 10, 30
  57. WriteText @A "menu with the mouse.", 40, 50
  58. PlaySound $P & "NOTE1.WAV"
  59.  
  60. ; Clear the window and display the next message.
  61. PaintWindow @A, WHITE
  62. WriteText @A, "Please do not move the mouse", 10, 10
  63. WriteText @A, "or press a key during this tutorial.", 10, 30
  64. PlaySound $P & "NOTE2.WAV"
  65.  
  66. ; Next message
  67. PaintWindow @A, WHITE
  68. WriteText @A, "To use a menu, you can either", 10, 10
  69. WriteText @A, "use the keyboard or the mouse.", 10, 30
  70. PlaySound $P & "NOTE3.WAV"
  71. WriteText @A, "To use the mouse, move it...", 10, 50
  72. PlaySound $P & "NOTE4.WAV"
  73.  
  74. ; Here, we simulate mouse movement
  75. Mouse MOVE 300, 300
  76. For #A = 300 to 20 Step -2
  77. Mouse MOVE #A, #A
  78. Next
  79.  
  80. ; Display the next message
  81. PaintWindow @A, WHITE
  82. WriteText @A, "Then click the LEFT mouse button.", 10, 10
  83. PlaySound $P & "NOTE5.WAV"
  84.  
  85. ; Simulate a mouse click
  86. Mouse LEFT CLICK
  87.  
  88. ; Display the next message
  89. WriteText @A, "You'll see the menu drop down", 10, 30
  90. WriteText @A, "from the menu bar.", 10, 50
  91. PlaySound $P & "NOTE6.WAV"
  92.  
  93. ; Next message...
  94. PaintWindow @A, WHITE
  95. WriteText @A, "Now, we move the mouse pointer", 10, 10
  96. WriteText @A, "to the item we want to choose.", 10, 30
  97. WriteText @A, "We'll choose the Open command.", 10, 50
  98. PlaySound $P & "NOTE7.WAV"
  99.  
  100. ; Simulate mouse movement
  101. Mouse MOVE 20, 20
  102. For #A = 20 to 65 Step 1
  103. Mouse MOVE 20, #A
  104. Next
  105.  
  106. ; Next message...
  107. PaintWindow @A, WHITE
  108. WriteText @A, "And, again, click the LEFT mouse", 10, 10
  109. WriteText @A, "button.", 95, 30
  110. PlaySound $P & "NOTE8.WAV"
  111.  
  112. ; Simulate mouse click
  113. Mouse LEFT CLICK
  114. Wait 2 seconds
  115.  
  116. ; And move the dialog box out of the way
  117. Move 0, 0
  118.  
  119. ; Get rid of the previous window
  120. DestroyWindow @A
  121.  
  122. ; And recreate it in the lower right corner of the display
  123. CreateWindow @A, 399, 399, 240, 80
  124.  
  125. ; Display the next message...
  126. PaintWindow @A, WHITE
  127. WriteText @A, "A dialog box appears which allows", 10, 10
  128. WriteText @A, "us to open a file.", 60, 30
  129. PlaySound $P & "NOTE9.WAV"
  130.  
  131. ; Next message...
  132. PaintWindow @A, WHITE
  133. WriteText @A, "Since we do not want to open a file,", 10, 10
  134. WriteText @A, "we will press the ESC key to close", 10, 30
  135. WriteText @A, "the dialog box...", 50, 50
  136. PlaySound $P & "NOTE10.WAV"
  137.  
  138. ; Get rid of our window (since it receives keystrokes, since it's active)
  139. DestroyWindow @A
  140.  
  141. ; Send ESC to dialog box
  142. SendKeys "{ESC}"
  143. Wait 2 seconds
  144.  
  145. ; Recreate centered text window and display message
  146. CreateWindow @A, 200, 200, 240, 80
  147. PaintWindow @A, WHITE
  148. WriteText @A, "And that's all there is to it!  Once", 10, 10
  149. WriteText @A, "this tutorial ends, it's your turn", 10, 30
  150. WriteText @A, "to try it!", 90, 50
  151. PlaySound $P & "NOTE11.WAV"
  152.  
  153. ; Get rid of text window
  154. DestroyWindow @A
  155.  
  156. ; Kill Notepad
  157. Close "Notepad"
  158.  
  159. :ThisHereLoc
  160.  
  161. ; Unhide all hidden windows
  162. TitleFill 100
  163. #L = Lines
  164. Message $#L
  165. For #A = 100 to LINES + 99
  166. Message $[#A], $#A
  167. UnHide $[#A]
  168. Next
  169.  
  170. ; And leave!
  171. Message "This tutorial is done.", "EtCetera Demo"
  172.