htmlInputRadioGroup
Radio button group control class
[Previous] [Main] [Next]


Description
htmlInputRadioGroup organizes and manages groups of htmlInputRadio object instantiations, used to create radio button input areas in documents. This class is similar in functionality to the htmlInputCheckBoxGroup class, but without the Check() and IsChecked() methods which don't apply to radio button groups.  
 
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 htmlInputRadioGroup class make such grouping easy. Using it, htmlInputRadio objects can be collected into a single group object, enabling them to share common characteristics, such as name, alignment, and initial state. Individual htmlInputRadio objects are added to the group using the << operator or the Add() method.  
 
Declaration
#include <dcmicro/htmlpp/radiogrp.h>  
 
Hierarchy
htmlinputradiogroup.gif  
 
See Also
htmlForm, htmlInputRadio, htmlInputCheckBoxGroup  
 
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
htmlInputRadioGroup(const String& name,  
      Arrangement arrange = vertical,  
      Alignment align_position = align_right )  
Constructs an empty object using the specified arrangement and alignment settings.  
 
htmlInputRadioGroup( const htmlInputRadioGroup& rhs )  
Copy constructor.  
 
Destructors
virtual ~htmlInputRadioGroup()  
Destroys the object.  
 
Member Methods
=   htmlInputRadioGroup& operator= ( const htmlInputRadioGroup& rhs )  
Replaces group contents with a copy of rhs and returns a reference to the group.  
 
<<   htmlInputRadioGroup& operator<< (  
   const htmlInputRadio& radio_button )  
Adds the radio_button object to the group and returns a reference to the group.  
 
Add   htmlObject FAR * Add( const htmlInputRadio& radio_button )  
Adds the radio_button object to the group and returns a pointer to the new object.  
 
NamehtmlInputRadioGroup& Name( const String& name )  
Sets the name for all radio buttons in the group to name and returns a reference to the group. Subsequent radio button object additions will use name by default.  
 
NameString Name() const  
Returns the name used for all radio button objects in the group as a string.  
 
ArrangehtmlInputRadioGroup& Arrange( Arrangement arrange )  
Sets the arrangement for all radio buttons in the group to arrange and returns a reference to the group. Subsequent radio button object additions will use arrange by default.  
 
ArrangeArrangement Arrange() const  
Returns the Arrangement setting used for all radio button objects in the group as an integer. The default value is vertical.  
 
Align   htmlInputRadioGroup& Align( Alignment align )  
Set the alignment for all radio buttons in the group to align and returns a reference to the group. Subsequent radio button object additions will use align by default.  
 
Align   int Align() const  
Returns the Alignment setting used for all radio button objects in the group. The default value is align_right.  
 
ClonehtmlObject FAR * Clone() const  
Returns a base-class pointer to a deep copy of the object.  
 
Example

See the example in Tutorial:Forms:Radio Buttons  




©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.