BB___RADIOBUTTON

=RADIOBUTTON= toc

Description
> A RADIOBUTTON is a //control// on a Graphical User Interface (GUI) window that represents an option a user may select. Generally, only one radiobutton on a window may be selected at one time. //(See below for exception)//. >> See, also, CHECKBOX.

Radiobutton Features

 * //**Setting & Resetting.**// Radiobuttons are set either by mouse-clicking the button, or programmatically by using the **"set"** command. Only one radiobutton on a window may be set at any one time. (An exception is Grouped Radiobuttons, as follows.) If a radiobutton is set, all other radiobuttons on the window will be automatically reset, or cleared. The command **"reset"** can also be used to clear a radiobutton.
 * //**Changing Label.**// A radiobutton "label" cannot be changed after the window is opened.
 * //**Grouping Radiobuttons.**// Sets of radiobuttons can be surrounded with a GROUPBOX and made to act as a logical unit apart from any other radiobuttons (or sets of radiobuttons) on a window. This allows your program to have more than one set of radiobuttons (options) from which your user may select. Keep in mind we are talking about //exclusive// options with radiobuttons; Selecting one button from a set un-selects all other buttons within a groupbox.

Radiobutton Commands
The following commands (Methods) can be used with radiobuttons. See the individual pages for discussion. print #handle.ext, "disable" print #handle.ext, "enable" print #handle.ext, "font facename pointSize" print #handle.ext, "setfocus" print #handle.ext, "set" print #handle.ext, "reset" print #handle.ext, "value? status$"

Example
code format="lb" nomainwin

radiobutton #1.rball "Include all options", [set], [reset], 10, 150, 150, 20 radiobutton #1.rbnone "Do NOT include options", [nset], [reset], 10, 170, 150, 20

groupbox #1.gb2 "Options", 50, 10, 120, 130 statictext #1.ck1 "Lettuce", 70, 30, 100, 20 statictext #1.ck2 "Pickles", 70, 50, 100, 20 statictext #1.ck3 "Onions", 70, 70, 100, 20 statictext #1.ck4 "Cheese", 70, 90, 100, 20 statictext #1.ck5 "Tomatoes", 70, 110, 100, 20

button #1.btn1 "Place order", [quit], UL, 50, 200, 120, 25

open "Select Options" for window as #1 #1 "trapclose [quit]"

[set] #1.rball "set"  'First radiobutton is set when window opens wait

[nset] #1.rbnone "set" 'Clicking second radiobutton clears first and sets second wait

[reset]             'No action is needed with reset handler wait

[quit] close #1 end code

Useful Functions
code format="lb" Place a useful function using this command here code