htmlInputCheckBoxGroup
Checkbox group control class
[Previous] [Main] [Next]


Description
htmlInputCheckBoxGroup organizes and manages groups of htmlInputCheckBox object instantiations, used to create checkbox input areas in documents. This class is similar in functionality to the htmlInputRadioGroup class.  
 
HTML doesn't provide a mechanism for grouping input controls. Instead controls that are to be logically grouped must be output separately and coded with common attributes, such as the NAME tag.  
 
The htmlInputCheckBoxGroup class allows multiple htmlInputCheckBox objects to be collected into a single group object, enabling them to share common characteristics, such as name, alignment, and initial state. Individual htmlInputCheckBox objects are added to the group using the << operator or the Add() method.  
 
Declaration
#include <dcmicro/htmlpp/checkgrp.h>  
 
Hierarchy
htmlinputcheckboxgroup.gif  
 
See Also
htmlForm, htmlInputCheckBox, htmlInputRadioGroup  
 
Related Constants/Definitions
#define STATE_CHECKED      TRUE  
#define STATE_NOT_CHECKED      FALSE  
 
typedef enum {  
   align_default = 0,  
   align_left,  
   align_center,  
   align_right,  
   align_justify  
} Alignment ;  
 
typedef enum {  
   horizontal,  
   vertical  
} Arrangement ;  
 
Constructors
htmlInputCheckBoxGroup( const String& name,  
       Arrangement arrange = vertical,  
       Alignment align_position = align_right )  
Constructs an empty group using the specified name, arrangement and alignment settings.  
 
htmlInputCheckBoxGroup( const htmlCheckBoxGroup& rhs )  
Copy Constructor.  
 
Destructors
virtual ~htmlInputCheckBoxGroup()  
Destroys the object.  
 
Member Methods
=   htmlInputCheckBoxGroup& operator= (  
   const htmlInputCheckBox& rhs )  
Replaces group contents with a copy of rhs and returns a reference to the group.  
 
<<   htmlInputCheckBoxGroup& operator<< (  
   const htmlInputCheckBox& checkbox )  
Adds the checkbox object to the group and returns a reference to the group.  
 
Add   htmlObject FAR * Add( const htmlInputCheckBox& checkbox )  
Adds checkbox to the group and returns a pointer to the new object.  
 
NamehtmlInputCheckBoxGroup& Name( const String& name )  
Sets the name for all checkboxes in the group to name and returns a reference to the group. Subsequent checkbox object additions will use name by default.  
 
NameString Name() const  
Returns the name used for all checkbox objects in the group as a string.  
 
ArrangehtmlInputCheckBoxGroup& Arrange( Arrangement arrange )  
Sets the arrangement for all checkboxes in the group to arrange and returns a reference to the group. Subsequent checkbox object additions will use arrange by default.  
 
ArrangeArrangement Arrange() const  
Returns the Arrangement setting used for all checkbox objects in the group as an integer. The default value is vertical.  
 
Align   htmlInputCheckBoxGroup& Align( Alignment align )  
Set the alignment for all checkboxes in the group to align and returns a reference to the group. Subsequent checkbox object additions will use align by default.  
 
Align   int Align() const  
Returns the Alignment setting used for all checkbox objects in the group. The default value is align_right.  
 
CheckhtmlInputCheckBoxGroup& Check( Boolean initial_check_state = STATE_CHECKED )  
Sets the check state (TRUE or FALSE, STATE_CHECKED, or STATE_NOT_CHECKED) for all checkboxes in the group to initial_check_state and returns a reference to the group. Subsequent checkbox object additions will not use initial_check_state by default.  
 
IsCheckedBoolean IsChecked() const  
Returns the initial check state for all checkboxes in the group (TRUE or FALSE).  
 
ClonehtmlObject FAR * Clone() const  
Returns a base-class pointer to a deep copy of the object.  
 
Example
 
See the example in Tutorial:Forms:Checkboxes  
 



©1998 DC Micro Development. All rights reserved.
No portion of this document may be c opied or reproduced without expressed written consent.
html++ is a trademark of DC Micro Development.