« blib/lib/PDF/Make/Builder/Layout/Row.pm
↑ Summary
blib/lib/PDF/Make/Builder/Page/HeaderFooterContext.pm »
| 1 | package PDF::Make::Builder::Form::Field::Button; | ||||||||||||||||||||||||||||||||||||||||
| 2 | 53 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 3 | 53 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 4 | 53 | ▶ | use Object::Proto; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||
| 6 | 53 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 7 | 53 | Object::Proto::define('PDF::Make::Builder::Form::Field::Button', | |||||||||||||||||||||||||||||||||||||||
| 8 | extends => 'PDF::Make::Builder::Form::Field', | ||||||||||||||||||||||||||||||||||||||||
| 9 | 'caption:Str', | ||||||||||||||||||||||||||||||||||||||||
| 10 | 'submit_url:Str', | ||||||||||||||||||||||||||||||||||||||||
| 11 | 'url:Str', | ||||||||||||||||||||||||||||||||||||||||
| 12 | 'is_reset:Bool:default(0)', | ||||||||||||||||||||||||||||||||||||||||
| 13 | 'javascript:Str', | ||||||||||||||||||||||||||||||||||||||||
| 14 | ); | ||||||||||||||||||||||||||||||||||||||||
| 15 | 53 | Object::Proto::import_accessors('PDF::Make::Builder::Form::Field::Button'); | |||||||||||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||
| 18 | 3 | ▶ | sub BUILD { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||
| 19 | 3 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||
| 20 | 3 | $self->h(28); | |||||||||||||||||||||||||||||||||||||||
| 21 | 3 | $self->border_colour('#2c3e50'); | |||||||||||||||||||||||||||||||||||||||
| 22 | 3 | $self->bg_colour('#ecf0f1'); | |||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||
| 25 | 2 | ▶ | sub _draws_own_chrome { 1 } | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_draws_own_chrome: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||
| 27 | 3 | ▶ | sub _create_field { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
_create_field: called CC=10 SCAR=26.9
| |||||||||||||||||||||||||||||||||||||||||
| 28 | 3 | my ($self, $doc, $name, $fx, $fy, $fw, $fh) = @_; | |||||||||||||||||||||||||||||||||||||||
| 29 | 3 | ▶ | my $cap = $self->caption // $self->label // $name; | ||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
($self->caption // $self->label) // $name
$self->caption // $self->label
MC/DC0%0/3
($self->caption // $self->label) // $name
$self->caption
$self->label
$name
Truth table25%1/4
A // B // C
A= $self->captionB= $self->labelC= $name
| |||||||||||||||||||||||||||||||||||||||||
| 30 | 3 | my $field = PDF::Make::FieldPtr::button($doc, $name, $fx, $fy, $fw, $fh, $cap); | |||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||
| 32 | 3 | my $submit = submit_url $self; | |||||||||||||||||||||||||||||||||||||||
| 33 | 3 | my $uri = url $self; | |||||||||||||||||||||||||||||||||||||||
| 34 | 3 | my $rst = is_reset $self; | |||||||||||||||||||||||||||||||||||||||
| 35 | 3 | my $js = javascript $self; | |||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||
| 37 | 3 | ▶ | if (defined $uri && length $uri) { | ||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition66%2/3
defined $uri and length $uri
MC/DC50%1/2
defined $uri and length $uri
defined $uri
length $uri
Truth table66%2/3
A and B
A= defined $uriB= length $uri
| |||||||||||||||||||||||||||||||||||||||||
| 38 | 1 | $field->set_uri_action($uri); | |||||||||||||||||||||||||||||||||||||||
| 39 | ▶ | } elsif (defined $submit && length $submit) { | |||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
defined $submit and length $submit
MC/DC0%0/2
defined $submit and length $submit
defined $submit
length $submit
Truth table33%1/3
A and B
A= defined $submitB= length $submit
| |||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | $field->set_submit_url($submit); | |||||||||||||||||||||||||||||||||||||||
| 41 | } elsif ($rst) { | ||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | $field->set_reset_action; | |||||||||||||||||||||||||||||||||||||||
| 43 | ▶ | } elsif (defined $js && length $js) { | |||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
defined $js and length $js
MC/DC0%0/2
defined $js and length $js
defined $js
length $js
Truth table33%1/3
A and B
A= defined $jsB= length $js
| |||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | $field->set_javascript($js); | |||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||
| 47 | 3 | return $field; | |||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||
| 50 | 53 | 1; | |||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||||||||||||||||||||||