|
htmlInputRadio
Radio input control class | [Previous] [Main] [Next] |
| htmlInputRadio encapsulates the <INPUT TYPE="RADIO"></INPUT> tags. Radio buttons are arranged as a group using the htmlInputRadioGroup class. Only one button in the set can be selected (checked) at one time. When the user selects a button in the set, all the other buttons are deselected. You can preselect a button using the Check() method.
| |
|
| |
| If htmlInputRadio is used independently of htmlInputRadioGroup, you must specify a name for the control to identify it on a form. Otherwise, you can leave the name argument of the constructor as an empty ("") string and the object will assume the name of the group to which it belongs.
| |
|
| |
| #include <dcmicro/htmlpp/radio.h>
| |
|
| |
|
| |
| htmlForm, htmlInputRadioGroup
| |
|
| |
| #define STATE_CHECKED TRUE
| |
| #define STATE_NOT_CHECKED FALSE
| |
|
| |
| typedef enum {
| |
| align_default = 0,
| |
| align_left,
| |
| align_center,
| |
| align_right,
| |
| align_justify
| |
| } Alignment ;
| |
|
| |
| htmlInputRadio()
| |
| Constructs an empty radio control object.
| |
|
| |
| htmlInputRadio( const String& name,
| ||
| const String& value,
| ||
| const htmlObject& label_element,
| ||
| Boolean check_state = STATE_NOT_CHECKED,
| ||
| Alignment label_align = align_right )
| ||
| Constructs a radio control object of the specified name and value, using label_element as the label, and setting the initial check_state and alignment..
| |
|
| |
| htmlInputRadio( const String& name,
| ||
| const String& value,
| ||
| const String& label_text,
| ||
| Boolean check_state = STATE_NOT_CHECKED,
| ||
| Alignment label_align = align_right )
| ||
| Constructs a radio control object of the specified name and value, using label_text as the label, and setting the initial check_state and alignment..
| |
|
| |
| htmlInputRadio( const htmlInputRadio& rhs )
| |
| Copy constructor.
| |
|
| |
| virtual ~htmlInputRadio()
| |
| Destroys the object.
| |
|
| |
| = | htmlInputRadio& operator=( const htmlInputRadio& rhs )
| |
| Replaces the contents with rhs and returns a pointer to the object.
| |
|
| |
| Name | htmlInputRadio& Name(const String& name )
| |
| Set the control name to name, and returns a reference to the object. Radio controls in a group must all share the same name.
| |
|
| |
| Name | String Name() const
| |
| Returns the control name as a string.
| |
|
| |
| Value | htmlInputRadio& Value(const String& value )
| |
| Set the display value of the control to value, and returns a reference to the object.
| |
|
| |
| Value | String Value() const
| |
| Returns the control value as a string.
| |
|
| |
| Check | htmlInputRadio& Check( Boolean check_state = STATE_CHECKED )
| |
| Sets the check state of the control, and returns a reference to the object. If check_state is TRUE, the control appears checked. For a group of radio controls, only one control at a time may be checked.
| |
|
| |
| IsChecked | Boolean IsChecked() const
| |
| Returns TRUE if the state of the control is checked, FALSE if unchecked.
| |
|
| |
| Label | htmlInputRadio& Label( const htmlObject& element )
| |
| Sets (replaces) the label for the control to element, and returns a reference to the object.
| |
|
| |
| Label | htmlInputRadio& Label( const String& text )
| |
| Sets (replaces) the label for the control to text, internally converting text to an htmlText object, and returns a reference to the control object.
| |
|
| |
| Label | htmlContainer& Label()
| |
| Returns a reference to the label object for the radio control.
| |
|
| |
| Align | htmlInputRadio& Align( Alignment align )
| |
| Sets the label alignment to align and returns a reference to the object.
| |
|
| |
| Align | int Align() const
| |
| Returns the label alignment for the control, or align_default if not set.
| |
|
| |
| Arrange | htmlInputRadio& Arrange( Arrangement arrange )
| |
| Sets the arrangement for the radio button to arrange and returns a reference to the button. Unless this method is explicitly called, the default setting is vertical arrangement. Usually, applications use htmlInputRadioGroup::Arrange() to control arrangement of all buttons in a group at one time.
| |
|
| |
| Arrange | Arrangement Arrange() const
| |
| Returns the arrangement setting used for the button object.
| |
|
| |
| void Print( ostream& os ) const
| ||
| Outputs the object to os.
| |
|
| |
| Clone | htmlObject FAR * Clone() const
| |
| Returns a base-class pointer to a deep copy of the object.
| |
|
| |
|
| |
| See the example in Tutorial:Forms:Radio Buttons
| |
|
| |
