Orac
view release on metacpan or search on metacpan
orac_Base.pm view on Meta::CPAN
# been chosen, and then clear the
# screen if appropriate
if($l_clr eq 'Y'){
$self->must_f_clr();
}
}
sub must_f_clr {
my $self = shift;
# Clear out all the text on the main screen,
# and anything else that may be lurking like
# 'See SQL' buttons.
$self->{Text_var}->delete('1.0','end');
}
sub see_plsql {
my $self = shift;
# Helps put up a button on the page, so that the generative
# SQL code can be viewed for validation purposes
my ($res,$dum) = @_;
my $b = $self->{Text_var}->Button(
-text=>$main::ssq,
-command=>
sub{ $self->see_sql( $self->{Main_window},
$res) }
);
# Now slap up the button
$self->{Text_var}->insert('end', "\n\n ");
$self->{Text_var}->window('create','end', -window=>$b);
$self->{Text_var}->insert('end', "\n\n");
}
sub see_sql {
my $self = shift;
# Produce the box that contains the viewable SQL
$_[0]->Busy;
my $d = $_[0]->DialogBox(-title=>$main::ssq);
my $t = $d->Scrolled( 'Text',
-height=>16,
-width=>60,
-wrap=>'none',
-cursor=>undef,
-foreground=>$main::fc,
-background=>$main::bc);
$t->pack(-expand=>1,-fil=>'both');
tie (*THIS_TEXT,'Tk::Text',$t);
print THIS_TEXT "$_[1]\n";
$d->Show;
$_[0]->Unbusy;
}
sub about_orac {
my $self = shift;
# Slap up the various files onto the
# main TEXT widget
my $print_out = $self->gf_str( $_[0] );
$self->{Text_var}->insert('end', $print_out);
}
# generic file into a string
sub gf_str
{
my $self = shift;
my $file = $_[0];
my $rt = "";
if (-r $file)
{
open(SQL, "<$file") or return "ERROR: can not open $file\n";
$rt = $rt . $_ while(<SQL>);
close(SQL);
}
return $rt;
}
sub need_sys
{
my $self = shift;
return $self->{dont_need_sys};
}
sub need_ps
{
my $self = shift;
return $self->{dont_need_ps};
}
###############################################################################
# Experimental functions
###############################################################################
=head1 EXPERIMENTAL METHODS
These functions are ones that I'm developing and should not be called
by anyone else, unless you like living dangerously. :-) It is hoped that
one day, they'll be good enough to move into orac_Base.
&generic_hlist()
&sql_file_exists()
Andy, you can move this if you want. (i.e. feel brave :-)
=cut
# variable to make generic_hlist() & friends work.
( run in 0.771 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )