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.
Private Button1 As Button
Private Button2 As Button
Private Button3 As Button
Private Button4 As Button
Private EditText1 As EditText
Private Label4 As Label
Private ListView1 As ListView
Private Lbl3 As Label
Private Panel1 As Panel
Dim D, K, NoViews As Int
Dim LN, BV, qq As Int
Dim Pictures(4) As String Array
Dim Dmn As String
Dim ArcPos(7)
Dim LL, TT, WW, HH As Int
Dim TXT, PosObj, NPos As String
Dim Sx, Sy, Tx As Int
Dim Valore, Coord, Ncoord As String
Dim T(7)
Dim V(7)
Dim Pos(7)
Dim Name, Linea, Linew, Coor As String
Dim A, B, C, D As Int
Dim nx, ny As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("main")
D = Activity.Width/2
Pictures(0) = "Balo0.png"
Pictures(1) = "Balo1.png"
Pictures(2) = "Balo2.png"
Pictures(3) = "Balo3.png"
T(0) = "Select here the actions on Archive"
T(1) = "Select here the actions on Record"
T(2) = "Write here the Archive/Record wished"
T(3) = "List of contents object of the actions"
T(4) = "Click to lock-Long Click to close"
T(5) = "List of the actions preselected"
T(6) = "Reset actions data or the ended actions"
qq = Activity.NumberOfViews : BV = qq
NoViews = 6
k = -1
For i = 0 To NoViews : k = k+1
V(i) = Activity.GetView(i)
Linea = V(i)
Tx = (Linea).IndexOf(":")
Name = Linea.SubString2(0, Tx)
Linew = Linea.SubString2(Tx+1, Linea.Length)
Linea = Linew
Cx = Linea.IndexOf(":")
Coor = Linea.SubString2(Cx+1, Linea.Length)
Pos(k) = Pos(k) & Coor & ","
Linew = Linea.SubString2(Cx+1, Linea.Length)
Linea = Linew
Next
For s = 0 To NoViews
Coord = Pos(s)
Do Until Coord.Length = 0
Tx = Coord.IndexOf(",")
Valore = Coord.Substring2(0,Tx)
If Valore.Contains("Left=") = True Then A = Valore.Replace("Left=", " ")
If Valore.Contains("Top=") = True Then B = Valore.Replace("Top=", " ")
If Valore.Contains("Width=") = True Then C =Valore.Replace("Width=", " ")
If Valore.Contains("Height=") = True Then D = Valore.Replace("Height=", " ")
Ncoord = Coord.SubString2(Tx+1, Coord.Length)
Coord = Ncoord
Loop
'Label4.Text = Label4.Text & A & "," & B & "," & C & "," & D & CRLF
ArcPos(s) = A & "," & B & "," & C & "," & D & "," & T(s)
Next
qq = Activity.NumberOfViews : BV = qq
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub CreaBal
Dim IV As ImageView
IV.Initialize("ImageView")
IV.BringToFront
IV.Gravity=Gravity.Fill
IV.Visible = True
IV.Bitmap = LoadBitmap(File.DirAssets,Pictures(K))
If K = 0 Then Activity.AddView(IV, LL, TT, Lbl3.Width, Lbl3.Width)
If K = 1 Then Activity.AddView(IV, LL-(Lbl3.Width-WW), TT, Lbl3.Width, Lbl3.Width)
If K = 2 Then Activity.AddView(IV, LL, TT-(Lbl3.Width-HH), Lbl3.Width, Lbl3.Width)
If K = 3 Then Activity.AddView(IV, LL, TT-(Lbl3.Width-HH), Lbl3.Width, Lbl3.Width)
Dim LB As Label
LB.Initialize("Label")
LB.BringToFront
LB.Visible = True
LB.Color = Colors.White
LB.TextColor = Colors.Black
If Activity.Height > Activity.Width Then
If K = 0 Then Activity.AddView(LB, LL+Lbl3.Height, TT+(5*Lbl3.Height), 12*Lbl3.Height-4dip, 6*Lbl3.Height)
If K = 1 Then Activity.AddView(LB, LL+Lbl3.Height+(WW-Lbl3.Width), TT+(5*Lbl3.Height), 12*Lbl3.Height-4dip, 6*Lbl3.Height)
If K = 2 Then Activity.AddView(LB, LL+Lbl3.Height, TT-(Lbl3.Width-HH)+3*Lbl3.Height+4dip, 12*Lbl3.Height-4dip, 6*Lbl3.Height)
If K = 3 Then Activity.AddView(LB, LL+Lbl3.Height, TT-(Lbl3.Width-HH)+3*Lbl3.Height+5dip, 12*Lbl3.Height-4dip, 6*Lbl3.Height)
Else
If K = 0 Then Activity.AddView(LB, LL+(Lbl3.Height), TT+(5*Lbl3.Height), 11*Lbl3.Height, 6*Lbl3.Height)
If K = 1 Then Activity.AddView(LB, LL+(Lbl3.Height)+(WW-Lbl3.Width), TT+(5*Lbl3.Height), 11*Lbl3.Height, 6*Lbl3.Height)
If K = 2 Then Activity.AddView(LB, LL+(Lbl3.Height), TT-(Lbl3.Width-HH)+3*Lbl3.Height, 11*Lbl3.Height, 6*Lbl3.Height)
If K = 3 Then Activity.AddView(LB, LL+(Lbl3.Height), TT-(Lbl3.Width-HH)+3*Lbl3.Height, 11*Lbl3.Height, 6*Lbl3.Height)
End If
LB.TextSize = Lbl3.TextSize
LB.Text = TXT
qq = Activity.NumberOfViews : LN = qq-1
End Sub
Sub SetPos
If LL < D AND TT < ((2*D)*3)/4 Then K = 0 '349
If LL > D AND TT < ((2*D)*3)/4 Then K = 1
If LL < D AND TT > ((2*D)*3)/4 Then K = 2
If LL > D AND TT > ((2*D)*3)/4 Then K = 3
CreaBal
End Sub
Sub ImageView_click
Dim IV As ImageView
IV.Initialize("ImageView")
IV = Sender
ClearList
End Sub
Sub Label_Click
Dim LB As Label
LB.Initialize("Label")
LB = Sender
ClearList
End Sub
Sub ClearList
qq = Activity.NumberOfViews
For m = LN To BV Step -1
Activity.RemoveViewAt(m)
Next
TXT = "" : K = 0 : LL = 0 : TT = 0
End Sub
Sub Label3_Click
End Sub
Sub Panel1_Touch (Action As Int, X As Float, Y As Float) As Boolean
If Action = Activity.ACTION_DOWN Then
Sx = X
Sy = Y
IdObj
End If
End Sub
Sub IdObj
For i = 0 To 6
PosObj = ArcPos(i)
For n = 0 To 3
Tx = (PosObj).IndexOf(",")
Dmn = PosObj.SubString2(0, Tx)
If n = 0 Then LL = Dmn
If n = 1 Then TT = Dmn
If n = 2 Then WW = Dmn
If n = 3 Then HH = Dmn
'If n = 4 Then TXT = Dmn
NPos = PosObj.SubString2(Tx+1, PosObj.Length)
PosObj = NPos
Next
If (Sx > LL AND Sx < LL+WW) AND (Sy > TT AND Sy < TT+HH) Then
TXT = PosObj
SetPos
End If
Next
End Sub
Sub Lbl3_LongClick
If Panel1.Enabled = True Then
Panel1.Enabled = False
Else
Panel1.Enabled = True
End If
End Sub