package Tk::Wizard; $Tk::Wizard::DEBUG = undef; $Tk::Wizard::VERSION = do { my @r = (q$Revision: 1.945 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; =head1 NAME Tk::Wizard - GUI for step-by-step interactive logical process =cut use lib '../'; use Carp; use Config; use Cwd; use Tk; use Tk::DirTree; use Tk::Wizard::Image; use File::Path; use Tk::ROText; use Tk::MainWindow; use Tk::Frame; BEGIN { require Exporter; # Exporting Tk's MainLoop so that @ISA = ( "Exporter",); # I can just use strict and Tk::Wizard without @EXPORT = ("MainLoop"); # having to use Tk } our $DEFAULT_WIDTH = 550; # 400 our $DEFAULT_HEIGHT = 360; # 316 #use base qw(Tk::MainWindow); use base qw[Tk::Derived Tk::Toplevel ]; Tk::Widget->Construct('Wizard'); use strict; if ($^V and $^V gt v5.8.0){ eval "use warnings"; } use vars qw/%LABELS/; # See INTERNATIONALISATION %LABELS = ( # Buttons BACK => "< Back", NEXT => "Next >", FINISH => "Finish", CANCEL => "Cancel", HELP => "Help", OK => "OK", ); =head1 SYNOPSIS use Tk::Wizard; my $wizard = new Tk::Wizard; # # OR # my $MW = Tk::MainWindow->new; # my $wizard = $MW->Wizard(); # $wizard->configure( -property=>'value'); $wizard->cget( "-property"); $wizard->addPage( ... code-ref to anything returning a Tk::Frame ... ); $wizard->addPage( sub { return $wizard->blank_frame( -title => "Page Title", -subtitle => "Sub-title", -text => "Some text.", -wait => $seconds_b4_proceeding_anyway, ); }); $wizard->Show; MainLoop; exit; To avoid 50 lines of SYNOPSIS, please see the files included with the distribution in the test directory: F. These are just Perl files that are run during the C phase of installation: you may rename them without harm once you have installed the module. =head1 CHANGES The widget now works from within a C, or creates its own as necessary for backwards compatability. The optoin C<-image_dir> has been deprecated, and the once-used binary images have been dropped from the distribution in favour of Base64- encoded images. More and other details in F. =head1 DEPENDENCIES C and modules of the current standard Perl Tk distribution. On MS Win32 only: C. =head1 EXPORTS MainLoop(); This is so that I can say C without having to C. You can always C to avoid importing this. =head1 DESCRIPTION In the context of this namespace, a Wizard is defined as a graphic user interface (GUI) that presents information, and possibly performs tasks, step-by-step via a series of different pages. Pages (or 'screens', or 'Wizard frames') may be chosen logically depending upon user input. The C module automates a large part of the creation of a wizard program to collect information and then perform some complex task based upon it. The wizard feel is largly based upon the Microsoft(TM,etc) wizard style: the default is simillar to that found in Windows 2000, though the more traditional Windows 95-like feel is also supported (see the C<-style> entry in L. Sub-classing the module to provide different look-and-feel is highly encourage: please see L. If anyone would like to do a I or I version, please let me know how you would like to handle the buttons. I'm not hot on advertising widgets. NB: B Please read L. =head1 ADVERTISED SUB-WIDGETS Still untested. Use: $wizard->Subwidget('buttonpanel'); =over 4 =item buttonPanel The C that holds the navigation buttons and optional help button. =item nextButton =item backButton =item cancelButton =item helpButton The buttons in the C. =item tagLine The line above the C =item tagText The grayed-out text above the C. =item tagBox The frame holding the tag text. =item imagePane Either the image on the first and last pages. Also: for C<95> C