Sub Process_Globals
End Sub
Sub Globals
Dim number As Int = 0
Dim toppos As Int = 13%x
Dim Button1 As Button
Dim ScrollView1 As ScrollView
Dim Panel1 As Panel
Dim lstButtons As List
Type typButCode(Name As String, Code As Int)
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout1")
Activity.AddMenuItem("Add New ","Add_Button")
ScrollView1.Panel.LoadLayout("pnl_for_layout1")
ScrollView1.Panel.Height = Panel1.Height
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Add_Button_Click
Dim Id As InputDialog
Id.InputType = Id.INPUT_TYPE_TEXT
Id.Input = ""
Id.Hint = "Enter Your Button Name !"
Id.HintColor = Colors.ARGB(196, 255, 140, 0)
ret = DialogResponse.CANCEL
ret = Id.Show("Input the required text", "SPEED", "Yes", "No", "", Null)
'ToastMessageShow(ret & " : " & Id.Input, False)
If Id.Response = -1 Then ' answer yes
Dim nd As NumberDialog
nd.Digits = 7
nd.Number = 0000000
nd.Decimal = 2
nd.ShowSign = False
ret = nd.Show("SET SPEED ", "Yes", "No", "", Null)
'ToastMessageShow(ret & " : " & nd.Number, False)
If nd.Response = -1 Then
lstButtons.Initialize
Dim ButCode As typButCode
Dim NewButton As Button
NewButton.initialize ("NewButton")
NewButton.Tag = ButCode
lstButtons.Add(NewButton)
Panel1.AddView(NewButton, Button1.Left, toppos, Button1.Width, Button1.Height)
Panel1.Invalidate
NewButton.Color = Colors.Blue
NewButton.Text = (Id.Input & " : " & nd.Number)
NewButton.initialize ("NewButton")
NewButton.TextSize = 25dip
NewButton.Enabled = True
NewButton.TextColor = Colors.Black
'NewButton.Tag =
Panel1.Height = toppos + 13%x
ScrollView1.Panel.Height = Panel1.Height
toppos = toppos + 11%x
Else
ret = DialogResponse.CANCEL
End If
Else
ret = DialogResponse.CANCEL
End If
End Sub
Sub NewButton_click
Dim b As Button
b = Sender
Msgbox("Button Clicked" , b.tag)
End Sub