AssistantFrames

 view release on metacpan or  search on metacpan

AssistantFrames.pm  view on Meta::CPAN

   my $class = shift;
   my $self = {};
   $self->{'answers'} = [];
   $self->{'frames'} = [];
   $self->{'sequence'} = [];
   $self->{'running'} = 1;
   bless $self, $class;
   return $self;
}

sub backupOne {
   my $self = shift;
   my $dlgs = $self->{'frames'};
   my $answers = $self->{'answers'};
   while ($self->getLastFrameRaw() =~ /^\[.*\]$/) {
      pop @$dlgs;
      pop @$answers;
   }
   if (@$dlgs > 0) {
      pop @$dlgs;
      pop @$answers;

AssistantFrames.pm  view on Meta::CPAN

sub standardAction {
   my $self = shift;
   my $name = shift;
   my $dlg = shift;
   if ($dlg->{'cont'}) {
      $self->continueOne($name, $dlg->{'value'});
      if ($name eq "<finish>") {
         $self->{'running'} = 0;
      }
   } elsif ($dlg->{'back'}) {
      $self->backupOne();
      if ($name eq "<start>") {
         $self->{'running'} = 0;
      }
   } elsif ($dlg->{'abort'}) {
      $self->abort();
   }
}

sub startFrame {
   my $self = shift;

AssistantFrames.pm  view on Meta::CPAN

=head1 METHODS

=over 4

=item running()

This checks if the assistant object is in running state. If the "<start>" frame
is aborted, this is reset to 0. If the "<finish>" frame is accepted, this is
reset to 0.

=item backupOne()

This method backs up one frame. This is internally used, you seldom have to
invoke it yourself.

=item continueOne(name, value)

This method adds a successfull frame to the sequence. This is used internally,
so you shouldn't need to call this yourself.

=item abort([text])

README  view on Meta::CPAN


    Version()
        This method returns the version of the module.

METHODS
    running()
        This checks if the assistant object is in running state. If
        the "<start>" frame is aborted, this is reset to 0. If the
        "<finish>" frame is accepted, this is reset to 0.

    backupOne()
        This method backs up one frame. This is internally used, you
        seldom have to invoke it yourself.

    continueOne(name, value)
        This method adds a successfull frame to the sequence. This
        is used internally, so you shouldn't need to call this
        yourself.

    abort([text])
        This method stops the assistant. If "text" is given, it



( run in 0.518 second using v1.01-cache-2.11-cpan-49f99fa48dc )