Home  /  Autodocs

radiobutton.gadget

create radiobutton BOOPSI objects

FUNCTIONS

AllocRadioButtonNodeA FreeRadioButtonNode GetRadioButtonNodeAttrsA RADIOBUTTON_GetClass SetRadioButtonNodeAttrsA

SUPERCLASS

gadgetclass

REQUIRES

bevel.image, glyph.image

DESCRIPTION

The radiobutton gadget class is used to create a mutually exclusive (MX) selection button group. Selection of an associated option is denoted by the depressed/filled button. Unlike GadTools, GA_Width and GA_Height to not specify the size of a single radio button. Instead it marks the entire domain of the gadget which allows for easier group layout. When used outside of a layout group you must be sure to provide enough space for the gadget to completly render all radio buttons and labels. However, within a layout group such as ReAction's own layout.gadget this is automatic and of no concern to the application programmer.

Advantages that this class provides over the standard gadtools radiobutton (MX_KIND) are:

ATTRIBUTES

GA_ID (WORD)
Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_NOTIFY)

GA_TextAttr (struct TextAttr *)
Used to set the text font to render the radiobutton labels.

Defaults to RPort->Font, which is often the screen or window font.

Applicability is (OM_NEW, OM_SET, OM_UPDATE)

GA_Text (STRPTR *)
A NULL terminated array of strings to use as labels. v45.1.

Defaults to NULL.

Applicability is (OM_NEW, OM_SET, OM_UPDATE)

RADIOBUTTON_Labels (struct List *)
Used to set the text labels for the radiobutton group.

Defaults to NULL.

Applicability is (OM_NEW, OM_SET, OM_UPDATE)

RADIOBUTTON_Spacing (WORD)
Spacing between the radio buttons.

Defaults to 1.

Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_NOTIFY)

RADIOBUTTON_Selected (WORD)
Currently selected radio button number.

Defaults to 0.

Applicability is (OM_NEW, OM_SET, OM_UPDATE)

RADIOBUTTON_LabelPlace (WORD)
Location of radiobutton text labels. Supports:

PLACETEXT_RIGHT

Defaults to PLACETEXT_RIGHT.

Applicability is (OM_NEW, OM_SET, OM_UPDATE)

NOTES

GA_Height and GA_Width DO NOT specify the actual button size, but rather the entire "hit box" area which includes the text label. When being used with layout.gadget it will domain to a proper size to hold the number of buttons and largest text labels. Take care when designing interfaces with out layout to set a proper height and width to hold the radiobutton imagery. This may be done via sending a BOOPSI GM_DOMAIN GDOMAIN_MINIMUM method message to the object with DoGadgetMethod(), or computing a minimum size based on font height and length. In other words, use layout, it's a lot easier! :-)