os_checkbox_group
|
 |
A group of checkboxes associated
with the same name.
An os_checkbox_group
is a group of os_input_checkbox 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_checkbox
element is inserted into the os_checkbox_group
through either the add() member function or operator<<
.
By default, os_input_checkbox
elements in the os_checkbox_group are arranged
horizontally in a line. They can be arranged vertically in a column through
either the constructor or the arrange() member
function.
os_checkbox_group
allows multiple selections within a category. All os_checkbox_group
elements with the same name are part of the same category. If you want to
restrict the category to a single choice, use the class os_radio_group
instead.
Declaration
#include <ospace/web/checkgrp.h>
class os_checkbox_group : public os_element
Enums
enum os_checkbox_group::arrangement
{
horizontal, // Arranges the checkboxes horizontally in a line.
vertical // Arranges the checkboxes vertically in a column.
};
Interface
Constructor
os_checkbox_group(
const string& name ,
arrangement arrange ,
os_input_checkbox::marker_position position
)
Constructs a checkbox group
with name name , arranged according to arrange
(default horizontal ), and with marker
position position (default os_input_checkbox::marker_right
).
Constructor
os_checkbox_group(
const os_checkbox_group& rhs )
Constructs a checkbox group
that is a copy of rhs .
Destructor
/*
virtual */ ~os_checkbox_group()
Destroys the checkbox
group.
<<
os_checkbox_group&
operator<<( const os_input_checkbox& checkbox
)
Inserts a copy of checkbox
, setting its name and marker position to those of the checkbox group, and
returns a reference to the checkbox group.
=
os_checkbox_group&
operator=( const os_checkbox_group&
rhs )
Replaces the checkbox group
contents with a copy of rhs , and returns a
reference to the checkbox group.
add
os_input_checkbox*
add( const os_input_checkbox& checkbox )
Adds a copy of checkbox
, setting its name and marker position to those of the checkbox group, and
returns a pointer to the new checkbox.
arrange
int
arrange() const
Returns the arrangement of
the checkboxes.
arrange
os_checkbox_group&
arrange( arrangement arrange )
Sets the arrangement of the
checkboxes to arrange and returns a reference to
the checkbox group.
check
os_checkbox_group&
check( os_input_checkbox::check_type check )
Sets the check type of all
checkboxes in the checkbox group to check ,
and returns a reference to the checkbox group.
check
int
check() const
Returns the check type of
the first checkbox, or os_element::use_default
if the checkbox group is empty.
clone
/*
virtual */ os_element* clone() const
Returns a base class
pointer to a heap-based deep copy of the checkbox group.
name
os_checkbox_group&
name( const string& name )
Sets the name of all
present and future checkboxes to name and returns
a reference to the checkbox group.
name
string
name() const
Returns the name of the
checkboxes.
position
os_checkbox_group&
position( os_input_checkbox::marker_position position
)
Sets the marker position of
all present and future checkboxes to position and
returns a reference to the checkbox group.
position
int
position() const
Returns the marker position
of the checkboxes.
print
/*
virtual */ void print( ostream& os )
const
Prints the checkbox group
to os .
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved