os_radio_group


A group of radio buttons.

An os_radio_group is a group of os_input_radio elements that all share a common name and marker position. Name and marker position are specified in the constructor and can be modified through the name() and position() member functions.

An os_input_radio element is inserted into the os_radio_group through either the add() member function or operator<< .

os_radio_group allows only one selection within a category. All os_input_radio elements with the same name are part of the same category. Checking one os_input_radio unchecks the previously checked button. If you want to permit multiple choices for a category, use the class os_checkbox_group instead.

If no os_input_radio element within an os_radio_group is specified to be initially checked, the browser will check the first os_input_radio element in the group.

Declaration

#include <ospace/web/radiogrp.h>
class os_radio_group : public os_element

Enums

enum os_radio_group::arrangement
  {
  horizontal,  // Arranges the radio buttons horizontally in a line.
  vertical     // Arranges the radio buttons vertically in a column.
  };
	

Interface

Constructor
os_radio_group( const string& name , arrangement arrange , os_input_radio::marker_position position )
Constructs an empty radio button group with name name , arranged according to arrange (default horizontal ), and with marker position position (default os_input_radio::marker_right ).
Constructor
os_radio_group( const os_radio_group& rhs )
Constructs a radio button group that is a copy of rhs .
Destructor
/* virtual */ ~os_radio_group()
Destroys the radio button group.
<<
os_radio_group& operator<<( const os_input_radio& button )
Inserts a copy of button , setting its name and marker position to those of the radio button group, and returns a reference to the radio button group.
=
os_radio_group& operator=( const os_radio_group& rhs )
Replaces the radio button group contents with a copy of rhs and returns a reference to the radio button group.
add
os_input_radio* add( const os_input_radio& button )
Adds a copy of button , setting its name and marker position to those of the radio button group, and returns a pointer to the new radio button.
arrange
int arrange() const
Returns the arrangement of the radio buttons.
arrange
os_radio_group& arrange( arrangement arrange )
Sets the arrangement of the radio buttons to arrange and returns a reference to the radio button group.
clone
/* virtual */ os_element* clone() const
Returns a base class pointer to a heap-based deep copy of the radio button group.
name
os_radio_group& name( const string& name )
Sets the name of all present and future radio buttons to name and returns a reference to the radio button group.
name
string name() const
Returns the name of the radio buttons.
position
os_radio_group& position( os_input_radio::marker_position position )
Sets the marker position of all present and future radio buttons to position and returns a reference to the radio button group.
position
int position() const
Returns the marker position of the radio buttons.
print
/* virtual */ void print( ostream& os ) const
Prints the radio button group to os .

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved