Hi,
in my program i will use the touchevent to move a panel inside a scrolview. But it does not work as I thought. A touchevent is triggered only in a narrow range.
A test with a panel without Scrolview working properly, the event is triggered on the entire screen.
in my program i will use the touchevent to move a panel inside a scrolview. But it does not work as I thought. A touchevent is triggered only in a narrow range.
A test with a panel without Scrolview working properly, the event is triggered on the entire screen.
Sub Globals
Dim pan As Panel
Dim but As Button
Dim scrl As ScrollView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'The Button is only to show the results, please don't click
'Please show the log!
scrl.Initialize(0)
pan.Initialize("pan")
pan.Color=Colors.Blue
Activity.AddView(scrl,0,0,100%x,100%y)
scrl.Panel.Width=scrl.Width
scrl.Panel.Height=scrl.Height
scrl.Panel.AddView(pan,0,0,scrl.Width,scrl.Height)
but.Initialize("")
pan.AddView(but,50,50,60,60)
End Sub
Sub pan_Touch (Action As Int, X As Float, Y As Float)
Select Action
Case 0 ' ACTION_DOWN
Log("ACTION_DOWN")
Log("pTop=" & Y) 'pTop)
Case 2 ' ACTION_MOVE
Log("ACTION_MOVE")
but.Top=Y
but.Left=X
Log("x=" & X & ", y=" & Y)
Case 1 ' ACTION_UP
Log("ACTION_UP")
Case Else
Log("Else:" & Action)
End Select
End Sub