package Options;

sub new {
my $pkg  = shift;
my $setup = {};


$setup->{Buttons} 		= [];
$setup->{Help}			= [];
$setup->{GridRowValue}		= 1;
$setup->{GridColumnValue}	= 1;
$setup->{RadioOptionsValue}	= 'Completed Digests';
$setup->{BrowseEnzymeValue}	= 'HindIII';
bless $setup,$pkg;
return $setup;
}#end new


sub Display {
my ($pkg,$frame) = @_;
my $FrameOptionsWidget;
my $FrameEnzymeWidget;
my $GridRowValue 	= 1;
my $GridColumnValue 	= 1;
				
				
			
my $b = $$frame->BrowseEntry(		-width 			=> 20,
					-fg 			=> 'blue',
					-browsecmd 		=> sub{
									my $option;
									if($pkg->{RadioOptionsValue} =~ /^Tag/){$option = 2;}
									if($pkg->{RadioOptionsValue} =~ /^Compl/){$option = 1;}
									if($pkg->{RadioOptionsValue} =~ /^Ong/){$option = 0;}
									
									
									
									$pkg->{List}->Query($option);
									},
					-font			=> '-adobe-helvetica-bold-r-normal--17-120-100-100-p-92-iso8859-1',
					-state 			=> 'readonly',
					-variable 		=> \$pkg->{RadioOptionsValue},
			)->grid(	-row 			=> $pkg->{GridRowValue},
					-column 		=> $pkg->{GridColumnValue},
					-sticky			=> 'w');
					
$b->Subwidget("slistbox")->Subwidget("listbox")->configure(	-font 	=>'-adobe-helvetica-bold-r-normal--17-120-100-100-p-92-iso8859-1',
								-fg 	=> 'blue',
								-width 	=> 20,
								-height	=> 3);	

$b->Subwidget("entry")->Subwidget("entry")->configure(		-bg 	=> 'grey85');	
$b->Subwidget("entry")->Subwidget("label")->configure(		-text 	=> 'Option',
								-fg	=> 'black');
			
$b->insert('end',('Ongoing Digests','Completed Digests'));
#$b->insert('end','Completed Digests');
#$b->insert('end','Tagged, no Digest');








}


sub Setresults {
my $pkg = shift;
$pkg->{List} = shift;

}


sub Listsql {
my $pkg = shift;

my $sql;

if($pkg->{RadioOptionsValue} eq 'Completed Digests')
{
	$sql = "SELECT CLONENAME||'-'||PREP_NUMBER, ID_PREP
		FROM	DNAPREP D, RDREQUEST R
		WHERE	";
}
elsif($pkg->{RadioOptionsValue} eq 'View Requested Aliquots')
{
	$sql = "SELECT CLONENAME||'-'||PREP_NUMBER, ID_PREP
		FROM	DNAPREP D, RDREQUEST R
		WHERE	";
}
return $sql;

}



sub Detailsql {
my $pkg = shift;

my $sql;

if($pkg->{RadioOptionsValue} eq 'View Completed Digests')
{
	$sql = "SELECT CLONENAME||'-'||PREP_NUMBER, ID_PREP
		FROM	DNAPREP D, RDREQUEST R
		WHERE	";
}
elsif($pkg->{RadioOptionsValue} eq 'View Requested Aliquots')
{
	$sql = "SELECT CLONENAME||'-'||PREP_NUMBER, ID_PREP
		FROM	DNAPREP D, RDREQUEST R
		WHERE	";
}
return $sql;

}

1;







