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

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