lib/TUI/Dialogs/ParamText.pm

filter: Statementstmt 61.1% 33 / 54 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 9 / 15 Podpod 83.3% 5 / 6 totaltotal 59.4% 47 / 79 CC 3 SCAR 8.8
CC
3
Cov
57%
getText
6.0
getTextLen
6.0
new_TParamText
2.0
CRAP 2.4
« lib/TUI/Objects/Rect.pm ↑ Summary lib/TUI/ColorSel/ColorItem.pm »
1 package TUI::Dialogs::ParamText;
2 # ABSTRACT: displays formatted dynamic text inside a dialog
3
4 4 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 4 our $VERSION = '2.000002';
9 4 $VERSION =~ tr/_//d;
10 4 our $AUTHORITY = 'cpan:BRICKPOOL';
11
12 4 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
13
14 4 our @EXPORT = qw(
15 TParamText
16 new_TParamText
17 );
18
19 4 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
20 4 ▶use TUI::toolkit;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 4 ▶use TUI::toolkit::Types qw( :types );
Subroutine BEGIN: called CC=1 SCAR=0.0
22
23 4 ▶use TUI::Dialogs::StaticText;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 4 ▶use TUI::toolkit;
Subroutine BEGIN: called CC=1 SCAR=0.0
25
26 sub TParamText() { __PACKAGE__ }
27 sub name() { 'TParamText' }
28 0 ▶sub new_TParamText { __PACKAGE__->from( @_ ) }
Subroutine new_TParamText: not called CC=1 SCAR=6.9
Pod documented
29
30 4 extends TStaticText;
31
32 # protected attributes
33 4 has str => ( is => 'ro', default => '' );
34
35 0 ▶sub BUILDARGS { # \%args (%args)
Subroutine BUILDARGS: not called CC=1 SCAR=6.9
Pod documented
36 0 state $sig = signature(
37 method => 1,
38 named => [
39 bounds => Object,
40 ],
41 caller_level => +1,
42 );
43 0 my ( $class, $args1 ) = $sig->( @_ );
44 0 local $Carp::CarpLevel = $Carp::CarpLevel + 1;
45 my $args2 = $class->SUPER::BUILDARGS(
46 bounds => $args1->{bounds},
47 0 text => '',
48 );
49 0 return { %$args1, %$args2 };
50 }
51
52 0 ▶sub from { # $obj ($bounds)
Subroutine from: not called CC=1 SCAR=6.9
Pod undocumented
53 0 state $sig = signature(
54 method => 1,
55 pos => [Object],
56 );
57 0 my ( $class, $bounds ) = $sig->( @_ );
58 0 return $class->new( bounds => $bounds );
59 }
60
61 0 ▶sub getText { # void (\$s)
Subroutine getText: not called CC=2 SCAR=17.9
Pod documented
62 0 state $sig = signature(
63 method => Object,
64 pos => [ScalarRef],
65 );
66 0 my ( $self, $s ) = $sig->( @_ );
67 0 ▶ $$s = defined $self->{str} ? $self->{str} : '';
Branch: 1 branch
BranchTrueFalseTotal
defined $self->{'str'} ? : 0 0 0
68 0 return;
69 }
70
71 0 ▶sub getTextLen { # $len ()
Subroutine getTextLen: not called CC=2 SCAR=17.9
Pod documented
72 0 state $sig = signature(
73 method => Object,
74 pos => [],
75 );
76 0 my ( $self ) = $sig->( @_ );
77 0 ▶ return defined $self->{str} ? length $self->{str} : 0;
Branch: 1 branch
BranchTrueFalseTotal
defined $self->{'str'} ? : 0 0 0
78 }
79
80 0 ▶sub setText { # void ($fmt, @args)
Subroutine setText: not called CC=1 SCAR=6.9
Pod documented
81 0 state $sig = signature(
82 method => Object,
83 pos => [
84 Str,
85 ArrayRef, { slurpy => 1 }
86 ],
87 );
88 0 my ( $self, $fmt, $args ) = $sig->( @_ );
89 0 $self->{str} = sprintf( $fmt, @$args );
90 0 $self->drawView();
91 0 return;
92 }
93
94 4 1
95
96 __END__
« lib/TUI/Objects/Rect.pm ↑ Summary lib/TUI/ColorSel/ColorItem.pm »