home *** CD-ROM | disk | FTP | other *** search
- Type GreetingMasterForm From SampleMasterForm
- Dim lblGreetings As New Label
- Dim LargeFont As New Font
- Dim btnPlay As New Button
- Dim GreetingTimer As New Timer
-
- ' METHODS for object: GreetingMasterForm
- Sub btnPlay_Click()
- ResetApplication_Click
-
- ' Now we move the greetings into position
- lblGreetings.Top = GreetingMasterForm.Top + GreetingMasterForm.ScaleHeight
- lblGreetings.Left = (GreetingMasterForm.ScaleWidth / 2) - (lblGreetings.Width / 2)
- lblGreetings.Visible = True
-
- ' Initialize and present the greetings message
- GreetingTimer.Enabled = True
-
- ' Play the games greeting
- PlayGreetings
- End Sub
-
- Sub GreetingTimer_Timeout()
- Dim target_top As Integer
-
- App.AutoBusySignal = False
- target_top = (GreetingMasterForm.ScaleHeight - lblGreetings.Height) / 2
-
- ' Move the welcome sign up 60 pixels at a time
- lblGreetings.Top = lblGreetings.Top - 60
- lblGreetings.Refresh
-
- ' If the greeting sign is in position, turn off the timer
- If lblGreetings.Top <= target_top Then GreetingTimer.Enabled = False
- App.AutoBusySignal = True
-
- End Sub
-
- Sub Load()
- ' Restore prerequisite objects that are shared with other
- ' samples, and therefore may already be loaded.
- If FindObject("AudioPlayer") = Nothing Then
- LoadTextObject(SampleDir & "audio.eto")
- End If
-
- End Sub
-
- Sub PlayGreetings()
- Dim option As long
- Dim result As long
- Dim greeting_part1 As String
- Dim greeting_part2 As String
-
- greeting_part1 = SampleDir & "professr.wav"
- greeting_part2 = SampleDir & "wargames.wav"
- result = AudioPlayer.sndPlaySoundA(greeting_part1, option)
- result = AudioPlayer.sndPlaySoundA(greeting_part2, option)
- End Sub
-
- Sub ResetApplication_Click
- ' First of all we need to hide the greeting message and preposition it
- lblGreetings.Visible = False
- End Sub
-
- End Type
-
- Type AudioPlayer
- Dim SND_SYNC As Long
- Dim SND_ASYNC As Long
- Dim SND_NODEFAULT As Long
- Dim SND_MEMORY As Long
- Dim SND_LOOP As Long
- Dim SND_NOSTOP As Long
- Declare Function sndPlaySoundA Lib "Winmm" (ByVal file As String, ByVal opt As Long) As Long
-
- ' METHODS for object: AudioPlayer
- Function Play(file As String) As Long
- Play = sndPlaySoundA(file, SND_ASYNC Or SND_NODEFAULT)
- End Function
-
- Function PlaySync(file As String) As Long
- Play = sndPlaySoundA(file, SND_SYNC Or SND_NODEFAULT)
- End Function
-
- End Type
-
- Begin Code
- ' Reconstruction commands for object: GreetingMasterForm
- '
- With GreetingMasterForm
- .Caption := "BOOT CAMP Games Demonstration"
- .BackColor := 0
- .Move(5265, 1170, 7185, 5250)
- .SampleDir := "W:\bootcamp\basic\greeting\"
- .SampleName := "greeting"
- With .lblGreetings
- .Caption := "Welcome to the Games Demonstration"
- .ForeColor := 16750080
- .Font := GreetingMasterForm.LargeFont
- .ZOrder := 1
- .Move(607, 990, 5850, 2520)
- .Visible := False
- .Alignment := "Center"
- End With 'GreetingMasterForm.lblGreetings
- With .LargeFont
- .FaceName := "vtspecl_132_dblhiwide"
- .Size := 36.000000
- .Bold := True
- .Italic := False
- .Strikethru := False
- End With 'GreetingMasterForm.LargeFont
- With .btnPlay
- .Caption := "Play"
- .ZOrder := 2
- .Move(5850, 150, 1050, 450)
- End With 'GreetingMasterForm.btnPlay
- With .GreetingTimer
- .Interval := 1
- End With 'GreetingMasterForm.GreetingTimer
- With .helpfile
- .FileName := "W:\bootcamp\basic\greeting\greeting.hlp"
- End With 'GreetingMasterForm.helpfile
- End With 'GreetingMasterForm
- ' Reconstruction commands for object: AudioPlayer
- '
- With AudioPlayer
- .SND_SYNC := 0
- .SND_ASYNC := 1
- .SND_NODEFAULT := 2
- .SND_MEMORY := 4
- .SND_LOOP := 8
- .SND_NOSTOP := 16
- End With 'AudioPlayer
- End Code
-