line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Test::Form::Widget::Button::Reset; |
2
|
14
|
|
|
14
|
|
82
|
use strict; |
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
386
|
|
3
|
14
|
|
|
14
|
|
58
|
use warnings; |
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
308
|
|
4
|
|
|
|
|
|
|
################################################################## |
5
|
|
|
|
|
|
|
# $Id: Reset.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
|
14
|
|
|
14
|
|
51
|
use Carp; |
|
14
|
|
|
|
|
17
|
|
|
14
|
|
|
|
|
677
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
# This class models a FORM reset button. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
|
21
|
14
|
|
|
14
|
|
52
|
use base qw(CGI::Test::Form::Widget::Button); |
|
14
|
|
|
|
|
14
|
|
|
14
|
|
|
|
|
1645
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# |
24
|
|
|
|
|
|
|
# Attribute access |
25
|
|
|
|
|
|
|
# |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub gui_type |
28
|
|
|
|
|
|
|
{ |
29
|
0
|
|
|
0
|
1
|
|
return "reset button"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# |
33
|
|
|
|
|
|
|
# ->press |
34
|
|
|
|
|
|
|
# |
35
|
|
|
|
|
|
|
# Press button. |
36
|
|
|
|
|
|
|
# Has immediate effect: all widgets are reset to their initial state. |
37
|
|
|
|
|
|
|
# |
38
|
|
|
|
|
|
|
# Returns undef. |
39
|
|
|
|
|
|
|
# |
40
|
|
|
|
|
|
|
sub press |
41
|
|
|
|
|
|
|
{ |
42
|
0
|
|
|
0
|
1
|
|
my $this = shift; |
43
|
0
|
|
|
|
|
|
$this->form->reset(); |
44
|
0
|
|
|
|
|
|
return undef; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# |
48
|
|
|
|
|
|
|
# Global widget predicates |
49
|
|
|
|
|
|
|
# |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub is_read_only |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
0
|
1
|
|
return 1; |
54
|
|
|
|
|
|
|
} # Handled internally by client |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# |
57
|
|
|
|
|
|
|
# Button predicates |
58
|
|
|
|
|
|
|
# |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub is_reset |
61
|
|
|
|
|
|
|
{ |
62
|
0
|
|
|
0
|
1
|
|
return 1; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 NAME |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
CGI::Test::Form::Widget::Button::Reset - A reset button |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SYNOPSIS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Inherits from CGI::Test::Form::Widget::Button |
74
|
|
|
|
|
|
|
# $form is a CGI::Test::Form |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
my @reset = $form->buttons_matching(sub { $_[0]->is_reset }); |
77
|
|
|
|
|
|
|
$reset[0]->press if @reset; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 DESCRIPTION |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This class models a reset button. Pressing this buttom immediately |
82
|
|
|
|
|
|
|
resets the form to its original state. The processing is done on the |
83
|
|
|
|
|
|
|
client-side, and no request is made to the HTTP server. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
The interface is the same as the one described in |
86
|
|
|
|
|
|
|
L. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHORS |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
The original author is Raphael Manfredi. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Steven Hilton was long time maintainer of this module. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Current maintainer is Alexander Tokarev Ftokarev@cpan.orgE>. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 SEE ALSO |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
CGI::Test::Form::Widget::Button(3). |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |
101
|
|
|
|
|
|
|
|