Source

Kephra / lib / Kephra / App / Dialog / About.pm

Full commit
use strict;
use warnings;
use Wx;

package Kephra::App::Dialog::About;
my $cache;

sub create {
	return $cache if defined $cache;
	my $dialog = $cache = Wx::Dialog->new(
		Kephra::App::Dialog::_parent(shift), -1,
		'About '.$Kephra::NAME . ' '.$Kephra::VERSION , [-1,-1], [800,600]
	);

	# change later to toolbook
	my $book = Wx::Listbook->new($dialog, -1, [-1, -1], [-1, -1], &Wx::wxBK_DEFAULT);
	my (%panel, %sizer);
	for my $label (qw(program components contributors)){
		$sizer{$label} = Wx::BoxSizer->new( &Wx::wxVERTICAL );
		$panel{$label} = Wx::Panel->new($dialog, -1);
		$panel{$label}->SetSizer($sizer{$label});
		$book->AddPage($panel{$label}, ' '.ucfirst $label.' ', 1, 0);
	}

	my $std_pos = &Wx::wxALIGN_CENTER | &Wx::wxLEFT | &Wx::wxTOP;
	my @s_params = (0, $std_pos, 10);
	$sizer{'program'}->AddSpacer(10);
	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'this program is developed to empower the user and to function as it feels to be right'), 0, $std_pos, 10 );
	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'it also aims to be beautiful, consistent and evolving'), 0, $std_pos, 10 );
	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'in an ever changing world a program should connect easy to other software'), 0, $std_pos, 10 );
	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'it also should support the user in his learning'), 0, $std_pos, 10 );
	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'at the bottom writing and especially programming is handling and organizing information'), 0, $std_pos, 10 );
	$sizer{'program'}->AddStretchSpacer(1);
	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'licensed under the GPL version 2'), 0, $std_pos, 10 );
	$sizer{'program'}->AddStretchSpacer(1);
	$sizer{'program'}->Add( Wx::StaticText->new($panel{'program'}, -1, 'dedicated to all who ever tried to write an editor'), 0, $std_pos, 10 );
	$sizer{'program'}->AddStretchSpacer(1);

	use Alien::wxWidgets;
	#scintilla version mapping
	#'2.4.2' '1.54'}
	#'2.6.2' '1.62'}
	#'2.6.3' '1.62'}
	#'2.8.4' '1.70'}
	#'2.8.7' '1.70'}
	#'2.8.10''1.70'}
	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Perl  '.$^V), 0, $std_pos, 10 );
	$sizer{'components'}->AddSpacer(10);
	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Wx  '.$Wx::VERSION), 0, $std_pos, 10 );
	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Alien::wxWidgets  '.Alien::wxWidgets->version), 0, $std_pos, 10 );
	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, &Wx::wxVERSION_STRING), 0, $std_pos, 10 );
	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Wx::Perl::ProcessStream  '.$Wx::Perl::ProcessStream::VERSION), 0, $std_pos, 10 );
	$sizer{'components'}->AddSpacer(10);
	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'YAML  '.$YAML::VERSION), 0, $std_pos, 10 );
	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'File::UserConfig  '.$File::UserConfig::VERSION), 0, $std_pos, 10 );
	$sizer{'components'}->Add( Wx::StaticText->new($panel{'components'}, -1, 'Moo  '.$Moo::VERSION), 0, $std_pos, 10 );

	$sizer{'contributors'}->AddSpacer(10);
	$sizer{'contributors'}->Add( Wx::StaticText->new($panel{'contributors'}, -1, 'Written mostly by Herbert Breunung'), 0, $std_pos, 10 );
	$sizer{'contributors'}->Add( Wx::StaticText->new($panel{'contributors'}, -1, 'CPAN ID: Lichkind'), 0, $std_pos, 10 );

	$book->SetSelection(0);

	my $sizer = Wx::BoxSizer->new( &Wx::wxVERTICAL );
	$sizer->Add($book, 1, Wx::wxGROW, 0);
	$dialog->SetSizer($sizer);


	$dialog;
}

1;