| 1 | package TUI::Views::ListViewer; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Base class for list viewers | ||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 22 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 22 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 22 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 22 | our $VERSION = '2.000002'; | |||||||||||||||||||||||||||||||||||||||||||||
| 9 | 22 | $VERSION =~ tr/_//d; | |||||||||||||||||||||||||||||||||||||||||||||
| 10 | 22 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 22 | ▶ | use Exporter 'import'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 22 | our @EXPORT = qw( | |||||||||||||||||||||||||||||||||||||||||||||
| 14 | TListViewer | ||||||||||||||||||||||||||||||||||||||||||||||
| 15 | new_TListViewer | ||||||||||||||||||||||||||||||||||||||||||||||
| 16 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 22 | ▶ | use TUI::toolkit; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 22 | ▶ | use TUI::toolkit::Types qw( | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | Maybe | ||||||||||||||||||||||||||||||||||||||||||||||
| 21 | is_Object | ||||||||||||||||||||||||||||||||||||||||||||||
| 22 | :types | ||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 22 | ); | |||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 22 | ▶ | use TUI::Const qw( EOS ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 22 | ▶ | use TUI::Drivers::Const qw( | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | :evXXXX | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | kbUp | ||||||||||||||||||||||||||||||||||||||||||||||
| 29 | kbDown | ||||||||||||||||||||||||||||||||||||||||||||||
| 30 | kbLeft | ||||||||||||||||||||||||||||||||||||||||||||||
| 31 | kbRight | ||||||||||||||||||||||||||||||||||||||||||||||
| 32 | kbPgDn | ||||||||||||||||||||||||||||||||||||||||||||||
| 33 | kbPgUp | ||||||||||||||||||||||||||||||||||||||||||||||
| 34 | kbHome | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | kbEnd | ||||||||||||||||||||||||||||||||||||||||||||||
| 36 | kbCtrlPgDn | ||||||||||||||||||||||||||||||||||||||||||||||
| 37 | kbCtrlPgUp | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | meDoubleClick | ||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 22 | ); | |||||||||||||||||||||||||||||||||||||||||||||
| 40 | 22 | ▶ | use TUI::Drivers::Util qw( | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | ctrlToArrow | ||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 22 | ); | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | 22 | ▶ | use TUI::Objects::Point; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 22 | ▶ | use TUI::Views::Const qw( | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 45 | cmScrollBarChanged | ||||||||||||||||||||||||||||||||||||||||||||||
| 46 | cmScrollBarClicked | ||||||||||||||||||||||||||||||||||||||||||||||
| 47 | cmListItemSelected | ||||||||||||||||||||||||||||||||||||||||||||||
| 48 | cpListViewer | ||||||||||||||||||||||||||||||||||||||||||||||
| 49 | ofFirstClick | ||||||||||||||||||||||||||||||||||||||||||||||
| 50 | ofSelectable | ||||||||||||||||||||||||||||||||||||||||||||||
| 51 | :sfXXXX | ||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 22 | ); | |||||||||||||||||||||||||||||||||||||||||||||
| 53 | 22 | ▶ | use TUI::Views::DrawBuffer; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 22 | ▶ | use TUI::Views::Palette; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 22 | ▶ | use TUI::Views::View; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 22 | ▶ | use TUI::Views::Util qw( message ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||
| 58 | sub TListViewer() { __PACKAGE__ } | ||||||||||||||||||||||||||||||||||||||||||||||
| 59 | sub name() { 'TListViewer' } | ||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | sub new_TListViewer { __PACKAGE__->from(@_) } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new_TListViewer: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||
| 62 | # import global variables | ||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 22 | ▶ | use vars qw( | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 64 | $showMarkers | ||||||||||||||||||||||||||||||||||||||||||||||
| 65 | $specialChars | ||||||||||||||||||||||||||||||||||||||||||||||
| 66 | $emptyText | ||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 22 | ); | |||||||||||||||||||||||||||||||||||||||||||||
| 68 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 22 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 22 | *showMarkers = \${ TView . '::showMarkers' }; | |||||||||||||||||||||||||||||||||||||||||||||
| 71 | 22 | *specialChars = \${ TView . '::specialChars' }; | |||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 22 | extends TView; | |||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||
| 76 | # declare global variables | ||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 22 | our $emptyText = "<empty>"; | |||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||
| 79 | # declare attributes | ||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 22 | has hScrollBar => ( is => 'rw' ); | |||||||||||||||||||||||||||||||||||||||||||||
| 81 | 22 | has vScrollBar => ( is => 'rw' ); | |||||||||||||||||||||||||||||||||||||||||||||
| 82 | 22 | has numCols => ( is => 'rw' ); | |||||||||||||||||||||||||||||||||||||||||||||
| 83 | 22 | has topItem => ( is => 'rw', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 84 | 22 | has focused => ( is => 'rw', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 85 | 22 | has range => ( is => 'rw', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | sub BUILDARGS { # \%args (%args) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILDARGS: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 89 | method => 1, | ||||||||||||||||||||||||||||||||||||||||||||||
| 90 | named => [ | ||||||||||||||||||||||||||||||||||||||||||||||
| 91 | bounds => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 92 | numCols => PositiveOrZeroInt, { alias => 'aNumCols' }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 93 | hScrollBar => Maybe[Object], { alias => 'aHScrollBar' }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 94 | vScrollBar => Maybe[Object], { alias => 'aVScrollBar' }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 95 | ], | ||||||||||||||||||||||||||||||||||||||||||||||
| 96 | caller_level => +1, | ||||||||||||||||||||||||||||||||||||||||||||||
| 97 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | my ( $class, $args ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | return { %$args }; | |||||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | sub BUILD { # void (\%args) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILD: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | my ( $self, $args ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | assert ( @_ == 2 ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | assert ( is_Object $self ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | my ( $arStep, $pgStep ); | |||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | $self->{options} |= ofFirstClick | ofSelectable; | |||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | $self->{eventMask} |= evBroadcast; | |||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | if ( $self->{vScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | if ( $self->{numCols} == 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | $pgStep = $self->{size}{y} - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | $arStep = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 114 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | $pgStep = $self->{size}{y} * $self->{numCols}; | |||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | $arStep = $self->{size}{y}; | |||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | $self->{vScrollBar}->setStep( $pgStep, $arStep ); | |||||||||||||||||||||||||||||||||||||||||||||
| 119 | } #/ if ( $self->{vScrollBar...}) | ||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | if ( $self->{hScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 122 | $self->{hScrollBar}->setStep( | ||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | int( $self->{size}{x} / $self->{numCols} ), | |||||||||||||||||||||||||||||||||||||||||||||
| 124 | 1 | ||||||||||||||||||||||||||||||||||||||||||||||
| 125 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | sub from { # $obj ($bounds, $aNumCols, $aHScrollBar|undef, $aVScrollBar|undef) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
from: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 132 | method => 1, | ||||||||||||||||||||||||||||||||||||||||||||||
| 133 | pos => [Object, PositiveOrZeroInt, Maybe[Object], Maybe[Object]], | ||||||||||||||||||||||||||||||||||||||||||||||
| 134 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | my ( $class, @args ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | return $class->new( bounds => $args[0], numCols => $args[1], | |||||||||||||||||||||||||||||||||||||||||||||
| 137 | hScrollBar => $args[2], vScrollBar => $args[3] ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | ▶ | sub changeBounds { # void ($bounds) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
changeBounds: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 142 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 143 | pos => [Object], | ||||||||||||||||||||||||||||||||||||||||||||||
| 144 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | my ( $self, $bounds ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | $self->SUPER::changeBounds( $bounds ); | |||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | if ( $self->{hScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 148 | $self->{hScrollBar}->setStep( | ||||||||||||||||||||||||||||||||||||||||||||||
| 149 | int( $self->{size}{x} / $self->{numCols} ), | ||||||||||||||||||||||||||||||||||||||||||||||
| 150 | $self->{hScrollBar}{arStep} | ||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | if ( $self->{vScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 154 | $self->{vScrollBar}->setStep( | ||||||||||||||||||||||||||||||||||||||||||||||
| 155 | $self->{size}{y}, | ||||||||||||||||||||||||||||||||||||||||||||||
| 156 | $self->{vScrollBar}{arStep} | ||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | sub draw { # void () | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
draw: not called CC=14 SCAR=53.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 164 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 165 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||
| 166 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | my ( $i, $j, $item ); | |||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | my ( $normalColor, $selectedColor, $focusedColor, $color ); | |||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | my ( $colWidth, $curCol, $indent ); | |||||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | my $b = TDrawBuffer->new; | |||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | my $scOff; | |||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | if ( ( $self->{state} & ( sfSelected | sfActive ) ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 176 | == ( sfSelected | sfActive ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 177 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | $normalColor = $self->getColor( 1 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | $focusedColor = $self->getColor( 3 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | $selectedColor = $self->getColor( 4 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 182 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | $normalColor = $self->getColor( 2 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | $selectedColor = $self->getColor( 4 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | if ( $self->{hScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | $indent = $self->{hScrollBar}{value}; | |||||||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 190 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | $indent = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | $colWidth = int( $self->{size}{x} / $self->{numCols} ) + 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | for ( $i = 0 ; $i < $self->{size}{y} ; $i++ ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | for ( $j = 0 ; $j < $self->{numCols} ; $j++ ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | $item = $j * $self->{size}{y} + $i + $self->{topItem}; | |||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | $curCol = $j * $colWidth; | |||||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | ▶ | if ( ( ( $self->{state} & ( sfSelected | sfActive ) ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/6
($self->{"state"} & 48) == 48 and $self->{"focused"} == $item and $self->{"range"} > 0
($self->{"state"} & 48) == 48 and $self->{"focused"} == $item
MC/DC0%0/3
($self->{"state"} & 48) == 48 and $self->{"focused"} == $item and $self->{"range"} > 0
($self->{"state"} & 48) == 48
$self->{"focused"} == $item
$self->{"range"} > 0
Truth table0%0/4
A and B and C
A= ($self->{"state"} & 48) == 48B= $self->{"focused"} == $itemC= $self->{"range"} > 0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 200 | == ( sfSelected | sfActive ) ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 201 | && $self->{focused} == $item | ||||||||||||||||||||||||||||||||||||||||||||||
| 202 | && $self->{range} > 0 ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 203 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | $color = $focusedColor; | |||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | $self->setCursor( $curCol + 1, $i ); | |||||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | $scOff = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 208 | ▶ | elsif ( $item < $self->{range} && $self->isSelected( $item ) ) { | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$item < $self->{"range"} and $self->isSelected($item)
MC/DC0%0/2
$item < $self->{"range"} and $self->isSelected($item)
$item < $self->{"range"}
$self->isSelected($item)
Truth table0%0/3
A and B
A= $item < $self->{"range"}B= $self->isSelected($item)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | $color = $selectedColor; | |||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | $scOff = 2; | |||||||||||||||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 212 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | $color = $normalColor; | |||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | $scOff = 4; | |||||||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | $b->moveChar( $curCol, ' ', $color, $colWidth ); | |||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | if ( $item < $self->{range} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | my $text; | |||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | $self->getText( \$text, $item, $colWidth + $indent ); | |||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | my $buf = substr( $text, $indent, $colWidth ); | |||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | $b->moveStr( $curCol + 1, $buf, $color ); | |||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | ▶ | if ( $showMarkers ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | $b->putChar( $curCol, $specialChars->[$scOff] ); | |||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | $b->putChar( $curCol + $colWidth - 2, $specialChars->[ $scOff + 1 ] ); | |||||||||||||||||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 226 | } #/ if ( $item < $self->{range...}) | ||||||||||||||||||||||||||||||||||||||||||||||
| 227 | ▶ | elsif ( $i == 0 && $j == 0 ) { | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$i == 0 and $j == 0
MC/DC0%0/2
$i == 0 and $j == 0
$i == 0
$j == 0
Truth table0%0/3
A and B
A= $i == 0B= $j == 0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | $b->moveStr( $curCol + 1, $emptyText, $self->getColor( 1 ) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | $b->moveChar( $curCol + $colWidth - 1, chr 179, $self->getColor( 5 ), 1 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 232 | } #/ for ( $j = 0 ; $j < $self...) | ||||||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | $self->writeLine( 0, $i, $self->{size}{x}, 1, $b ); | |||||||||||||||||||||||||||||||||||||||||||||
| 235 | } #/ for ( $i = 0 ; $i < $self...) | ||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 238 | } #/ sub draw | ||||||||||||||||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | sub focusItem { # void ($item) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
focusItem: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 242 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 243 | pos => [Int], | ||||||||||||||||||||||||||||||||||||||||||||||
| 244 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | my ( $self, $item ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | $self->{focused} = $item; | |||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | ▶ | if ( $self->{vScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | $self->{vScrollBar}->setValue( $item ); | |||||||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 250 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | $self->drawView; | |||||||||||||||||||||||||||||||||||||||||||||
| 252 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | ▶ | if ( $item < $self->{topItem} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | ▶ | if ( $self->{numCols} == 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | $self->{topItem} = $item; | |||||||||||||||||||||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 257 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | $self->{topItem} = $item - ( $item % $self->{size}{y} ); | |||||||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 261 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | if ( $item >= $self->{topItem} + $self->{size}{y} * $self->{numCols} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | if ( $self->{numCols} == 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | $self->{topItem} = $item - $self->{size}{y} + 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 266 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 267 | $self->{topItem} = $item - ( $item % $self->{size}{y} ) - | ||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | ( $self->{size}{y} * ( $self->{numCols} - 1 ) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 270 | } #/ if ( $item >= $self->{...}) | ||||||||||||||||||||||||||||||||||||||||||||||
| 271 | } #/ else [ if ( $item < $self->{topItem...})] | ||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 273 | } #/ sub focusItem | ||||||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | ▶ | sub getPalette { # $palette () | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getPalette: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 277 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 278 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||
| 279 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | state $palette = TPalette->new( | |||||||||||||||||||||||||||||||||||||||||||||
| 282 | data => cpListViewer, | ||||||||||||||||||||||||||||||||||||||||||||||
| 283 | size => length( cpListViewer ), | ||||||||||||||||||||||||||||||||||||||||||||||
| 284 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | return $palette->clone(); | |||||||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | ▶ | sub getText { # void (\$dest, $item, $width) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getText: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 290 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 291 | pos => [ScalarRef, Int, Int], | ||||||||||||||||||||||||||||||||||||||||||||||
| 292 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | my ( $self, $dest, $item, $width ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | $$dest = EOS; | |||||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 296 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | sub isSelected { # $bool ($item) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
isSelected: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 300 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 301 | pos => [Int], | ||||||||||||||||||||||||||||||||||||||||||||||
| 302 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | my ( $self, $item ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | return $item == $self->{focused}; | |||||||||||||||||||||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | ▶ | sub handleEvent { # void ($event) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handleEvent: not called CC=44 SCAR=75.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 22 | ▶ | no warnings 'uninitialized'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 310 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 311 | pos => [Object], | ||||||||||||||||||||||||||||||||||||||||||||||
| 312 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | my ( $self, $event ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | my $mouse; | |||||||||||||||||||||||||||||||||||||||||||||
| 316 | my $colWidth; | ||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | my ($oldItem, $newItem ); | |||||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | my $count; | |||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | my $mouseAutosToSkip = 4; | |||||||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | $self->SUPER::handleEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 0 | ▶ | if ( $event->{what} == evMouseDown ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | $colWidth = int( $self->{size}{x} / $self->{numCols} ) + 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | $oldItem = $self->{focused}; | |||||||||||||||||||||||||||||||||||||||||||||
| 326 | 0 | $mouse = $self->makeLocal( $event->{mouse}{where} ); | |||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | ▶ | if ( $self->mouseInView( $event->{mouse}{where} ) ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 328 | $newItem = $mouse->{y} | ||||||||||||||||||||||||||||||||||||||||||||||
| 329 | + ( $self->{size}{y} * int( $mouse->{x} / $colWidth ) ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | + $self->{topItem}; | |||||||||||||||||||||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 332 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | $newItem = $oldItem; | |||||||||||||||||||||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | $count = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | ▶ | DO: { do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | ▶ | if ( $newItem != $oldItem ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | $self->focusItemNum( $newItem ); | |||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | $self->drawView(); | |||||||||||||||||||||||||||||||||||||||||||||
| 340 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | $oldItem = $newItem; | |||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | $mouse = $self->makeLocal( $event->{mouse}{where} ); | |||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | ▶ | if ( $self->mouseInView( $event->{mouse}{where} ) ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 344 | $newItem = $mouse->{y} | ||||||||||||||||||||||||||||||||||||||||||||||
| 345 | + ( $self->{size}{y} * int( $mouse->{x} / $colWidth ) ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | + $self->{topItem}; | |||||||||||||||||||||||||||||||||||||||||||||
| 347 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 348 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 349 | 0 | ▶ | if ( $self->{numCols} == 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | ▶ | if ( $event->{what} == evMouseAuto ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | $count++; | |||||||||||||||||||||||||||||||||||||||||||||
| 352 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | ▶ | if ( $count == $mouseAutosToSkip ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 0 | $count = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | ▶ | if ( $mouse->{y} < 0 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 0 | $newItem = $self->{focused} - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 357 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 358 | elsif ( $mouse->{y} >= $self->{size}{y} ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | $newItem = $self->{focused} + 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 362 | } #/ if ( $self->{numCols} ...) | ||||||||||||||||||||||||||||||||||||||||||||||
| 363 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | ▶ | if ( $event->{what} == evMouseAuto ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | $count++; | |||||||||||||||||||||||||||||||||||||||||||||
| 366 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 0 | ▶ | if ( $count == $mouseAutosToSkip ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | $count = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 369 | 0 | ▶ | if ( $mouse->{x} < 0 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 0 | $newItem = $self->{focused} - $self->{size}{y}; | |||||||||||||||||||||||||||||||||||||||||||||
| 371 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 372 | elsif ( $mouse->{x} >= $self->{size}{x} ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 373 | 0 | $newItem = $self->{focused} + $self->{size}{y}; | |||||||||||||||||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 375 | elsif ( $mouse->{y} < 0 ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 376 | $newItem = $self->{focused} | ||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 0 | - ( $self->{focused} % $self->{size}{y} ); | |||||||||||||||||||||||||||||||||||||||||||||
| 378 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 379 | elsif ( $mouse->{y} > $self->{size}{y} ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 380 | $newItem = $self->{focused} | ||||||||||||||||||||||||||||||||||||||||||||||
| 381 | - ( $self->{focused} % $self->{size}{y} ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 0 | + $self->{size}{y} - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 384 | } #/ if ( $count == $mouseAutosToSkip) | ||||||||||||||||||||||||||||||||||||||||||||||
| 385 | } #/ else [ if ( $self->{numCols} ...)] | ||||||||||||||||||||||||||||||||||||||||||||||
| 386 | } #/ else [ if ( $self->mouseInView...)] | ||||||||||||||||||||||||||||||||||||||||||||||
| 387 | last DO | ||||||||||||||||||||||||||||||||||||||||||||||
| 388 | 0 | ▶ | if $event->{mouse}{eventFlags} & meDoubleClick; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||||||||||||||||||
| 390 | } while ( $self->mouseEvent( $event, evMouseMove | evMouseAuto ) ) } | ||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 0 | $self->focusItemNum( $newItem ); | |||||||||||||||||||||||||||||||||||||||||||||
| 392 | 0 | $self->drawView; | |||||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | ▶ | if ( ( $event->{mouse}{eventFlags} & meDoubleClick ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$event->{"mouse"}{"eventFlags"} & 2 and $self->{"range"} > $newItem
MC/DC0%0/2
$event->{"mouse"}{"eventFlags"} & 2 and $self->{"range"} > $newItem
$event->{"mouse"}{"eventFlags"} & 2
$self->{"range"} > $newItem
Truth table0%0/3
A and B
A= $event->{"mouse"}{"eventFlags"} & 2B= $self->{"range"} > $newItem
| |||||||||||||||||||||||||||||||||||||||||||||||
| 394 | && $self->{range} > $newItem | ||||||||||||||||||||||||||||||||||||||||||||||
| 395 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 0 | $self->selectItem( $newItem ); | |||||||||||||||||||||||||||||||||||||||||||||
| 397 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 0 | $self->clearEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||
| 399 | } #/ if ( $event->{what} ==...) | ||||||||||||||||||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||||||||||||||||||
| 401 | elsif ( $event->{what} == evKeyDown ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 0 | ▶ | if ( $event->{keyDown}{charScan}{charCode} eq ' ' | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$event->{"keyDown"}{"charScan"}{"charCode"} eq " " and $self->{"focused"} < $self->{"range"}
MC/DC0%0/2
$event->{"keyDown"}{"charScan"}{"charCode"} eq " " and $self->{"focused"} < $self->{"range"}
$event->{"keyDown"}{"charScan"}{"charCode"} eq " "
$self->{"focused"} < $self->{"range"}
Truth table0%0/3
A and B
A= $event->{"keyDown"}{"charScan"}{"charCode"} eq " "B= $self->{"focused"} < $self->{"range"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 403 | && $self->{focused} < $self->{range} | ||||||||||||||||||||||||||||||||||||||||||||||
| 404 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 0 | $self->selectItem( $self->{focused} ); | |||||||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | $newItem = $self->{focused}; | |||||||||||||||||||||||||||||||||||||||||||||
| 407 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 408 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | SWITCH: for ( ctrlToArrow( $event->{keyDown}{keyCode} ) ) { | |||||||||||||||||||||||||||||||||||||||||||||
| 410 | 0 | ▶ | kbUp == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | $newItem = $self->{focused} - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 412 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 413 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | ▶ | kbDown == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | $newItem = $self->{focused} + 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 416 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 417 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 418 | 0 | ▶ | kbRight == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | ▶ | if ( $self->{numCols} > 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | $newItem = $self->{focused} + $self->{size}{y}; | |||||||||||||||||||||||||||||||||||||||||||||
| 421 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 422 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 423 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 424 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 426 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | ▶ | kbLeft == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | ▶ | if ( $self->{numCols} > 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 429 | 0 | $newItem = $self->{focused} - $self->{size}{y}; | |||||||||||||||||||||||||||||||||||||||||||||
| 430 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 431 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 433 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 435 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 0 | ▶ | kbPgDn == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 0 | $newItem = $self->{focused} + $self->{size}{y} * $self->{numCols}; | |||||||||||||||||||||||||||||||||||||||||||||
| 438 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 439 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 440 | 0 | ▶ | kbPgUp == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 0 | $newItem = $self->{focused} - $self->{size}{y} * $self->{numCols}; | |||||||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 443 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 0 | ▶ | kbHome == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 0 | $newItem = $self->{topItem}; | |||||||||||||||||||||||||||||||||||||||||||||
| 446 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 447 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 0 | ▶ | kbEnd == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 449 | $newItem = | ||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 0 | $self->{topItem} + ( $self->{size}{y} * $self->{numCols} ) - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 451 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 452 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | ▶ | kbCtrlPgDn == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 454 | 0 | $newItem = $self->{range} - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 455 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 456 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 457 | 0 | ▶ | kbCtrlPgUp == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 0 | $newItem = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 459 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||
| 460 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 461 | DEFAULT: { | ||||||||||||||||||||||||||||||||||||||||||||||
| 462 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 463 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 464 | } #/ SWITCH: for ( ctrlToArrow( $event...)) | ||||||||||||||||||||||||||||||||||||||||||||||
| 465 | } #/ else [ if ( $event->{keyDown}...)] | ||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 0 | $self->focusItemNum( $newItem ); | |||||||||||||||||||||||||||||||||||||||||||||
| 467 | 0 | $self->drawView(); | |||||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | $self->clearEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||
| 469 | } #/ elsif ( $event->{what} ==...) | ||||||||||||||||||||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||||||||||||||||||||
| 471 | elsif ( $event->{what} == evBroadcast ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 0 | ▶ | if ( $self->{options} & ofSelectable ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 473 | 0 | ▶ | if ( $event->{message}{command} == cmScrollBarClicked | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/6
$event->{"message"}{"command"} == 54 and $event->{"message"}{"infoPtr"} == $self->{"hScrollBar"} || $event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
$event->{"message"}{"infoPtr"} == $self->{"hScrollBar"} or $event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
MC/DC0%0/3
$event->{"message"}{"command"} == 54 and $event->{"message"}{"infoPtr"} == $self->{"hScrollBar"} || $event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
$event->{"message"}{"command"} == 54
$event->{"message"}{"infoPtr"} == $self->{"hScrollBar"}
$event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
Truth table0%0/4
A and B or C
A= $event->{"message"}{"command"} == 54B= $event->{"message"}{"infoPtr"} == $self->{"hScrollBar"}C= $event->{"message"}{"infoPtr"} == $self->{"vScrollBar"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 474 | && ( $event->{message}{infoPtr} == $self->{hScrollBar} | ||||||||||||||||||||||||||||||||||||||||||||||
| 475 | || $event->{message}{infoPtr} == $self->{vScrollBar} ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 476 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | $self->focus(); # BUG FIX <<----- Change | |||||||||||||||||||||||||||||||||||||||||||||
| 478 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 479 | elsif ( $event->{message}{command} == cmScrollBarChanged ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 480 | 0 | ▶ | if ( $self->{vScrollBar} == $event->{message}{infoPtr} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 481 | 0 | $self->focusItemNum( $self->{vScrollBar}{value} ); | |||||||||||||||||||||||||||||||||||||||||||||
| 482 | 0 | $self->drawView(); | |||||||||||||||||||||||||||||||||||||||||||||
| 483 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 484 | elsif ( $self->{hScrollBar} == $event->{message}{infoPtr} ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 0 | $self->drawView(); | |||||||||||||||||||||||||||||||||||||||||||||
| 486 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 487 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 488 | } #/ if ( $self->{options} ...) | ||||||||||||||||||||||||||||||||||||||||||||||
| 489 | } #/ elsif ( $event->{what} ==...) | ||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 491 | } #/ sub handleEvent | ||||||||||||||||||||||||||||||||||||||||||||||
| 492 | |||||||||||||||||||||||||||||||||||||||||||||||
| 493 | 0 | ▶ | sub selectItem { # void ($item) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
selectItem: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 494 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 495 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 496 | pos => [Int], | ||||||||||||||||||||||||||||||||||||||||||||||
| 497 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 498 | 0 | my ( $self, $item ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 499 | 0 | message( $self->{owner}, evBroadcast, cmListItemSelected, $self ); | |||||||||||||||||||||||||||||||||||||||||||||
| 500 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 501 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||||||||||||||||||||
| 503 | 0 | ▶ | sub setRange { # void ($aRange) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setRange: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 504 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 505 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 506 | pos => [Int], | ||||||||||||||||||||||||||||||||||||||||||||||
| 507 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 508 | 0 | my ( $self, $aRange ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 509 | 0 | $self->{range} = $aRange; | |||||||||||||||||||||||||||||||||||||||||||||
| 510 | |||||||||||||||||||||||||||||||||||||||||||||||
| 511 | # BUG FIX - EFW - Tue 06/26/95 | ||||||||||||||||||||||||||||||||||||||||||||||
| 512 | 0 | ▶ | if ( $self->{focused} >= $aRange ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 513 | 0 | ▶ | $self->{focused} = ( $aRange - 1 >= 0 ) ? $aRange - 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 514 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 515 | |||||||||||||||||||||||||||||||||||||||||||||||
| 516 | 0 | ▶ | if ( $self->{vScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 517 | $self->{vScrollBar}->setParams( $self->{focused}, 0, $aRange - 1, | ||||||||||||||||||||||||||||||||||||||||||||||
| 518 | 0 | $self->{vScrollBar}{pgStep}, $self->{vScrollBar}{arStep} ); | |||||||||||||||||||||||||||||||||||||||||||||
| 519 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 520 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 521 | 0 | $self->drawView(); | |||||||||||||||||||||||||||||||||||||||||||||
| 522 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 523 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 524 | } #/ sub setRange | ||||||||||||||||||||||||||||||||||||||||||||||
| 525 | |||||||||||||||||||||||||||||||||||||||||||||||
| 526 | 0 | ▶ | sub setState { # void ($aState, $enable) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setState: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 527 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 528 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 529 | pos => [PositiveOrZeroInt, Bool], | ||||||||||||||||||||||||||||||||||||||||||||||
| 530 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 531 | 0 | my ( $self, $aState, $enable ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 532 | 0 | $self->SUPER::setState( $aState, $enable ); | |||||||||||||||||||||||||||||||||||||||||||||
| 533 | 0 | ▶ | if ( $aState & (sfSelected | sfActive | sfVisible) ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 534 | 0 | ▶ | if ( $self->{hScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 535 | 0 | ▶ | if ( $self->getState(sfActive) && $self->getState(sfVisible) ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->getState(16) and $self->getState(1)
MC/DC0%0/2
$self->getState(16) and $self->getState(1)
$self->getState(16)
$self->getState(1)
Truth table0%0/3
A and B
A= $self->getState(16)B= $self->getState(1)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 536 | 0 | $self->{hScrollBar}->show(); | |||||||||||||||||||||||||||||||||||||||||||||
| 537 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 538 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 539 | 0 | $self->{hScrollBar}->hide(); | |||||||||||||||||||||||||||||||||||||||||||||
| 540 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 541 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 542 | 0 | ▶ | if ( $self->{vScrollBar} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 543 | 0 | ▶ | if ( $self->getState(sfActive) && $self->getState(sfVisible) ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->getState(16) and $self->getState(1)
MC/DC0%0/2
$self->getState(16) and $self->getState(1)
$self->getState(16)
$self->getState(1)
Truth table0%0/3
A and B
A= $self->getState(16)B= $self->getState(1)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 544 | 0 | $self->{vScrollBar}->show(); | |||||||||||||||||||||||||||||||||||||||||||||
| 545 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 546 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 547 | 0 | $self->{vScrollBar}->hide(); | |||||||||||||||||||||||||||||||||||||||||||||
| 548 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 549 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 550 | 0 | $self->drawView(); | |||||||||||||||||||||||||||||||||||||||||||||
| 551 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 553 | } #/ sub setState | ||||||||||||||||||||||||||||||||||||||||||||||
| 554 | |||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 0 | ▶ | sub focusItemNum { # void ($item) | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
focusItemNum: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 556 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 557 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 558 | pos => [Int], | ||||||||||||||||||||||||||||||||||||||||||||||
| 559 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 560 | 0 | my ( $self, $item ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 561 | 0 | ▶ | if ( $item < 0 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 0 | $item = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 563 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 564 | ▶ | elsif ( $item >= $self->{range} && $self->{range} > 0 ) { | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$item >= $self->{"range"} and $self->{"range"} > 0
MC/DC0%0/2
$item >= $self->{"range"} and $self->{"range"} > 0
$item >= $self->{"range"}
$self->{"range"} > 0
Truth table0%0/3
A and B
A= $item >= $self->{"range"}B= $self->{"range"} > 0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 565 | 0 | $item = $self->{range} - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 566 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 567 | $self->focusItem( $item ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 568 | 0 | ▶ | if $self->{range}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 569 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 570 | } #/ sub focusItemNum | ||||||||||||||||||||||||||||||||||||||||||||||
| 571 | |||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 0 | ▶ | sub shutDown { # void () | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
shutDown: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 573 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||
| 574 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||
| 575 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||
| 576 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 577 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 578 | 0 | $self->{hScrollBar} = undef; | |||||||||||||||||||||||||||||||||||||||||||||
| 579 | 0 | $self->{vScrollBar} = undef; | |||||||||||||||||||||||||||||||||||||||||||||
| 580 | 0 | $self->SUPER::shutDown(); | |||||||||||||||||||||||||||||||||||||||||||||
| 581 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 582 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 583 | |||||||||||||||||||||||||||||||||||||||||||||||
| 584 | 22 | 1 | |||||||||||||||||||||||||||||||||||||||||||||
| 585 | |||||||||||||||||||||||||||||||||||||||||||||||
| 586 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||