lib/Kephra/App/Dialog/About.pm

filter: Statementstmt 75.0% 6 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 81.8% 9 / 11 CC 1 SCAR 0.9
CC
1
Cov
75%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« lib/Kephra/App/Dialog.pm ↑ Summary lib/Kephra/App/Editor.pm »
1 1 ▶use v5.12;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 0 ▶use Wx;
Subroutine BEGIN: called CC=1 SCAR=2.6
4  
5 package Kephra::App::Dialog::About;
6 use base qw/Wx::Dialog/;
7  
8 sub new {
9 my ( $class, $parent) = @_;
10 my $self = $class->SUPER::new( $parent, -1, "About $Kephra::NAME $Kephra::VERSION" );
11 my @lblb_pro = ( [-1,-1], [-1,-1], &Wx::wxALIGN_CENTRE_HORIZONTAL );
12 my $version = Wx::StaticText->new( $self, -1, $Kephra::NAME . ' version '.$Kephra::VERSION , @lblb_pro);
13 my $author = Wx::StaticText->new( $self, -1, ' by Herbert Breunung ', @lblb_pro);
14 my $license = Wx::StaticText->new( $self, -1, ' licensed under the GPL 3 ', @lblb_pro);
15 my $libs = Wx::StaticText->new( $self, -1, 'using Perl '.$^V.' and WxPerl '. $Wx::VERSION . ' ( '. &Wx::wxVERSION_STRING. ' )', @lblb_pro);
16 my $url_lbl = Wx::StaticText->new( $self, -1, 'latest version on CPAN: ', @lblb_pro);
17 my $url = Wx::HyperlinkCtrl->new( $self, -1, 'metacpan.org/dist/Kephra', 'https://metacpan.org/dist/Kephra' );
18  
19 $self->{'close'} = Wx::Button->new( $self, -1, '&Close', [10,10], [-1, -1] );
20 Wx::Event::EVT_BUTTON( $self, $self->{'close'}, sub { $self->EndModal(1); $self->Destroy });
21  
22 my $ll_sizer = Wx::BoxSizer->new( &Wx::wxHORIZONTAL );
23 $ll_sizer->AddSpacer( 5 );
24 $ll_sizer->Add( $url_lbl, 0, &Wx::wxGROW | &Wx::wxALL, 12 );
25 $ll_sizer->Add( $url, 0, &Wx::wxGROW | &Wx::wxALIGN_RIGHT| &Wx::wxRIGHT, 10);
26
27 my $sizer = Wx::BoxSizer->new( &Wx::wxVERTICAL );
28 my $t_attrs = &Wx::wxGROW | &Wx::wxALL | &Wx::wxALIGN_CENTRE_HORIZONTAL;
29 $sizer->AddSpacer( 10 );
30 $sizer->Add( $version, 0, $t_attrs, 10 );
31 $sizer->Add( $author, 0, $t_attrs, 10 );
32 $sizer->Add( $license, 0, $t_attrs, 10 );
33 $sizer->Add( $libs, 0, $t_attrs, 10 );
34 $sizer->Add( $ll_sizer, 0, $t_attrs, 10 );
35 $sizer->Add( 0, 1, &Wx::wxEXPAND | &Wx::wxGROW);
36 $sizer->Add( $self->{'close'}, 0, &Wx::wxGROW | &Wx::wxALL, 25 );
37 $self->SetSizer( $sizer );
38 $self->SetAutoLayout( 1 );
39 $self->SetSize( 550, 320 );
40 $self->{'close'}->SetFocus;
41 return $self;
42 }
43  
44 1;
« lib/Kephra/App/Dialog.pm ↑ Summary lib/Kephra/App/Editor.pm »