How to get radio buttons on a dialog

There is no dialog.addRadioButtonContol(…) function so how do you do it?

static void Job1(Args _args)
    Dialog                dialog;
    FormRadioControl      formRadioControl;
    FormBuildRadioControl formBuildRadioControl;
    FormBuildGroupControl formBuildGroupControl;
    int                   formBuildRadioControlId;
    //Build dialog with radio buttons
    dialog = new Dialog("Test Dialog");
    formBuildGroupControl = dialog.mainFormGroup();
    formBuildRadioControl = formBuildGroupControl.addControl(FormControlType::RadioButton,'radiobuttons');
    formBuildRadioControlId =;
    //set number of buttons
    //add descriptions
    formBuildRadioControl.text("Radiobutton 1");
    formBuildRadioControl.text("Radiobutton 2");
    formBuildRadioControl.text("Radiobutton 3");
            //get control
            formRadioControl = dialog.formRun().control(formBuildRadioControlId);
            //get index
            info(strfmt("Radiobutton %1 selected",formRadioControl.selection()+1));

2 thoughts on “How to get radio buttons on a dialog

    • I’m not aware this is possible.
      Workaround: make two controls – one with the enabled buttons, the other with the disabled ones – and then enable the first entire control while disabling the second one.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s