NAME
Win32::GUI::SplashScreen - Win32::GUI SplashScreen support
SYNOPSIS
use Win32:GUI::SplashScreen;
Win32::GUI::SplashScreen::Show([%options]);
Win32::GUI::SplashScreen::Done([$now]);
Win32::GUI::SplashScreen is a module that works with Win32::GUI to implement a Windows application splash screen.
It can generate a simple splash screen from basic text information, or use a supplied image. The splash screen can be configured to have a minimum display time (so that users always have time to read any information), and can be taken down automatically once your program reaches the dialog phase.
METHODS
Show
Win32::GUI::SplashScreen::Show(%options);
where %options
are:
- -file
-
The file or resource name containing the splash image to load. Defaults to SPLASH. First attempt is to load the image from the running executable as a resource - this is for people who have packaged their GUI with perl2exe, PAR or some similar packaging tool. If not found as a resource, then attempts are made to find file in the filesystem: The script directory, the current directory and
$ENV{PAR_TEMP}
directories are searched for file with no extension, and with .bmp, .jpg and .jpeg extensions. JPEG support is only available if Win32::GUI::DIBitmap is available. - -mintime
-
The minimum time for which the splash screen should be shown in seconds. Defaults to 3 seconds.
- -info
-
If a user defined bitmap is not supplied, or not foound, then Win32::GUI::SplashScreen generates it's own internal splash screen. When doing this any text provided by the -info option is drawn in the top left corner of the splash screen.
- -copyright
-
If a user defined bitmap is not supplied, or not foound, then Win32::GUI::SplashScreen generates it's own internal splash screen. When doing this any text provided by the -copyright option is drawn in the top left corner of the splash screen, under any text provided by the -info option.
If no other action is taken the splash screen will be taken down automatically once -mintime seconds have passsed and you have entered the dialog phase.
Only one splash screen can be diaplayed at a time.
returns 1
on success and 0
on failure.
Done
Win32::GUI::SplashScreen::Done([$now]);
Done()
is a blocking call that waits until the -mintime has passed since the splash screen was displayed, and takes it down.
Perhaps more usefully, if called with a TRUE parameter, takes the splash screen down NOW.
Returns 1
on success and 0
on failure (for example if there is no splash screen showing currently).
AUTHOR
Robert May, <robertmay@cpan.org>
REQUIRES
Win32::GUI v1.02 or later.
Win32::GUI::DIBitmap for JPEG support.
EXAMPLES
#!perl -w
use strict;
use warnings;
use Win32::GUI 1.02 ();
use Win32::GUI::SplashScreen;
# Create and display the splash screen
# Uses default filename of 'SPLASH', and searches for
# SPLASH.bmp and SPLASH.jp[e]g
Win32::GUI::SplashScreen::Show();
# Create the main window
my $mw = Win32::GUI::Window->new(
-title => "SplashScreen Demo 1",
-size => [700, 500],
) or die "Creating Main Window";
# do some other stuff
sleep(1);
# show the main window and enter the dialog phase
# splash screen taken down after (default) 3 seconds
$mw->Center();
$mw->Show();
Win32::GUI::Dialog();
exit(0);
USING WITH PAR
If you pack your GUI into an executable using PAR (See http://par.perl.org/) then add your bitmap to the PAR distributable with the -a option,
pp -a SPLASHFILE.bmp -o xxx.exe xxx.pl
where SPLASHFILE.bmp is the name of your splash screen image and Win32::GUI::SplashScreen will find it.
BUGS
See the TODO file from the disribution.
ACKNOWLEDGEMENTS
Many thanks to the Win32::GUI developers at http://sourceforge.net/projects/perl-win32-gui/
COPYRIGHT & LICENSE
Copyright 2005..2009 Robert May, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.