'start of creation of main screen buttons
Dim row, col, n As Int
Dim btnHeight, btnWidth As Float
Dim Space As Float
ColNumber = 2
RowNumber = Ceil(ButtonNumber / ColNumber)
Space = 5dip
btnWidth = (100%x - (ColNumber + 1) * Space) / ColNumber
btnHeight = 40dip
scvMain.Initialize(0)
Activity.AddView(scvMain, 0, 0, 100%x, 100%y)
For row = 0 To RowNumber - 1
For col = 0 To ColNumber - 1
Dim btn As Button
btn.Initialize("Button")
n = row * ColNumber + col
If n <= MainList.Size - 1 Then
btn.Tag = MainList.Get(n)
btn.Text = MainList.Get(n)
scvMain.Panel.AddView(btn, Space + col * (btnWidth + Space), Space + row * (btnHeight + Space), btnWidth, btnHeight)
End If
Next
Next
scvMain.Panel.Height = Space + row * (btnHeight + Space)
'end of creation of main screen buttons