Control RadioGroup clause - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Part of a Dialog statement; adds a list of radio buttons to the dialog box.

Syntax

Control RadioGroup 
	[ Position x, y ] 
	[ ID control_ID ] 
	[ Calling handler ] 
	[ Title { str_expr | From Variable str_array_var } ] 
	[ Value i_selected ] 
	[ Into i_variable ] 
	[ Disable ] [ Hide ] 

x, y specifies the control's position in dialog box units.

control_ID is an integer; cannot be the same as the ID of another control in the dialog box.

handler is the name of a procedure to call if the user clicks or double-clicks on any of the radio buttons.

str_expr is a string expression, containing a semicolon-delimited list of items to appear in the control.

str_array_var is the name of an array of string variables.

i_selected is a SmallInt value indicating which item should appear selected when the dialog box first appears: a value of one selects the first item; if the clause is omitted, the first item appears selected.

i_variable is the name of a SmallInt variable which stores the user's final selection (one, if the first item selected, etc.).

The Disable keyword makes the control disabled (grayed out) initially.

The Hide keyword makes the control hidden initially.

Description

If a Dialog statement includes a Control RadioGroup clause, the dialog box includes a group of radio buttons. Each radio button is a label to the right of a hollow or filled circle. The currently-selected item is indicated by a filled circle. Only one of the radio buttons may be selected at one time.

The Title clause specifies the list of labels that appear in the dialog box. If the Title clause specifies a string expression containing a semicolon-delimited list of items, each item appears as one item in the list.

The following sample Title clause demonstrates this syntax:

Title "&Full Details;&Partial Details"

Alternately, the Title clause can specify an array of string variables, in which case each entry in the array appears as one item in the list. The following sample Title clause demonstrates this syntax:

Title From Variable s_optionlist

Example

Control RadioGroup 
	Title "&Full Details;&Partial Details" 
	Value 2
	ID 2 
	Into i_details
	Calling rg_handler 
	Position 15, 42 

See Also:

Alter Control statement, Dialog statement, ReadControlValue() function