Sub Globals
Dim Keys As Panel
Dim Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9, Key10, Key11, Key12 As Button
Dim Key(12) As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("PanelButtons")
Key = Array As Button(Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9, Key10, Key11, Key12)
End Sub
Sub ResizePanel(Width As Int, Height As Int)
Dim x0, dx, y0, dy As Float
Dim h, v, j As Int
Keys.Width = Width
Keys.Height = Height
x0 = (Keys.Width - 3 * Key1.Width) / 4
dx = x0 + Key1.Width
y0 = (Keys.Height- 4 * Key1.Height) / 5
dy = y0 + Key1.Height
For v = 0 To 3
For h = 0 To 2
j = v * 3 + h
Key(j).Left = x0 + h * dx
Key(j).Top = y0 + v * dy
Next
Next
End Sub