#Region Project Attributes
#ApplicationLabel: Drag View Test
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim fltDraggedX As Float
Dim fltDraggedY As Float
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variabtles can only be accessed from this module.
Private PanelMyPanel As Panel
Private Label1 As Label
Private Velocity1 As Label
Private Velocity2 As Label
Private Velocity3 As Label
Private Velocity4 As Label
Private Velocity5 As Label
Private Velocity6 As Label
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("Main")
Dim dv1, dv2, dv3, dv4, dv5, dv6 As DraggableView
dv1.Initialize(PanelMyPanel, Velocity1, "Velocity1", PanelMyPanel.Width, PanelMyPanel.Height, _
Velocity1.Width, Velocity1.Height)
dv2.Initialize(PanelMyPanel, Velocity2, "Velocity2", PanelMyPanel.Width, PanelMyPanel.Height, _
Velocity2.Width, Velocity2.Height)
dv3.Initialize(PanelMyPanel, Velocity3, "Velocity3", PanelMyPanel.Width, PanelMyPanel.Height, _
Velocity3.Width, Velocity3.Height)
dv4.Initialize(PanelMyPanel, Velocity4, "Velocity4", PanelMyPanel.Width, PanelMyPanel.Height, _
Velocity4.Width, Velocity4.Height)
dv5.Initialize(PanelMyPanel, Velocity5, "Velocity5", PanelMyPanel.Width, PanelMyPanel.Height, _
Velocity5.Width, Velocity5.Height)
dv6.Initialize(PanelMyPanel, Velocity6, "Velocity6", PanelMyPanel.Width, PanelMyPanel.Height, _
Velocity6.Width, Velocity6.Height)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Public Sub DraggedPosition (strDraggedViewNameFromClass As String)
Select strDraggedViewNameFromClass
Case "Velocity1"
Label1.Text = "Circle 1 X = " & fltDraggedX & " Y = " & fltDraggedY
Case "Velocity2"
Label1.Text = "Circle 2 X = " & fltDraggedX & " Y = " & fltDraggedY
Case "Velocity3"
Label1.Text = "Circle 3 X = " & fltDraggedX & " Y = " & fltDraggedY
Case "Velocity4"
Label1.Text = "Circle 4 X = " & fltDraggedX & " Y = " & fltDraggedY
Case "Velocity5"
Label1.Text = "Circle 5 X = " & fltDraggedX & " Y = " & fltDraggedY
Case "Velocity6"
Label1.Text = "Circle 6 X = " & fltDraggedX & " Y = " & fltDraggedY
End Select
End Sub