Sub Globals
Private myViews As List
Private DesignerViews As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1") ' already has some views
DesignerViews=Activity.NumberOfViews
myViews.Initialize
'Add panels dynamic
addPanel ("test1",0,0,200,200)
addPanel ("test2",80,80,200,200)
addPanel ("test3",160,160,200,200)
addPanel ("test4",240,240,200,200)
'Remove panels Dynamic and one view that was created in designer.
removePanel ("test4")
Activity.RemoveViewAt(1)
DesignerViews=DesignerViews-1
removePanel("test1")
removePanel("test3")
removePanel("test2")
End Sub
Sub addPanel (Pname As String, left As Int, top As Int, width As Int, height As Int )
Private P As Panel
P.Initialize(Pname)
P.Tag=Pname ' if we need to reference it later we'll use tag property.
Activity.AddView(P,left,top,width,height)
P.Color=Colors.red ' Just to see them better
myViews.Add(Pname)
End Sub
Sub removePanel (Pname As String)
Activity.RemoveViewAt(myViews.IndexOf(Pname)+DesignerViews)
myViews.RemoveAt(myViews.IndexOf(Pname))
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub