Example
|
This example creates a dialog box with two panels. The DlgVisible statement is used to show or hide the controls of the different panels.
Sub EnableGroup(start%,finish%)
????For i = 6 To 13??????????????????????????????'Disable all options.
????????DlgVisible i,False
????Next i
????For i = start% To finish%??????????'Enable only the right ones.
????????DlgVisible i,True
????Next i
End Sub
Function DlgProc(ControlName$,Action%,SuppValue%)
????If Action% = 1 Then
????????DlgValue "WhichOptions",0??????'Set to save options.
????????EnableGroup 6,8????????????????????'Enable the save options.
????End If
????If Action% = 2 And ControlName$ = "SaveOptions" Then
????????EnableGroup 6,8????????????????????'Enable the save options.
????????DlgProc = 1????????????????????????'Don't close the dialog box.
????End If
????If Action% = 2 And ControlName$ = "EditingOptions" Then
????????EnableGroup 9,13??????????????????'Enable the editing options.
????????DlgProc = 1????????????????????????'Don't close the dialog box.
????End If
End Function
Sub Main()
????Begin Dialog OptionsTemplate 33,33,171,134,"Options",.DlgProc
????????'Background (controls 0-5)
????????GroupBox 8,40,152,84,""
????????OptionGroup .WhichOptions
????????????OptionButton 8,8,59,8,"Save Options",.SaveOptions
????????????OptionButton 8,20,65,8,"Editing Options",.EditingOptions
????????OKButton 116,7,44,14
????????CancelButton 116,24,44,14
??
????????'Save options (controls 6-8)
????????CheckBox 20,56,88,8,"Always create backup",.CheckBox1
????????CheckBox 20,68,65,8,"Automatic save",.CheckBox2
????????CheckBox 20,80,70,8,"Allow overwriting",.CheckBox3
??
????????'Editing options (controls 9-13)
????????CheckBox 20,56,65,8,"Overtype mode",.OvertypeMode
????????CheckBox 20,68,69,8,"Uppercase only",.UppercaseOnly
????????CheckBox 20,80,105,8,"Automatically check syntax",.AutoCheckSyntax
????????CheckBox 20,92,73,8,"Full line selection",.FullLineSelection
????????CheckBox 20,104,102,8,"Typing replaces selection",.TypingReplacesText
????End Dialog
??
????Dim OptionsDialog As OptionsTemplate
????Dialog OptionsDialog
End Sub
|