From 490c97f400f9eb79dd939d02357dd0dd0c70600b Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 5 Feb 2009 00:56:42 +0000 Subject: add graphic to wizard git-svn-id: svn://tug.org/texlive/trunk@12085 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/installer/install-menu-wizard.pl | 55 ++++++++++++++++++-------- Master/tlpkg/installer/texlive2008-wizard.png | Bin 0 -> 30448 bytes 2 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 Master/tlpkg/installer/texlive2008-wizard.png diff --git a/Master/tlpkg/installer/install-menu-wizard.pl b/Master/tlpkg/installer/install-menu-wizard.pl index 4f55bd6afbd..ac20e0bba7d 100644 --- a/Master/tlpkg/installer/install-menu-wizard.pl +++ b/Master/tlpkg/installer/install-menu-wizard.pl @@ -212,34 +212,51 @@ if (($::lang ne "en") && ($::lang ne "C")) { } -my $LEFT = 50; +my $LEFT = 130; +my $RIGHT = 50; my $TOP = 50; -my $BOTTOM = 400; +my $BOTTOM = 50; my $INF = 300; +my $MWIDTH = 730; +my $MHEIGHT = 480; +my $TITLEHEIGHT = 30; +my $BUTTONSHEIGHT = 50; +my $INNERWIDTH = ($MWIDTH - $LEFT - $RIGHT); +my $INNERHEIGHT = ($MHEIGHT - $TOP - $TITLEHEIGHT - $BOTTOM - $BUTTONSHEIGHT); my $fmain; +my $fbuttons; +my $ftitle; my $counter; my $lineskip; ################# WELCOME SCREEN ###################################### sub run_menu_wizard { - $mw = Tk::MainWindow->new(-width => 640, -height => 480); + $mw = Tk::MainWindow->new(-width => $MWIDTH, -height => $MHEIGHT); setup_hooks_wizard(); $dest = $vars{'TEXDIR'}; - $tit = $mw->Label(-text => "TeX Live 2008 Installation"); + my $img = $mw->Photo(-format => 'png', -file => "$::installerdir/tlpkg/installer/texlive2008-wizard.png"); + $mw->Label(-image => $img, -background => "#0078b8")->place(-x => 0, -y => 0); + + $ftitle = $mw->Frame(-height => $TITLEHEIGHT, -width => $INNERWIDTH); + $ftitle->update; + $ftitle->place(-x => $LEFT, -y => $TOP); + + $tit = $ftitle->Label(-text => "TeX Live 2008 Installation"); + $usedfont= $tit->cget("-font"); $lineskip = $usedfont->metrics("-linespace"); - $tit->place(-x => $LEFT, -y => $TOP); + $tit->place(-x => 0, -y => 0); - $counter = $mw->Label(-text => "1/4"); - $counter->place(-x => (640 - $LEFT), -y => $TOP, -anchor => "ne"); + $counter = $ftitle->Label(-text => "1/4"); + $counter->place(-x => $INNERWIDTH, -y => 0, -anchor => "ne"); - $fmain = $mw->Frame(-height => ($BOTTOM - $TOP -50), -width => 540); + $fmain = $mw->Frame(-height => $INNERHEIGHT, -width => $INNERWIDTH); #, -borderwidth => 1, -relief => "ridge"); - $fmain->place(-x => $LEFT, -y => ($TOP + 30)); + $fmain->place(-x => $LEFT, -y => ($TOP + $TITLEHEIGHT)); $can = $mw->Button(-width => 10, -relief => "ridge", -text => "Cancel", @@ -247,10 +264,11 @@ sub run_menu_wizard { $nxt = $mw->Button(-width => 10, -relief => "ridge", -text => "Next >"); $prv = $mw->Button(-width => 10, -relief => "ridge", -text => "< Back"); - $can->place(-x => $LEFT, -y => $BOTTOM); + $can->place(-x => $LEFT, -y => ($MHEIGHT - $BOTTOM), -anchor => "sw"); - my $rb = 640 - $LEFT; - $nxt->place(-x => $rb , -y => $BOTTOM, -anchor => "ne"); + my $rb = $MWIDTH - $RIGHT; + $nxt->place(-x => ($MWIDTH - $RIGHT) , + -y => ($MHEIGHT - $BOTTOM), -anchor => "se"); reset_start(); @@ -264,6 +282,7 @@ sub reset_start { $_->destroy; } $counter->configure(-text => "1/4"); + $prv->placeForget; my $inf = $fmain->Label(-text => "Welcome to the installation of TeX Live 2008\nhttp://tug.org/texlive\n\nThis wizard will guide you through the installation.", -justify => "left"); $inf->place(-x => 0, -y => 100); @@ -309,7 +328,7 @@ sub ask_path { $ytmp += ($lineskip + 10); $val->place(-x => 0, -y => $ytmp, -anchor => "w"); - $but->place(-x => $fmain->width, -y => $ytmp, -anchor => "e"); + $but->place(-x => $INNERWIDTH, -y => $ytmp, -anchor => "e"); $warning = $fmain->Label(-foreground => "red"); check_show_warning(); @@ -320,7 +339,7 @@ sub ask_path { $pa->place(-x => 0, -y => $ytmp + 30); - $cb->place(-x => $fmain->width, -y => $fmain->height, -anchor => "se"); + $cb->place(-x => $INNERWIDTH, -y => $INNERHEIGHT, -anchor => "se"); $fmain->Label(-text => "Total size needed: $vars{'total_size'} MB", -justify => "left" @@ -329,11 +348,11 @@ sub ask_path { $prv->configure(-text => "< Prev", -command => \&reset_start ); $nxt->configure(-text => "Next >", -command => \&ask_go ); - my $rb = 640 - $LEFT; + my $rb = $MWIDTH - $RIGHT; $rb -= $nxt->width; $rb -= 30; - $prv->place(-x => $rb, -y => $BOTTOM, -anchor => "ne"); + $prv->place(-x => $rb, -y => ($MHEIGHT - $BOTTOM), -anchor => "se"); } sub check_show_warning { @@ -355,9 +374,11 @@ sub change_path { my $entry = $sw->Entry(-textvariable => $val, -width => 60); $entry->pack(-padx => "2m", -pady => "2m"); my $f = $sw->Frame; - my $okbutton = $f->Button(-text => $text{'ok'}, -relief => "ridge", + my $okbutton = $f->Button(-text => $text{'ok'}, -width => 10, + -relief => "ridge", -command => sub { $val = $entry->get; callback_change_texdir($val) ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m"); my $cancelbutton = $f->Button(-text => $text{'cancel'}, -relief => "ridge", + -width => 10, -command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m"); $f->pack(-expand => 'x'); # bindings diff --git a/Master/tlpkg/installer/texlive2008-wizard.png b/Master/tlpkg/installer/texlive2008-wizard.png new file mode 100644 index 00000000000..0d70d328616 Binary files /dev/null and b/Master/tlpkg/installer/texlive2008-wizard.png differ -- cgit v1.2.3