|
htmlInputCheckBox
Checkbox input control class | [Previous] [Main] [Next] |
| htmlInputCheckBox encapsulates the <INPUT TYPE="CHECKBOX"></INPUT> tags. Checkboxes are toggle switches that a user can select (check) or deselect (uncheck). Checkboxes are arranged in groups using the htmlInputCheckBoxGroup class. Unlike radio buttons, multiple checkboxes in a group can be checked at one time.
| |
|
| |
| If htmlInputCheckBox is used independently of htmlInputCheckBoxGroup, 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/checkbox.h>
| |
|
| |
|
| |
| htmlForm, htmlInputCheckBoxGroup
| |
|
| |
| #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 ;
| |
|
| |
| htmlInputCheckBox()
| |
| Constructs an empty checkbox object.
| |
|
| |
| htmlInputCheckBox( | const String& name,
| |
| const String& value,
| ||
| const htmlObject& label_element,
| ||
| Boolean check_state = STATE_NOT_CHECKED,
| ||
| Alignment label_align = align_right )
| ||
| Constructs a checkbox object, using label_element as the label.
| |
|
| |
| htmlInputCheckBox( | const String& name,
| |
| const String& value,
| ||
| const String& label_text,
| ||
| Boolean check_state = STATE_NOT_CHECKED,
| ||
| Alignment label_align = align_right )
| ||
| Constructs a checkbox object, using label_text as the label.
| |
|
| |
| htmlInputCheckBox( const htmlInputCheckBox& rhs )
| |
| Copy constructor.
| |
|
| |
| virtual ~htmlInputCheckBox()
| |
| Destroys the object.
| |
|
| |
| = | htmlInputCheckBox& operator=( const htmlInputCheckBox& rhs )
| |
| Replaces the contents with rhs and returns a pointer to the object.
| |
|
| |
| Name | htmlInputCheckBox& Name(const String& name )
| |
| Set the control name to name, and returns a reference to the object. Checkbox controls in a group must all share the same name.
| |
|
| |
| Name | String Name() const
| |
| Returns the control name as a string.
| |
|
| |
| Value | htmlInputCheckBox& 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 | htmlInputCheckBox& 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.
| |
|
| |
| IsChecked | Boolean IsChecked() const
| |
| Returns TRUE if the state of the control is checked, FALSE if unchecked.
| |
|
| |
| Label | htmlInputCheckBox& Label( const htmlObject& element )
| |
| Sets (replaces) the label for the control to element, and returns a reference to the object.
| |
|
| |
| Label | htmlInputCheckBox& 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 object.
| |
|
| |
| Label | htmlContainer& Label()
| |
| Returns a reference to the label object for the checkbox.
| |
|
| |
| Align | htmlInputCheckBox& 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 checkbox to arrange and returns a reference to the checkbox. Unless this method is explicitly called, the default setting is vertical arrangement. Usually, applications use htmlInputCheckBoxGroup::Arrange() to control arrangement of all checkboxes in a group at one time.
| |
|
| |
| Arrange | Arrangement Arrange() const
| |
| Returns the arrangement setting used for the checkbox 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:Checkboxes
| |
