App-Music-ChordPro
view release on metacpan or search on metacpan
script/wxchordpro.pl view on Meta::CPAN
"logstderr",
'maximize',
'geometry=s',
'config=s',
'stc!',
'webview!',
'wxtng!',
'dark!',
'new',
'quit',
'trace',
'help|?',
'debug',
) or $options->{help} )
{
app_usage(2);
}
# This is to allow installers to fake an initial run.
exit if $options->{quit};
if ( $options->{version} ) {
app_ident();
exit(0);
}
app_ident() if $options->{ident};
return $options;
}
sub app_ident {
print STDERR ("This is $my_package [$my_name $my_version]\n");
print STDERR ( ::runtimeinfo("short"), "\n");
}
sub app_usage {
my ($exit) = @_;
app_ident();
print STDERR <<EndOfUsage;
Usage: $0 [options] [file ...]
--maximize show full screen
--help this message
--ident show identification
--version -V show identification and exit
--verbose verbose information
--quit don't do anything
EndOfUsage
exit $exit if defined $exit && $exit != 0;
}
package ChordPro::Wx::WxUpdateRequired;
# Dialog to be shown if Wx is not up to date.
use Wx qw[:everything];
use base qw(Wx::Dialog);
use strict;
sub new {
my $self = shift->SUPER::new( undef, wxID_ANY,
"Update Required",
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
# Main sizer.
my $sz = Wx::BoxSizer->new(wxVERTICAL);
# sz3: Icon (left), info lines (right side).
my $sz3 = Wx::BoxSizer->new(wxHORIZONTAL);
# sz4: Information lines, right side,
my $sz4 = Wx::BoxSizer->new(wxVERTICAL);
$sz->Add( $sz3, 0, wxEXPAND, 0 );
$sz3->Add( $sz4, 0, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 20 );
my $icon = ChordPro::Paths->get->findres( "chordpro-splash.png",
class => "icons" )
|| ChordPro::Paths->get->findres( "missing.png",
class => "icons" );
Wx::Image::AddHandler(Wx::PNGHandler->new);
$sz3->Insert( 0,
Wx::StaticBitmap->new( $self, wxID_ANY,
Wx::Bitmap->new( $icon, wxBITMAP_TYPE_PNG) ),
0, 0, 0 );
for ( Wx::StaticText->new( $self, wxID_ANY,
"Software Update Required" ) ) {
$_->SetForegroundColour( Wx::Colour->new(0, 104, 217) );
$_->SetFont( Wx::Font->new( 20, wxFONTFAMILY_DEFAULT,
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL,
0, "" ) );
$sz4->Add( $_, 0, wxBOTTOM|wxTOP, 20 );
}
$sz4->Add( Wx::StaticText->new( $self, wxID_ANY,
"ChordPro requires Wx (wxPerl) ".
"version $::Wx_min or later." ),
0, wxTOP, 20 );
$sz4->Add( Wx::StaticText->new( $self, wxID_ANY,
"You currently have Wx ".
"version $Wx::VERSION." ),
0, wxBOTTOM|wxTOP, 10 );
# Bottom line (with hyperlink).
for ( Wx::BoxSizer->new(wxHORIZONTAL) ) {
$_->Add( Wx::StaticText->new( $self, wxID_ANY,
"Please consult the "),
0, wxALIGN_CENTER_VERTICAL, 0 );
$_->Add( Wx::HyperlinkCtrl->new( $self, wxID_ANY,
" installation instructions ",
"https://www.chordpro.org/chordpro/chordpro-installation/",
wxDefaultPosition,
wxDefaultSize,
wxHL_DEFAULT_STYLE ),
0, wxALIGN_CENTER_VERTICAL, 0 );
$_->Add( Wx::StaticText->new( $self, wxID_ANY,
" on the ChordPro web site." ),
0, wxALIGN_CENTER_VERTICAL, 0 );
$sz4->Add( $_, 0, wxEXPAND, 0 );
( run in 3.892 seconds using v1.01-cache-2.11-cpan-97f6503c9c8 )