Orac-alpha
view release on metacpan or search on metacpan
orac_Shell.pm view on Meta::CPAN
}
sub clear_all {
my $self = shift;
# Clear the results window. I may have to release the
# current marks.
$self->clear_result;
# Clear the entry window.
$self->clear_entry;
return;
}
sub tba {
my $self = shift;
print RSLT_TXT "Work in progress ...\n";
0;
}
#
# Move to the results of the statement executed. Currently
# no limit on results stored, but this may change.
#
sub move_to_results {
my ($self, $c) = @_;
if( $self->rslt_txt->tagRanges( "Bold" ) ) {
$self->rslt_txt->tagRemove( 'Bold', $self->rslt_txt->tagRanges( "Bold" ) );
}
my $rslt_inx =$self->rslt_txt->index( $self->marks->get_results($c));
$self->rslt_txt->see( $rslt_inx );
$self->rslt_txt->tagAdd( 'Bold', $rslt_inx, "$rslt_inx lineend" );
}
#
# doit: Executes either from the execute button or using [/;]
#
sub doit {
my ($self, $inx) = @_;
# Change the window to pointer to Busy.
$self->dbiwd->Busy;
$inx = $self->entry_txt->index( 'insert lineend' ) unless $inx;
# get current buffer finds the sql statement.
$self->current->populate( $inx );
$self->tag_entry( q{Exec} );
# now execute it;
$self->execute_sql();
# Remove the exec tag
$self->untag_entry( q{Exec} );
# Deal with results.
$self->handle_results;
# Remove the busy pointer.
$self->dbiwd->Unbusy;
return;
}
#
# Display a dialog box to the user. Using this method until
# we create a dialog handler in the core function.
#
sub message_dialog {
my ($self, $title, $msg) = @_;
$title = "Message Dialog Box" unless $title;
$msg = "Well, you called for a message dialog, but didn't give a message"
unless $msg;
my $d = $self->dbiwd->Dialog(
-title => $title,
-text => $msg
);
return $d->Show;
}
#
#
#
sub search_forward {
my ($self, $beg) = @_;
$beg = $self->entry_txt->index( 'current' ) unless $beg;
my $end = q{end};
my $term = $self->options->statement_term . q{$};
return $self->entry_txt->search(
-regexp,
q{--},
$term,
$beg,
$end,
);
}
#
# As the names implies, this button executes all the statements in the
# current entry buffer.
#
sub execute_all_buffer {
my ($self) = @_;
#
# Start at the top of the buffer and execute each statement.
#
my $cinx = '1.0';
my $done = 0;
my $i = "";
while( !$done ) {
$self->entry_txt->see( $cinx );
$i = $self->search_forward( $cinx );
if ( !defined($i) or length($i) == 0 ) {
$done = 1;
last;
( run in 1.828 second using v1.01-cache-2.11-cpan-39bf76dae61 )