.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CGI::Test::Form::Widget::Box 3pm" .TH CGI::Test::Form::Widget::Box 3pm "2022-06-10" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CGI::Test::Form::Widget::Box \- Abstract representation of a tickable box .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # Inherits from CGI::Test::Form::Widget .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class is the abstract representation of a tickable box, i.e. a radio button or a checkbox. .PP To simulate user checking or un-checking on a box, use the \f(CW\*(C`check()\*(C'\fR and \f(CW\*(C`uncheck()\*(C'\fR routines, as described below. .SH "INTERFACE" .IX Header "INTERFACE" The interface is the same as the one described in CGI::Test::Form::Widget, with the following additions: .SS "Attributes" .IX Subsection "Attributes" .ie n .IP """group""" 4 .el .IP "\f(CWgroup\fR" 4 .IX Item "group" The \f(CW\*(C`CGI::Test::Form::Group\*(C'\fR object which holds all the groups of the same widget type. .ie n .IP """group_list""" 4 .el .IP "\f(CWgroup_list\fR" 4 .IX Item "group_list" The list of widgets belonging to the same group as we do. .ie n .IP """is_checked""" 4 .el .IP "\f(CWis_checked\fR" 4 .IX Item "is_checked" True when the box is checked, i.e. marked with a tick. .SS "Attribute Setting" .IX Subsection "Attribute Setting" .ie n .IP """check""" 4 .el .IP "\f(CWcheck\fR" 4 .IX Item "check" Check the box, by ticking it. .ie n .IP """check_tagged"" \fItag\fR" 4 .el .IP "\f(CWcheck_tagged\fR \fItag\fR" 4 .IX Item "check_tagged tag" This may be called on any box, and it will locate the box whose value attribute is \fItag\fR within the \f(CW\*(C`group_list\*(C'\fR, and then check it. .Sp If the specified \fItag\fR is not found, the caller will get a warning via \f(CW\*(C`carp\*(C'\fR. .ie n .IP """uncheck""" 4 .el .IP "\f(CWuncheck\fR" 4 .IX Item "uncheck" Uncheck the box, by removing its ticking mark. It is not possible to do this on a radio button: you must \fIcheck\fR another radio button of the same group instead. .ie n .IP """uncheck_tagged"" \fItag\fR" 4 .el .IP "\f(CWuncheck_tagged\fR \fItag\fR" 4 .IX Item "uncheck_tagged tag" This may be called on any box, and it will locate the box whose value attribute is \fItag\fR within the \f(CW\*(C`group_list\*(C'\fR, and then remove its ticking mark. It is not possible to do this on a radio button, as explained in \f(CW\*(C`uncheck\*(C'\fR above. .Sp If the specified \fItag\fR is not found, the caller will get a warning via \f(CW\*(C`carp\*(C'\fR. .SS "Widget Classification Predicates" .IX Subsection "Widget Classification Predicates" There is an additional predicate to distinguish between a checkbox and a radio button: .ie n .IP """is_radio""" 4 .el .IP "\f(CWis_radio\fR" 4 .IX Item "is_radio" Returns \fItrue\fR for a radio button. .ie n .IP """is_standalone""" 4 .el .IP "\f(CWis_standalone\fR" 4 .IX Item "is_standalone" Returns \fItrue\fR if the box is the sole member of its group. .Sp Normally only useful for checkboxes: a standalone radio button, although perfectly legal, would always remain in the checked state, and therefore not be especially interesting... .SS "Miscellaneous Features" .IX Subsection "Miscellaneous Features" Although documented, those features are more targetted for internal use... .ie n .IP """set_is_checked"" \fIflag\fR" 4 .el .IP "\f(CWset_is_checked\fR \fIflag\fR" 4 .IX Item "set_is_checked flag" Change the checked status. Radio buttons can only be checked, i.e. the \&\fIflag\fR must be true: all other radio buttons in the same group are immediately unchecked. .Sp You should use the \f(CW\*(C`check\*(C'\fR and \f(CW\*(C`uncheck\*(C'\fR convenience routines instead of calling this feature. .SH "AUTHORS" .IX Header "AUTHORS" The original author is Raphael Manfredi. .PP Steven Hilton was long time maintainer of this module. .PP Current maintainer is Alexander Tokarev \fI\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBCGI::Test::Form::Widget\fR\|(3), \&\fBCGI::Test::Form::Widget::Box::Radio\fR\|(3), \&\fBCGI::Test::Form::Widget::Box::Check\fR\|(3).