Rem @TTFORM BEGIN 1
Rem Layout generated by the form designer (Ctrl+D).
Rem @TTFORM W Form1 560 360 12 Form1_Load Form1_Closed
Rem @TTFORM T 0 "TT BASIC selection controls"
Rem @TTFORM C 3 StatusLabel 16 16 520 24 1 1 0 -
Rem @TTFORM T 1 "Select an item, type in the combo or choose a radio."
Rem @TTFORM C 7 Choices 16 56 200 144 1 1 1 ListChanged
Rem @TTFORM T 2 "One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten|11|12"
Rem @TTFORM C 8 Presets 248 56 280 24 1 1 0 ComboChanged
Rem @TTFORM T 3 "One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten|11|12"
Rem @TTFORM C 6 LocalMode 248 104 200 24 1 1 1 RadioChanged
Rem @TTFORM T 4 "Local"
Rem @TTFORM G 4 1
Rem @TTFORM C 6 MidiMode 248 136 200 24 1 1 0 RadioChanged
Rem @TTFORM T 5 "MIDI"
Rem @TTFORM G 5 1
Rem @TTFORM C 6 DryMode 248 184 200 24 1 1 1 RadioChanged
Rem @TTFORM T 6 "Dry run"
Rem @TTFORM G 6 2
Rem @TTFORM C 6 OutputMode 248 216 200 24 1 1 0 RadioChanged
Rem @TTFORM T 7 "Output"
Rem @TTFORM G 7 2
Rem @TTFORM C 2 MessageButton 248 264 200 24 1 1 0 ShowMessage
Rem @TTFORM T 8 "MessageBox"
Rem @TTFORM C 2 CloseButton 248 304 200 24 1 1 0 CloseForm
Rem @TTFORM T 9 "Close"
Rem @TTFORM C 3 Hint1 16 224 210 24 1 1 0 -
Rem @TTFORM T 10 "Ctrl+click: multiple"
Rem @TTFORM C 3 Hint2 16 256 210 24 1 1 0 -
Rem @TTFORM T 11 "Combo: Ctrl+Space"
Dim Form1 As New Window("", 560, 360)
Form1.Text = "TT BASIC selection controls"
Dim StatusLabel As New Label(Form1, "", 16, 16, 520, 24)
StatusLabel.Text = "Select an item, type in the combo or choose a radio."
Dim Choices As New ListBox(Form1, 16, 56, 200, 144)
Choices.AddItem("One")
Choices.AddItem("Two")
Choices.AddItem("Three")
Choices.AddItem("Four")
Choices.AddItem("Five")
Choices.AddItem("Six")
Choices.AddItem("Seven")
Choices.AddItem("Eight")
Choices.AddItem("Nine")
Choices.AddItem("Ten")
Choices.AddItem("11")
Choices.AddItem("12")
Choices.MultiSelect = True
AddHandler Choices.Change, AddressOf ListChanged
Dim Presets As New ComboBox(Form1, "", 248, 56, 280, 24)
Presets.AddItem("One")
Presets.AddItem("Two")
Presets.AddItem("Three")
Presets.AddItem("Four")
Presets.AddItem("Five")
Presets.AddItem("Six")
Presets.AddItem("Seven")
Presets.AddItem("Eight")
Presets.AddItem("Nine")
Presets.AddItem("Ten")
Presets.AddItem("11")
Presets.AddItem("12")
Presets.ListIndex = 0
AddHandler Presets.Change, AddressOf ComboChanged
Dim LocalMode As New RadioButton(Form1, "", 248, 104, 200, 24)
LocalMode.Text = "Local"
LocalMode.Group = 1
LocalMode.Checked = True
AddHandler LocalMode.Click, AddressOf RadioChanged
Dim MidiMode As New RadioButton(Form1, "", 248, 136, 200, 24)
MidiMode.Text = "MIDI"
MidiMode.Group = 1
AddHandler MidiMode.Click, AddressOf RadioChanged
Dim DryMode As New RadioButton(Form1, "", 248, 184, 200, 24)
DryMode.Text = "Dry run"
DryMode.Group = 2
DryMode.Checked = True
AddHandler DryMode.Click, AddressOf RadioChanged
Dim OutputMode As New RadioButton(Form1, "", 248, 216, 200, 24)
OutputMode.Text = "Output"
OutputMode.Group = 2
AddHandler OutputMode.Click, AddressOf RadioChanged
Dim MessageButton As New Button(Form1, "", 248, 264, 200, 24)
MessageButton.Text = "MessageBox"
AddHandler MessageButton.Click, AddressOf ShowMessage
Dim CloseButton As New Button(Form1, "", 248, 304, 200, 24)
CloseButton.Text = "Close"
AddHandler CloseButton.Click, AddressOf CloseForm
Dim Hint1 As New Label(Form1, "", 16, 224, 210, 24)
Hint1.Text = "Ctrl+click: multiple"
Dim Hint2 As New Label(Form1, "", 16, 256, 210, 24)
Hint2.Text = "Combo: Ctrl+Space"
AddHandler Form1.Load, AddressOf Form1_Load
AddHandler Form1.Closed, AddressOf Form1_Closed
Form1.Show()
Application.Run()
End
Rem @TTFORM END

Sub ListChanged(sender As ListBox)
    StatusLabel.Text = "List: " & Choices.Text
    Print "List "; Choices.ListIndex
    
End Sub

Sub ComboChanged(sender As ComboBox)
    StatusLabel.Text = "Combo: " & Presets.Text
    Print "Combo "; Presets.Text
    
End Sub

Sub RadioChanged(sender As RadioButton)
    Print "Radio: "; CStr(LocalMode.Checked); ","; CStr(MidiMode.Checked); " / "; CStr(DryMode.Checked); ","; CStr(OutputMode.Checked)
    
End Sub

Sub ShowMessage(sender As Button)
    Dim answer As Integer
    answer = MessageBox.Show("Use this sound?", MessageBox.YesNoCancel + MessageBox.Question, "TT BASIC")
    StatusLabel.Text = "Answer: " & CStr(answer)
    Print "Answer "; answer
    
End Sub

Sub CloseForm(sender As Button)
    Form1.Close()
    
End Sub

Sub Form1_Load(sender As Window)
    Print "Controls ready."
    
End Sub

Sub Form1_Closed(sender As Window)
    
End Sub
