| 1 | package CGI::Test::Form::Widget::Box::Check; | ||
| 2 | 14 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 14 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | ################################################################## | ||
| 5 | # $Id: Check.pm 411 2011-09-26 11:19:30Z nohuhu@nohuhu.org $ | ||
| 6 | # $Name: cgi-test_0-104_t1 $ | ||
| 7 | ################################################################## | ||
| 8 | # | ||
| 9 | # Copyright (c) 2001, Raphael Manfredi | ||
| 10 | # | ||
| 11 | # You may redistribute only under the terms of the Artistic License, | ||
| 12 | # as specified in the README file that comes with the distribution. | ||
| 13 | # | ||
| 14 | |||
| 15 | # | ||
| 16 | # This class models a FORM checkbox button. | ||
| 17 | # | ||
| 18 | |||
| 19 | 14 | ▶ | use base qw(CGI::Test::Form::Widget::Box); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | # | ||
| 22 | # Attribute access | ||
| 23 | # | ||
| 24 | |||
| 25 | sub gui_type | ||
| 26 | 0 | ▶ | { |
|
Subroutine
gui_type: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 27 | 0 | return "checkbox"; | |
| 28 | } | ||
| 29 | |||
| 30 | # | ||
| 31 | # Defined predicates | ||
| 32 | # | ||
| 33 | |||
| 34 | sub is_radio | ||
| 35 | 16 | ▶ | { |
|
Subroutine
is_radio: called CC=1 SCAR=0.0
Pod
documented
| |||
| 36 | 16 | return 0; | |
| 37 | } | ||
| 38 | |||
| 39 | 14 | 1; | |
| 40 | |||
| 41 | =head1 NAME | ||
| 42 | |||
| 43 | CGI::Test::Form::Widget::Box::Check - A checkbox widget | ||
| 44 | |||
| 45 | =head1 SYNOPSIS | ||
| 46 | |||
| 47 | # Inherits from CGI::Test::Form::Widget::Box | ||
| 48 | # $form is a CGI::Test::Form | ||
| 49 | |||
| 50 | my ($agree, $ads) = $form->checkbox_by_name(qw(i_agree ads)); | ||
| 51 | |||
| 52 | die "expected a standalone checkbox" unless $agree->is_standalone; | ||
| 53 | $agree->check; | ||
| 54 | $ads->uncheck_tagged("spam OK"); | ||
| 55 | |||
| 56 | =head1 DESCRIPTION | ||
| 57 | |||
| 58 | This class represents a checkbox widget, which may be checked or unchecked | ||
| 59 | at will by users. | ||
| 60 | |||
| 61 | The interface is the same as the one described | ||
| 62 | in L<CGI::Test::Form::Widget::Box>. | ||
| 63 | |||
| 64 | =head1 AUTHORS | ||
| 65 | |||
| 66 | The original author is Raphael Manfredi. | ||
| 67 | |||
| 68 | Steven Hilton was long time maintainer of this module. | ||
| 69 | |||
| 70 | Current maintainer is Alexander Tokarev F<E<lt>tokarev@cpan.orgE<gt>>. | ||
| 71 | |||
| 72 | =head1 SEE ALSO | ||
| 73 | |||
| 74 | CGI::Test::Form::Widget::Box(3), CGI::Test::Form::Widget::Box::Radio(3). | ||
| 75 | |||
| 76 | =cut | ||
| 77 | |||