'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim scvFicha As ScrollView
Dim Edit1(6) As EditText
Dim btnOk As Button
Dim IME As IME
Dim pntype As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
IME.Initialize("IME")
IME.AddHeightChangedEvent
scvFicha.Initialize(500)
Activity.AddView(scvFicha,0,0,100%x,85%y)
FillScvFicha
End Sub
Sub Activity_Resume
scvFicha.Height = Activity.Height
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub FillScvFicha
Dim Panel0 As Panel
Dim PanelTop, PanelHeight, Label2Top As Int
Dim s() As String
PanelTop=0
Panel0=scvFicha.Panel
Panel0.Color=Colors.Gray
For i=0 To Edit1.Length - 1
Dim Panel1 As Panel
Panel1.Initialize("")
Panel1.Tag=i
PanelHeight=70dip
Panel0.AddView(Panel1,0,PanelTop,scvFicha.Width,PanelHeight)
Panel1.Color=Colors.Black
Dim Label1 As Label
Label1.Initialize("lblView")
Panel1.AddView(Label1,10dip,10dip,90%x,50dip)
Label1.TextSize=16
Label1.Gravity=Gravity.CENTER_VERTICAL
Label1.Color=Colors.Black
Label1.Tag=i
Label1.Text="Text "&i
Edit1(i).Initialize("edtView")
Panel1.AddView(Edit1(i),25%x,10dip,100%x-25%x-5dip,50dip)
Edit1(i).TextSize=20
Edit1(i).Gravity=Gravity.CENTER_VERTICAL
Edit1(i).SingleLine = True
Edit1(i).ForceDoneButton = True
Edit1(i).Wrap = True
Edit1(i).Tag=i
Edit1(i).Text = "Name"&i
PanelTop=PanelTop+PanelHeight+1dip
Next
Panel0.Height=PanelTop
End Sub
Sub edtView_FocusChanged (HasFocus As Boolean)
Dim edt As EditText
Dim row As Int
edt = Sender
row = edt.Tag
If HasFocus = True Then
If row = 0 Then StartActivity(Aux1)
End If
End Sub
Sub edtView_Click
Dim edt As EditText
Dim row As Int
edt = Sender
row = edt.Tag
End Sub
Sub btnOk_Click
pntype.RemoveView
End Sub
Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int)
scvFicha.Height = NewHeight
End Sub