5
#############################################################################
7
## Based on lib/Wx/DemoModules/wxProgressDialog.pm
8
## from the wxDemo ## written by Mattia Barbon
9
## Copyright: (c) The Padre development team
10
## Licence: This program is free software; you can redistribute it and/or
11
## modify it under the same terms as Perl itself
12
#############################################################################
14
use Wx qw(:progressdialog);
17
sub show_progress_bar {
22
my $dialog = Wx::ProgressDialog->new( 'Progress dialog example',
23
'An informative message',
25
wxPD_CAN_ABORT|wxPD_AUTO_HIDE|
26
wxPD_APP_MODAL|wxPD_ELAPSED_TIME|
28
wxPD_REMAINING_TIME );
31
foreach my $i ( 1 .. $max ) {
34
$continue = $dialog->Update( $i, "That's all, folks!" );
35
} elsif( $i == int( $max / 2 ) ) {
36
$continue = $dialog->Update( $i, "Only a half left" );
38
$continue = $dialog->Update( $i );
40
last unless $continue;
43
Wx::LogMessage( $continue ? "Countdown from $max finished" :
44
"Progress dialog aborted" );