line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Test::Form::Widget::Input::Text_Area; |
2
|
14
|
|
|
14
|
|
49
|
use strict; |
|
14
|
|
|
|
|
22
|
|
|
14
|
|
|
|
|
375
|
|
3
|
14
|
|
|
14
|
|
47
|
use warnings; |
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
289
|
|
4
|
|
|
|
|
|
|
################################################################## |
5
|
|
|
|
|
|
|
# $Id: Text_Area.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
|
|
48
|
use Carp; |
|
14
|
|
|
|
|
31
|
|
|
14
|
|
|
|
|
621
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
# This class models a FORM textarea input field. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
|
21
|
14
|
|
|
14
|
|
57
|
use base qw(CGI::Test::Form::Widget::Input); |
|
14
|
|
|
|
|
14
|
|
|
14
|
|
|
|
|
2489
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# |
24
|
|
|
|
|
|
|
# %attr |
25
|
|
|
|
|
|
|
# |
26
|
|
|
|
|
|
|
# Defines which HTML attributes we should look at within the node, and how |
27
|
|
|
|
|
|
|
# to translate that into class attributes. |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my %attr = ('name' => 'name', |
31
|
|
|
|
|
|
|
'value' => 'value', |
32
|
|
|
|
|
|
|
'rows' => 'rows', |
33
|
|
|
|
|
|
|
'cols' => 'columns', |
34
|
|
|
|
|
|
|
'wrap' => 'wrap_mode', |
35
|
|
|
|
|
|
|
'disabled' => 'is_disabled', |
36
|
|
|
|
|
|
|
'readonly' => 'is_read_only', |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# |
40
|
|
|
|
|
|
|
# ->_init |
41
|
|
|
|
|
|
|
# |
42
|
|
|
|
|
|
|
# Per-widget initialization routine. |
43
|
|
|
|
|
|
|
# Parse HTML node to determine our specific parameters. |
44
|
|
|
|
|
|
|
# |
45
|
|
|
|
|
|
|
sub _init |
46
|
|
|
|
|
|
|
{ |
47
|
16
|
|
|
16
|
|
26
|
my $this = shift; |
48
|
16
|
|
|
|
|
25
|
my ($node) = shift; |
49
|
16
|
|
|
|
|
114
|
$this->_parse_attr($node, \%attr); |
50
|
16
|
|
|
|
|
20
|
return; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# |
54
|
|
|
|
|
|
|
# Attribute access |
55
|
|
|
|
|
|
|
# |
56
|
|
|
|
|
|
|
############################################################ |
57
|
|
|
|
|
|
|
sub rows |
58
|
|
|
|
|
|
|
{ |
59
|
0
|
|
|
0
|
1
|
|
my $this = shift; |
60
|
0
|
|
|
|
|
|
return $this->{rows}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
############################################################ |
63
|
|
|
|
|
|
|
sub columns |
64
|
|
|
|
|
|
|
{ |
65
|
0
|
|
|
0
|
1
|
|
my $this = shift; |
66
|
0
|
|
|
|
|
|
return $this->{columns}; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
############################################################ |
69
|
|
|
|
|
|
|
sub wrap_mode |
70
|
|
|
|
|
|
|
{ |
71
|
0
|
|
|
0
|
1
|
|
my $this = shift; |
72
|
0
|
|
|
|
|
|
return $this->{wrap_mode}; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
############################################################ |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub gui_type |
77
|
|
|
|
|
|
|
{ |
78
|
0
|
|
|
0
|
1
|
|
"text area" |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# |
82
|
|
|
|
|
|
|
# Redefined predicates |
83
|
|
|
|
|
|
|
# |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
############################################################ |
86
|
|
|
|
|
|
|
sub is_area |
87
|
|
|
|
|
|
|
{ |
88
|
0
|
|
|
0
|
1
|
|
1 |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
1; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 NAME |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
CGI::Test::Form::Widget::Input::Text_Area - A text area |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 SYNOPSIS |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
# Inherits from CGI::Test::Form::Widget::Input |
100
|
|
|
|
|
|
|
# $form is a CGI::Test::Form |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
my $comments = $form->input_by_name("comments"); |
103
|
|
|
|
|
|
|
$comments->append(<
|
104
|
|
|
|
|
|
|
-- |
105
|
|
|
|
|
|
|
There's more than one way to do it. |
106
|
|
|
|
|
|
|
--Larry Wall |
107
|
|
|
|
|
|
|
EOM |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 DESCRIPTION |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This class models a text area, where users can type text. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 INTERFACE |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
The interface is the same as the one described in |
116
|
|
|
|
|
|
|
L, with the following additional attributes: |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=over 4 |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item C |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Amount of displayed columns. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item C |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Amount of displayed text rows. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item C |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
The selected work wrapping mode. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=back |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 BUGS |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Does not handle C and C yet. There is actually some work |
137
|
|
|
|
|
|
|
done by the browser when the wrapping mode is set to C<"hard">, which alters |
138
|
|
|
|
|
|
|
the value transmitted back to the script upon submit. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 AUTHORS |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
The original author is Raphael Manfredi. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Steven Hilton was long time maintainer of this module. |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Current maintainer is Alexander Tokarev Ftokarev@cpan.orgE>. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head1 SEE ALSO |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
CGI::Test::Form::Widget::Input(3). |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=cut |
153
|
|
|
|
|
|
|
|