CursorLock% = True 'set the flag so we know we've clipped it
ret = ClipCursor(theRect) 'don't forget to release it sometime
ret = DeleteObject(hrgn) '!!! DELETE THE HRGN WE GOT FROM ZZ_GETHRGN!!!
Exit For
End If
End If
Next
If Not CursorLock Then Beep 'didn't find it
End Sub
Sub mnuDemoNone_Click ()
On Error Resume Next
Pic1ZZ.HiLiteMode = 0 'set the mode
clearchks 'clear em out
mnuDemoNone.Checked = True 'and chk this one
End Sub
Sub mnuDemoOver_Click ()
On Error Resume Next
Pic1ZZ.HiLiteMode = 2 'set the mode
clearchks 'clear em all
mnuDemoOver.Checked = True 'set this one
End Sub
Sub mnuFileBad_Click ()
Dim ret%
ret% = TestBadFile(Pic1ZZ)
End Sub
Sub mnuFileExit_Click ()
Call StopThisProgram
End Sub
Sub mnuFileGood_Click ()
Call LoadGoodFile(Pic1ZZ)
End Sub
Sub Pic1_Click ()
On Error Resume Next
Dim ret%
'make sure the cursor gets unlocked if it is
If CursorLock Then
ret% = UnClipCursor(&H0&)
CursorLock = False
End If
TB.Visible = False
End Sub
Sub Pic1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
If LastID% <> -1 Then
Prompt.Caption = ""
Prompt.Refresh 'this is necessary to force the update on the
'caption property if the mouse keeps moving across the ocean
End If
LastID% = -1
End Sub
Sub Pic1ZZ_Click (hsid As Integer, HsIDTag As String)
' This demonstrates the use of the hCursor property
' there's lots of ways to get a cursor handle
' I'll use the laziest way for this demo
Static cur%
On Error Resume Next
If hsid <> LOGO Then Exit Sub
'just do it on the LOGO for demo purposes
cur% = Not cur%
If cur% Then
Pic1ZZ.hCursor = LoadCursor(APINULL, IDC_ICON)
'no need to destroy sys cursor
DoMsgBox "Click on the Logo again to revert the cursors"
Else
Pic1ZZ.hCursor = 0 ' zero means use the cursor index
End If
End Sub
Sub Pic1ZZ_MouseDown (Button As Integer, Shift As Integer, X As Integer, Y As Integer, relX As Integer, relY As Integer, hsid As Integer, HsIDTag As String)
'here's a good example of where we need the mouse down
'because we want to release the cursor before we
'put up the msgbox in the mouseup event. Otherwise,
'the user couldn't get to the OK button
On Error Resume Next
Dim ret%
If CursorLock Then
ret% = UnClipCursor(0&)
CursorLock = False
End If
End Sub
Sub Pic1ZZ_MouseOver (hsid As Integer, HsIDTag As String)
'NOTES:
'Normally you probably won't be changing the stupid
'cursor for each hot spot region. This is just
'to demonstrate that you can if you want/need to.
'Actually, we now, exit before that, left it in for illustration purposes.
'You can just set the curor index at design time
'or run init time and leave it alone and then
'you'll have the same cursor on each region.
On Error Resume Next
If hsid% = LastID% Then Exit Sub
'If hsid% <> LastID% Then
Prompt.Caption = HsIDTag
Prompt.Refresh 'keeps it snappy
'End If
LastID% = hsid%
'----------- this block substitutes for Select Case below
If hsid% = LOGO Then
Pic1ZZ.CursorIndex = 12
ElseIf Pic1ZZ.CursorIndex <> 14 Then
Pic1ZZ.CursorIndex = 14
End If
Exit Sub '! remove this line to illustrate lots of cursor changes.
'----------end of block substitute
' the code below illustrates the extreme of changing the
'cursor for just about each region on the pic.
'you can try it to check worse case performance.
Select Case hsid
Case FORMERLY_YUGOSLAVIA
Pic1ZZ.CursorIndex = 16
Case FRANCE
Pic1ZZ.CursorIndex = 27
Case SPAIN
Pic1ZZ.CursorIndex = 21
Case ICELAND
Pic1ZZ.CursorIndex = 7
Case NORWAY
Pic1ZZ.CursorIndex = 24
Case SWITZERLAND
Pic1ZZ.CursorIndex = 25
Case LUXEMBOURG
Pic1ZZ.CursorIndex = 8
Case SWEDEN
Pic1ZZ.CursorIndex = 1
Case GERMANY
Pic1ZZ.CursorIndex = 2
Case POLAND
Pic1ZZ.CursorIndex = 3
Case SCOTLAND
Pic1ZZ.CursorIndex = 11
Case WALES
Pic1ZZ.CursorIndex = 23
Case ENGLAND
Pic1ZZ.CursorIndex = 20
Case IRELAND
Pic1ZZ.CursorIndex = 19
Case LOGO
Pic1ZZ.CursorIndex = 5
Case GULL
Pic1ZZ.CursorIndex = 30
Case COMPASS
Pic1ZZ.CursorIndex = 11
Case Else
Pic1ZZ.CursorIndex = 14
End Select
End Sub
Sub Pic1ZZ_MouseUp (Button As Integer, Shift As Integer, X As Integer, Y As Integer, relX As Integer, relY As Integer, hsid As Integer, HsIDTag As String)
Dim COMPASS$
On Error Resume Next
Select Case hsid
Case SPAIN To BULGARIA
Call ShowText(hsid%, HsIDTag$)
Case LOGO
'do nothing here
Case Else
'TextPanel.WindowState = 1
MainForm!TB.Visible = False
If relX > 0 And relY > 0 Then
COMPASS$ = "North-West"
ElseIf relX > 0 And relY < 0 Then
COMPASS$ = "South-West"
ElseIf relX < 0 And relY > 0 Then
COMPASS$ = "North-East"
Else
COMPASS$ = "South-East"
'NOTE- this is not always true because if there
'is no ref point defined it'll still show up here
'but that's a problem with this VB code and not
'with the VBX.
End If
DoMsgBox "Just to demonstrate the RefPt feature, you clicked " & COMPASS$ & " of the reference point on the " & HsIDTag$