| 1 | package TUI::Views::Window; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: A base class for managing windows | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 33 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 33 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 33 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 33 | our $VERSION = '2.000002'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 33 | $VERSION =~ tr/_//d; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 33 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 33 | ▶ | use Exporter 'import'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 33 | our @EXPORT = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | TWindow | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | new_TWindow | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 33 | ▶ | use Carp (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 33 | ▶ | use TUI::toolkit; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 33 | ▶ | use TUI::toolkit::Types qw( | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | is_Object | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | :types | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 33 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 33 | ▶ | use TUI::App::Program; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 33 | ▶ | use TUI::Drivers::Const qw( | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | :evXXXX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | :kbXXXX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 33 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 33 | ▶ | use TUI::Objects::Point; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 33 | ▶ | use TUI::Objects::Rect; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 33 | ▶ | use TUI::Views::Const qw( | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | :cmXXXX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | :cpXXXX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | :gfXXXX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | :ofXXXX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | :sbXXXX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | :sfXXXX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | :wfXXXX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | wpBlueWindow | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 33 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 33 | ▶ | use TUI::Views::CommandSet; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 33 | ▶ | use TUI::Views::Frame; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 33 | ▶ | use TUI::Views::Group; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 33 | ▶ | use TUI::Views::Palette; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 33 | ▶ | use TUI::Views::ScrollBar; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 33 | ▶ | use TUI::Views::WindowInit; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | sub TWindow() { __PACKAGE__ } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | sub name() { 'TWindow' } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | sub new_TWindow { __PACKAGE__->from(@_) } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new_TWindow: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 33 | extends ( TGroup, TWindowInit ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | # Moo does not inherit attributes from secondary extends() classes. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | # Redeclare attribute provided by TWindowInit. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 33 | ▶ | if ( TUI::toolkit::is_Moo ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | has createFrame => ( is => 'bare', default => sub { die 'required' } ); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | # declare global variables | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 33 | our $minWinSize = TPoint->new( x => 16, y => 6 ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | # import global variables | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 33 | ▶ | use vars qw( | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | $appPalette | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 33 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 33 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 33 | *appPalette = \${ TProgram . '::appPalette' }; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | # public attributes | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 33 | has flags => ( is => 'rw', default => wfMove | wfGrow | wfClose | wfZoom ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 33 | has zoomRect => ( is => 'rw' ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | has number => ( is => 'rw', default => sub { 'required' } ); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 33 | has palette => ( is => 'rw', default => wpBlueWindow ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 33 | has frame => ( is => 'rw' ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | has title => ( is => 'rw', default => sub { 'required' } ); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | sub BUILDARGS { # \%args (%args) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILDARGS: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | method => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | named => [ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | bounds => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | title => Str, { alias => 'aTitle' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | number => Int, { alias => 'aNumber' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | ], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | caller_level => +1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | my ( $class, $args1 ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | local $Carp::CarpLevel = $Carp::CarpLevel + 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | my $args2 = TGroup->BUILDARGS( bounds => $args1->{bounds} ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | my $args3 = TWindowInit->BUILDARGS( cFrame => $class->can( 'initFrame' ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | return { %$args1, %$args2, %$args3 }; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | sub BUILD { # void (\%args) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILD: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | my ( $self, $args ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | assert ( @_ == 2 ); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | assert ( is_Object $self ); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | $self->{zoomRect} = $self->getBounds(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | $self->{state} |= sfShadow; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | $self->{options} |= ofSelectable | ofTopSelect; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | $self->{growMode} = gfGrowAll | gfGrowRel; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | if ( $self->{createFrame} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"createFrame"} and $self->{"frame"} = $self->createFrame($self->getExtent)
MC/DC0%0/2
$self->{"createFrame"} and $self->{"frame"} = $self->createFrame($self->getExtent)
$self->{"createFrame"}
$self->{"frame"} = $self->createFrame($self->getExtent)
Truth table0%0/3
A and B
A= $self->{"createFrame"}B= $self->{"frame"} = $self->createFrame($self->getExtent)
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | && ( $self->{frame} = $self->createFrame( $self->getExtent() ) ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | $self->insert( $self->{frame} ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | sub from { # $obj ($bounds, $aTitle, $aNumber) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
from: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | method => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | pos => [Object, Str, Int], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | my ( $class, @args ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | return $class->new( bounds => $args[0], title => $args[1], | |||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | number => $args[2] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | sub DEMOLISH { # void ($in_global_destruction) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DEMOLISH: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | my ( $self, $in_global_destruction ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | assert ( @_ == 2 ); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | ▶ | assert ( is_Object $self ); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | $self->{title} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | sub close { # void () | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
close: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | alias: for $self ( $_[0] ) { # Maybe we are destroying ourselves | |||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | if ( $self->valid( cmClose ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | # so we don't try to use the frame after it's been deleted | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | $self->{frame} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | $self->destroy( $self ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | } #/ alias | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | sub getPalette { # $palette () | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getPalette: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | state $blue = TPalette->new( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | data => cpBlueWindow, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | size => length( cpBlueWindow ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | state $cyan = TPalette->new( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | data => cpCyanWindow, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | size => length( cpCyanWindow ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | state $gray = TPalette->new( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | data => cpGrayWindow, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | size => length( cpGrayWindow ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | state $palettes = [ $blue, $cyan, $gray ]; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | return $palettes->[$appPalette]->clone(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | } #/ sub getPalette | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | sub getTitle { # $str ($maxSize) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getTitle: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | pos => [Int], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | my ( $self, $maxSize ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | return $self->{title}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | sub handleEvent { # void ($event) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handleEvent: not called CC=22 SCAR=60.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | pos => [Object], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | my ( $self, $event ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | my $limits = TRect->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | my ( $min, $max ) = ( TPoint->new(), TPoint->new() ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | $self->SUPER::handleEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | if ( $event->{what} == evCommand ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | SWITCH: for ( $event->{message}{command} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | cmResize == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | if ( $self->{flags} & ( wfMove | wfGrow ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | $limits = $self->{owner}->getExtent(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | $self->sizeLimits( $min, $max ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | $self->dragView( $event, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | $self->{dragMode} | ( $self->{flags} & ( wfMove | wfGrow ) ), | |||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | $limits, $min, $max | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | $self->clearEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | ▶ | cmClose == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 33 | ▶ | no warnings 'uninitialized'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | ▶ | if ( ( $self->{flags} & wfClose ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$self->{"flags"} & 4 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self
not $event->{"message"}{"infoPtr"} or $event->{"message"}{"infoPtr"} == $self
MC/DC0%0/3
$self->{"flags"} & 4 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self
$self->{"flags"} & 4
not $event->{"message"}{"infoPtr"}
$event->{"message"}{"infoPtr"} == $self
Truth table0%0/4
A and not(B) or C
A= $self->{"flags"} & 4B= not $event->{"message"}{"infoPtr"}C= $event->{"message"}{"infoPtr"} == $self
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | && ( !$event->{message}{infoPtr} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | || $event->{message}{infoPtr} == $self | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | $self->clearEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | if ( !( $self->{state} & sfModal ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | $self->close(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | $event->{what} = evCommand; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | $event->{message}{command} = cmCancel; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | $self->putEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | $self->clearEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | } #/ if ( $self->{flags} & ...) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | ▶ | cmZoom == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 33 | ▶ | no warnings 'uninitialized'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | ▶ | if ( ( $self->{flags} & wfZoom ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$self->{"flags"} & 8 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self
not $event->{"message"}{"infoPtr"} or $event->{"message"}{"infoPtr"} == $self
MC/DC0%0/3
$self->{"flags"} & 8 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self
$self->{"flags"} & 8
not $event->{"message"}{"infoPtr"}
$event->{"message"}{"infoPtr"} == $self
Truth table0%0/4
A and not(B) or C
A= $self->{"flags"} & 8B= not $event->{"message"}{"infoPtr"}C= $event->{"message"}{"infoPtr"} == $self
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | && ( !$event->{message}{infoPtr} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | || $event->{message}{infoPtr} == $self | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | $self->zoom(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | $self->clearEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | elsif ( $event->{what} == evKeyDown ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | SWITCH: for ( $event->{keyDown}{keyCode} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | ▶ | kbTab == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | $self->focusNext( false ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | $self->clearEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | ▶ | kbShiftTab == $_ and do { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | $self->focusNext( true ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | $self->clearEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | } #/ elsif ( $event->{what} ==...) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | ▶ | elsif ( $event->{what} == evBroadcast | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/9
$event->{"what"} == 512 and $event->{"message"}{"command"} == 55 and $event->{"message"}{"infoInt"} == $self->{"number"} and $self->{"options"} & 1
$event->{"what"} == 512 and $event->{"message"}{"command"} == 55 and $event->{"message"}{"infoInt"} == $self->{"number"}
$event->{"what"} == 512 and $event->{"message"}{"command"} == 55
MC/DC0%0/4
$event->{"what"} == 512 and $event->{"message"}{"command"} == 55 and $event->{"message"}{"infoInt"} == $self->{"number"} and $self->{"options"} & 1
$event->{"what"} == 512
$event->{"message"}{"command"} == 55
$event->{"message"}{"infoInt"} == $self->{"number"}
$self->{"options"} & 1
Truth table0%0/5
A and B and C and D
A= $event->{"what"} == 512B= $event->{"message"}{"command"} == 55C= $event->{"message"}{"infoInt"} == $self->{"number"}D= $self->{"options"} & 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | && $event->{message}{command} == cmSelectWindowNum | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | && $event->{message}{infoInt} == $self->{number} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | && ( $self->{options} & ofSelectable ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | $self->select(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | $self->clearEvent( $event ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | } #/ sub handleEvent | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | ▶ | sub initFrame { # $frame ($r) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
initFrame: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | method => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | pos => [Object], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | my ( $class, $r ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | return TFrame->new( bounds => $r ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | ▶ | sub setState { # void ($aState, $enable) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setState: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | pos => [PositiveOrZeroInt, Bool], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | my ( $self, $aState, $enable ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | my $windowCommands = TCommandSet->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | $self->SUPER::setState( $aState, $enable ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | ▶ | if ( $aState & sfSelected ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | $self->setState( sfActive, $enable ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | ▶ | if ( $self->{frame} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | $self->{frame}->setState( sfActive, $enable ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | $windowCommands += cmNext; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | $windowCommands += cmPrev; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | ▶ | if ( $self->{flags} & ( wfGrow | wfMove ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | $windowCommands += cmResize; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | ▶ | if ( $self->{flags} & wfClose ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | $windowCommands += cmClose; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | ▶ | if ( $self->{flags} & wfZoom ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | $windowCommands += cmZoom; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | if ( $enable ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | $self->enableCommands( $windowCommands ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | $self->disableCommands( $windowCommands ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | } #/ if ( $aState & sfSelected) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | } #/ sub setState | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | ▶ | sub sizeLimits { # void ($min, $max) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
sizeLimits: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | pos => [Object, Object], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | my ( $self, $min, $max ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | alias: for $min ( $_[1] ) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | alias: for $max ( $_[2] ) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 0 | $self->SUPER::sizeLimits( $min, $max ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | $min = $minWinSize->clone(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | }} #/ alias: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | ▶ | sub standardScrollBar { # $scrollBar ($aOptions) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
standardScrollBar: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | pos => [PositiveOrZeroInt], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | my ( $self, $aOptions ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 0 | my $r = $self->getExtent(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | ▶ | if ( $aOptions & sbVertical ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | $r = TRect->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | ax => $r->{b}{x} - 1, ay => $r->{a}{y} + 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | bx => $r->{b}{x}, by => $r->{b}{y} - 1, | |||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | $r = TRect->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | ax => $r->{a}{x} + 2, ay => $r->{b}{y} - 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | bx => $r->{b}{x} - 2, by => $r->{b}{y}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | my $s = TScrollBar->new( bounds => $r ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | $self->insert( $s ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | ▶ | if ( $aOptions & sbHandleKeyboard ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | $s->{options} |= ofPostProcess; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | return $s; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | } #/ sub standardScrollBar | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | ▶ | sub zoom { # void () | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
zoom: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 0 | my ( $minSize, $maxSize ) = ( TPoint->new(), TPoint->new() ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | $self->sizeLimits( $minSize, $maxSize ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | ▶ | if ( $self->{size} != $maxSize ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | $self->{zoomRect} = $self->getBounds(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | my $r = TRect->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | ax => 0, ay => 0, bx => $maxSize->{x}, by => $maxSize->{y} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 0 | $self->locate( $r ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 0 | $self->locate( $self->{zoomRect} ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | } #/ sub zoom | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | ▶ | sub shutDown { # void () | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
shutDown: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 0 | state $sig = signature( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | method => Object, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | pos => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 0 | my ( $self ) = $sig->( @_ ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 0 | $self->{frame} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 0 | $self->SUPER::shutDown(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 33 | 1 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||