LoadImages() ' Load imgmax number of pictures.
CreateButtons()
img = 1 ' Starting from 1st picture. img is index for pic[] array.
DisplayImages() ' Directly invoking it to display a picture aSaP.
Controls.ButtonClicked = OnButtonClicked
Loop:
If Button <> "" Then ' Awaits Button being modified by OnButtonClicked triggered event sub.
Controls.ButtonClicked = HaltButtonEvent ' Switches button event off!
CheckButtons()
DisplayImages()
Button = ""
Controls.ButtonClicked = OnButtonClicked ' Reactivates it again!
EndIf
Program.Delay(100) ' a brief delay for avoiding hammering CPU up w/ so many Ifs in a too short period of time!
Goto Loop
' --------------------------------------------------------------------------------------------------------------------------------------------------'
Sub OnButtonClicked
EndSub
' --------------------------------------------------------------------------------------------------------------------------------------------------'
Sub HaltButtonEvent
' A do-nothing sub for temporarily deactivate event triggers!
EndSub
' --------------------------------------------------------------------------------------------------------------------------------------------------'
Sub CheckButtons
If Button = "Forward" Then
img = img + 1
ElseIf Button = "Back" Then
img = img - 1
ElseIf Button = "Reload" Then
LoadImages()
ElseIf Button = "Quit" Then
Sound.PlayChimeAndWait()
Program.End()
EndIf
EndSub
' --------------------------------------------------------------------------------------------------------------------------------------------------'
Sub DisplayImages
If img > PicCount Then
img = PicCount
ElseIf img < 1 Then
img = 1
EndIf
EndSub
' --------------------------------------------------------------------------------------------------------------------------------------------------'
Sub LoadImages
For i = 1 To imgmax
GraphicsWindow.Title = "Loading #" + i
Sound.PlayChimes()
pic[i] = ImageList.LoadImage( Flickr.GetRandomPicture(tag) )
EndFor
PicCount = Array.GetItemCount(pic) ' Redundant to imgmax. Using just for example purposes.
EndSub
' --------------------------------------------------------------------------------------------------------------------------------------------------'
Sub CreateButtons