'Add a new strip
Sub btnAddStrip_Click
'Declaration of panel to add
Dim left, top, width, height As Int
Dim iv As ImageView
iv.Initialize("ivStrip")
vw = iv
iv.Tag = strips
iv.Color = Colors.White
iv.Bitmap = LoadBitmap(File.DirAssets, "tempStrip.png")
iv.Gravity = Gravity.FILL
strips = strips+1
left = 10dip
width = 240
height = 150
top = svStrips.Panel.NumberOfViews*(height+imgSpace) + 55dip
'Add the panel to the scrollview
svStrips.Panel.AddView(iv, left, top, width, height)
'Set scrollview panel
If svStrips.Panel.NumberOfViews >4 Then
svStrips.Panel.height = svStrips.Panel.height + (height+imgSpace)
End If
SelectedStrip = iv.Tag
'Saves the current canvas to a map.
mapPanels.Put(iv.Tag, pnlCanvas)
ClearPanelCanvas
End Sub
'Show the options for the strips
Sub ivStrip_Click
vw = Sender
ac2.show(vw)
ClearPanelCanvas
LoadPanelCanvas(vw.Tag)
End Sub
'Clears the canvas panel
Sub ClearPanelCanvas
For i = pnlCanvas.NumberOfViews-1 To 0 Step -1
pnlCanvas.RemoveViewAt(i)
Next
End Sub
'Loads the panel belonging to the strip
Sub LoadPanelCanvas (index As Int)
Dim pnl As Panel
pnl = mapPanels.Get(index)
pnlCanvas = pnl
End Sub