: # feed this into perl
	eval 'exec perl -S $0 ${1+"$@"}'
		if $running_under_some_shell;

#
# $Id: bounce,v 0.1 2001/04/22 17:57:04 ram Exp $
#
#  Copyright (c) 1998-2001, Raphael Manfredi
#  Copyright (c) 2000-2001, Christophe Dehaudt
#  
#  You may redistribute only under the terms of the Artistic License,
#  as specified in the README file that comes with the distribution.
#
# HISTORY
# $Log: bounce,v $
# Revision 0.1  2001/04/22 17:57:04  ram
# Baseline for first Alpha release.
#
# $EndLog$
#

require CGI::MxScreen;

package SCREEN_A;

use CGI qw/:standard/;
use CGI::MxScreen::HTML;
use base qw(CGI::MxScreen::Screen);

sub display {
	my $self = shift;
	print center(h1($self->screen_title));

	$self->bounce("C", "A") if param("id");

	my $ok = $self->record_button(
		-name		=> "ok",
		-value		=> "OK",
		-target		=> "B",
	);

	print submit($ok->properties);
}

package SCREEN_B;

use CGI qw/:standard/;
use CGI::MxScreen::HTML;
use base qw(CGI::MxScreen::Screen);

sub display {
	my $self = shift;
	print center(h1($self->screen_title));

	my $next = $self->record_button(
		-name		=> "next",
		-value		=> "Next",
		-target		=> ["C", "B"],
	);

	print submit($next->properties);
}

package SCREEN_C;

use CGI qw/:standard/;
use CGI::MxScreen::HTML;
use base qw(CGI::MxScreen::Screen);

sub display {
	my $self = shift;
	my ($from) = @_;
	print center(h1($self->screen_title . " from $from"));

	my $back = $self->record_button(
		-name		=> "back",
		-value		=> "Back",
		-target		=> "B",
	);

	print submit($back->properties);
}

package main;

my $manager = CGI::MxScreen->make(
	-screens	=>
		{
			'A'	=> [-class => 'SCREEN_A',	-title => "Screen A" ],
			'B'	=> [-class => 'SCREEN_B',	-title => "Screen B" ],
			'C'	=> [-class => 'SCREEN_C',	-title => "Screen C" ],
		},
	-initial	=> ['A'],
);

$manager->play();

