Check Boxes in Dialog Boxes


A check box can be used to indicate a yes/no choice or to enable/disable a feature or function. The dialog box should provide two input options for a check box; the first will be the value if the box is not checked, the second input option will be the value if the box is checked.  To indicate the options in the input area of the menu are to be used in a check box control, put a c modifier into the braces of the menu file’s display area.  For example:


// dialog5.pan - checkbox



Generate Noise


Generate Function <r w=20>~gfunc = "< >"~<Grandom><Gnormal>

Remove DC Offset  <c>~nodc=<>~<0><1>



~gfunc = sprintf("%s(100, 1/100)", gfunc)

~if(nodc, setwf(sprintf("demean(%s)", gfunc)), setwf(gfunc))



If the checkbox is selected, the variable nodc is assigned the value 1, causing DEMEAN to be added to the window formula.