I am not sure if I am using the Is test correctly but it seems to report certain views under multiple categories:
* Buttons are picked up as 'buttons' and 'labels'
* CheckBoxes are picked up as 'buttons', 'checkboxes', and 'labels'
I have not tested every type of View (in case I am doing something silly here)
TEST
===============
Run example with one view created at a time and observe the log results
* Buttons are picked up as 'buttons' and 'labels'
* CheckBoxes are picked up as 'buttons', 'checkboxes', and 'labels'
I have not tested every type of View (in case I am doing something silly here)
TEST
===============
Run example with one view created at a time and observe the log results
B4X:
' Is bug?
Sub Process_Globals
End Sub
Sub Globals
Dim btn1 As Button
Dim cb1 As CheckBox
Dim lb1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
btn1.Initialize("") : btn1.Text="button 1" : Activity.AddView(btn1,5%x,5%y,32%x,8%y)
'cb1.Initialize("") : cb1.Text="check 1" : Activity.AddView(cb1,5%x,15%y,32%x,8%y)
'lb1.Initialize("") : lb1.Text="Label 1" : Activity.AddView(lb1,5%x,25%y,32%x,8%y)
End Sub
Sub Activity_Resume
Dim v As View
For i=0 To Activity.NumberOfViews-1
v=Activity.GetView(i)
If v Is Button Then Log("Button found")
If v Is CheckBox Then Log("CheckBox found")
If v Is Label Then Log("Label found")
Next
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Last edited: