home *** CD-ROM | disk | FTP | other *** search
- Type GameTopMasterForm From SampleMasterForm
- Dim GameTopOptionMenu As New PopupMenu
- Dim GameTopMenuBar As New MenuBar
- Dim imgTop As New Image
- Dim TimerToggle As Integer
- Dim SpinCounter As Integer
- Dim bmpTop As New Bitmap
-
- ' METHODS for object: GameTopMasterForm
- Sub DisplayImage(row As Integer, column As Integer)
- Dim x As Integer
- Dim y As Integer
-
- ' Compensate for the array coordinates
- x = (column - 1)
- y = (row - 1)
-
- ' Take the size of the crop rect times the row and column values
- imgTop.CropXOffset = (imgTop.CropXSize * x)
- imgTop.CropYOffset = (imgTop.CropYSize * y)
-
- End Sub
-
- Sub ExitApplication_Click
- Dim F Strictly As SampleMasterForm
- F = Me
-
- ' Turn off the spin properties
- TimerToggle = 0
- TimerSpinTop.Enabled = "False"
-
- ' Forward to parent
- F.ExitApplication_Click
- End Sub
-
- Sub ResetApplication_Click ()
-
- ' Load in the top bitmap
- GameTopMasterForm.bmpTop.FileName = SampleDir & "top.bmp"
-
- ' Initialize the start/stop button
- ' Add a checkmark to the Stop entry
- GameTopOptionMenu.CheckItem("StopTop", 1)
-
- imgTop.Picture = bmpTop
- ' These width and height values with scale factor of 1 will produce a cropXSize of 66 and
- ' a cropYsize of 61. These values coincide with dividing the overall size of the bitmap
- ' which height = 183 and width = 396 into a 3x6 bitmap array with (3) rows and (6) columns
- imgTop.Width = 990
- imgTop.Height = 920
-
- imgTop.CropXSize = 66
- imgTop.CropYSize = 61
- imgTop.CropXOffset = 0
- imgTop.CropYOffset = 0
-
- ' Initialize the SpinCounter
- SpinCounter = 1
-
- End Sub
-
- Sub SpinTop()
- SpinCounter = SpinCounter + 1
- If SpinCounter > 18 Then
- SpinCounter = 1
- End If
-
- ' DisplayImage takes a row and column parameter
- Select Case SpinCounter
- Case 1
- DisplayImage(1, 1)
- Case 2
- DisplayImage(1, 2)
- Case 3
- DisplayImage(1, 3)
- Case 4
- DisplayImage(1, 4)
- Case 5
- DisplayImage(1, 5)
- Case 6
- DisplayImage(1, 6)
- Case 7
- DisplayImage(2, 1)
- Case 8
- DisplayImage(2, 2)
- Case 9
- DisplayImage(2, 3)
- Case 10
- DisplayImage(2, 4)
- Case 11
- DisplayImage(2, 5)
- Case 12
- DisplayImage(2, 6)
- Case 13
- DisplayImage(3, 1)
- Case 14
- DisplayImage(3, 2)
- Case 15
- DisplayImage(3, 3)
- Case 16
- DisplayImage(3, 4)
- Case 17
- DisplayImage(3, 5)
- Case 18
- DisplayImage(3, 6)
- End Select
-
- imgTop.Refresh
-
- End Sub
-
- Sub StartTop_Click()
- ' Add a checkmark to the Stop entry
- GameTopOptionMenu.CheckItem("StopTop", 0)
- GameTopOptionMenu.CheckItem("StartTop", 1)
-
- TimerToggle = 1
- TimerSpinTop.Enabled = "True"
- End Sub
-
- Sub StopTop_Click()
- ' Add a checkmark to the Stop entry
- GameTopOptionMenu.CheckItem("StopTop", 1)
- GameTopOptionMenu.CheckItem("StartTop", 0)
-
- TimerToggle = 0
- TimerSpinTop.Enabled = "False"
- End Sub
-
- Sub TimerSpinTop_Timeout()
- ' If the spin button is on then spin the top
- If TimerToggle = 1 Then SpinTop
- End Sub
-
- End Type
-
- Type TimerSpinTop From Timer
-
- ' METHODS for object: TimerSpinTop
- Sub Timeout()
- App.AutoBusySignal = False
- ' Call the method on the top form to increment the top display
- GameTopMasterForm.TimerSpinTop_Timeout
- App.AutoBusySignal = True
- End Sub
-
- End Type
-
- Begin Code
- ' Reconstruction commands for object: GameTopMasterForm
- '
- With GameTopMasterForm
- .Caption := "Animation Demo"
- .Move(6795, 1965, 3255, 2790)
- .MenuBar := GameTopMasterForm.GameTopMenuBar
- .SampleDir := "C:\ENVELOP\bootcamp\basic\gametop\"
- .SampleName := "gametop"
- .TimerToggle := 0
- .SpinCounter := 1
- With .GameTopOptionMenu
-
- .InsertItem("StartTop", "&Start", -1)
- .InsertItem("StopTop", "St&op", -1)
- End With 'GameTopMasterForm.GameTopOptionMenu
- With .GameTopMenuBar
-
- .InsertPopup(SampleMasterFormFileMenu, "&File", -1)
- .InsertPopup(GameTopMasterForm.GameTopOptionMenu, "&Options", -1)
- .InsertPopup(SampleMasterFormHelpMenu, "&Help", -1)
- End With 'GameTopMasterForm.GameTopMenuBar
- With .imgTop
- .Caption := "imgTop"
- .ZOrder := 1
- .Move(1050, 600, 990, 920)
- .AutoInitCropRect := False
- .Picture := GameTopMasterForm.bmpTop
- .ScrollBars := "Never"
- .CropXSize := 66
- .CropYSize := 61
- End With 'GameTopMasterForm.imgTop
- With .bmpTop
- .LoadType := "MemoryBased"
- .FileName := "gametop.ero"
- .ResId := 0
- End With 'GameTopMasterForm.bmpTop
- With .helpfile
- .FileName := "C:\ENVELOP\bootcamp\basic\gametop\gametop.hlp"
- .IsShowing := -1
- End With 'GameTopMasterForm.helpfile
- End With 'GameTopMasterForm
- ' Reconstruction commands for object: TimerSpinTop
- '
- With TimerSpinTop
- .Interval := 1
- End With 'TimerSpinTop
- End Code
-