FutureBasic Logo

<<    Index    >> FutureBasic

radiogroup   statement / function



Syntax
radiogroup tag, enabled, index, titles, rows, columns, size, spacing, origin, wndTag

Function syntax
index = radiogroup(tag)

Description
The radiogroup statement puts a new radiogroup in the current output window, or alters an existing radiogroup's characteristics. The radiogroup function returns the index of the currently selected radio button and is equivalent to calling fn RadioGroupIndex.

Parameters
Parameter
Description
tag A number (1 through 1000000) that you assign when you create the radiogroup and that you refer to when altering or closing the radiogroup. The number you assign must be different from the tag value of all other existing widgets in the current window. A negative tag hides the radiogroup.
enabled A boolean value which specifies whether all the buttons in the group should be enabled or disabled. Individual radio buttons can be enabled/disabled with the ancillary function: RadioGroupButtonSetEnabled.
index A integer value (1 - n) that specifies which radio button should be selected. Default = 1.
titles A semicolon-delimited list or array of button titles. A dash('-') inserts a hidden radio button.
rows The maximum number of rows in the radiogroup. Default = 1.
columns The maximum number of columns in the radiogroup. Default = 1.
size Sets the size of the radiobuttons.
NSControlSizeRegular (default)
NSControlSizeSmall
NSControlSizeMini
NSControlSizeLarge

spacing The horizontal and vertical space between each radio button. This can be specified in either of two ways:
(i) (horiz,vert)
(ii) A CGSize value

Default = (0,0)
origin The x,y location of the radiogroup in the window. This can be specified in either of two ways:
(i) (x,y)
(ii) A CGPoint value
wndTag An optional parameter for when the radiogroup's window is not the current output window. Note specifying this parameter does not bring the window to the front or make it the output window.
 

Example

_window = 1
begin enum 1
_radioGroup1
_radioGroup2
end enum

void local fn BuildWindow
window _window, @"RadioGroup", (25,700,386,220)
radiogroup _radioGroup1,,, @"Radio 101;Radio 102;Radio 103;Radio 104;Radio 105", 5,,, (0,4), (18,95) // 5 rows, 1 column, 4 pixel vertical spacing
radiogroup _radioGroup2,, 2, @"Radio 201;Radio 202;Radio 203",, 3,, (42,0), (18,19) // 1 row, 3 columns, 42 pixel horizontal spacing
end fn

void local fn DoDialog( ev as long, tag as long, wnd as long )
select ( ev )
case _btnClick : cls : print %(200,50)@"group: "tag@" btn: "radiogroup(tag)
end select
end fn

fn BuildWindow

on dialog fn DoDialog

HandleEvents

 
Ancillary functions
See the Button.incl header.

 
Dialog event
_btnClick

See also
radiobutton