Hi all
I create an array of panels and keep the indexes on tag as new Type.
Then I try to restore the indexes in touch event , but all properties are ok but tag.
Tag returns indexes of last panel.( (4,4 ) the last indexes of cycle)
What is wrong in my code?
...
Sub Globals
Type indexn (ind1 As Int, ind2 As Int)
Dim Grid(5,5) As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim ind As indexn
...
For i=0 To 4
For j=0 To 4
Grid(i,j).Initialize("Panels")
ind.ind1=i
ind.ind2=j
Grid(i,j).Tag=ind 'tag is ok
....
Next
Next
End Sub
Sub Panels_Touch (Action As Int, X As Float, Y As Float) As Boolean
Dim ind As indexn
Dim p As Panel
p = Sender 'sender properties are ok but tag
ind=p.Tag 'tag is wrong
If p.RequestFocus=True Then
Msgbox("xxx", "focus")
Else
Msgbox("yyy", "no_focus")
End If
End Sub
Thank for replying
I create an array of panels and keep the indexes on tag as new Type.
Then I try to restore the indexes in touch event , but all properties are ok but tag.
Tag returns indexes of last panel.( (4,4 ) the last indexes of cycle)
What is wrong in my code?
...
Sub Globals
Type indexn (ind1 As Int, ind2 As Int)
Dim Grid(5,5) As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim ind As indexn
...
For i=0 To 4
For j=0 To 4
Grid(i,j).Initialize("Panels")
ind.ind1=i
ind.ind2=j
Grid(i,j).Tag=ind 'tag is ok
....
Next
Next
End Sub
Sub Panels_Touch (Action As Int, X As Float, Y As Float) As Boolean
Dim ind As indexn
Dim p As Panel
p = Sender 'sender properties are ok but tag
ind=p.Tag 'tag is wrong
If p.RequestFocus=True Then
Msgbox("xxx", "focus")
Else
Msgbox("yyy", "no_focus")
End If
End Sub
Thank for replying