#!/usr/local/bin/perl

#$Id: printChoice.pm,v 1.7 1998/03/25 10:01:05 dn1 Exp $
#$Log: printChoice.pm,v $
# Revision 1.7  1998/03/25  10:01:05  dn1
# *** empty log message ***
#
# Revision 1.6  1998/03/25  09:55:30  dn1
# *** empty log message ***
#
# Revision 1.5  1998/03/25  09:52:56  dn1
# *** empty log message ***
#
# Revision 1.4  1998/03/25  09:48:38  dn1
# changed font to Tk default...
#
# Revision 1.3  1998/03/24  13:46:15  dn1
# *** empty log message ***
#
# Revision 1.2  1998/03/24  13:45:58  dn1
# *** empty log message ***
#


require Exporter;
use Tk;
@document::ISA = qw(Exporter);
@document::EXPORT = qw(printChoice);

# DN1
##################################### 
# A choice when printing out orders #
#####################################
# Supply the module with the mainWindow of the main-application.
# Returns 'all', 'partial' or 'minimal'

sub printChoice {

#my ($mainWindow) = @_;
#my $mw = $mainWindow->Toplevel;
    my $mw = MainWindow->new;
    $mw->configure(-cursor  => 'hand2');
    $mw->wm('minsize', 550, 160); 
    $mw->wm('maxsize', 550, 160);
    $mw->packPropagate(0);
    my $frame = $mw->Frame->pack();
    my $label = $frame->Label(-text => "Please select your printing requirements. ",
			      -relief => 'groove',
			      -height => 1,
			      #-font => '-*-helvetica-*-*-*-*-24-*-*-*-*-*-*-*',
			      -background => 'white'
			      );

    $label->pack(-side=> 'top');
    my %buttonLabels = (
			"Mainmaps (plus orders), submaps (plus orders), plates needed" => "all",
			"Mainmaps (plus orders), plates needed" => "partial",
			"Mainmaps (plus orders)" => "minimal"
			);
    my @buttonLabels = keys %buttonLabels;
    my $choice = $buttonLabels[2];
    my $buttonCount = 0;
    foreach $button (@buttonLabels) {
	$buttonList[$buttonCount] = $frame->Radiobutton (
							 -text => $button,
							 -value => $button,
							 -variable => \$choice);
	$buttonList[$buttonCount]->pack(-side => 'top', -anchor => 'w');
	$buttonCount++;
    }
    my $pushButton = $frame->Button(
				    -text => 'Print',
				    -command => sub { 
					$mw->destroy();}
				    );
    $pushButton->pack (
		       -side => 'bottom',
		       -expand => 'yes',
		       -fill => 'x');
    $frame->waitWindow;
    return ($buttonLabels{$choice});

}

1;

