Ante-Deluvian-Dialog
view release on metacpan or search on metacpan
lib/Ante/Deluvian/Dialog.pm view on Meta::CPAN
if (defined($self->{'header'})) {
$self->{'usable'}--;
$self->{'stat'}++;
$self->{'from'}++;
}
if (defined($self->{'prompt'})) {
$self->{'usable'}--;
}
$self->{'hcenter'} = int ($self->{'cols'} / 2);
$self->{'vcenter'} = int (($self->{'usable'} - $self->{'from'}) / 2);
$self->{'lines'} = $self->_drawframe();
$self->{'usable'} -= 2;
return $self;
}
#------------------------------------------------------------------
sub DESTROY {
#------------------------------------------------------------------
my $self = shift;
if ($_doRec) {
lib/Ante/Deluvian/Dialog.pm view on Meta::CPAN
my $tmpf = sprintf("%s/%s_%d", $tmpth, $_isWin ? $ENV{USERNAME} : $ENV{USER}, $self->{'curpid'});
if (! -d $tmpth) {
mkdir($tmpth);
}
$_fhRec = IO::File->new("> $tmpf");
print "File $tmpf created to record user input ...\n";
}
#------------------------------------------------------------------
sub _drawframe {
#------------------------------------------------------------------
my $self = shift;
my $rows = $self->{'rows'} - 1;
my $cols = $self->{'cols'} - 2;
my ($line, @lines, $inp);
if (defined($self->{'prompt'})) {
$rows--;
}
for my $i (0 .. $rows) {
lib/Ante/Deluvian/Dialog.pm view on Meta::CPAN
=head1 NAME
Ante::Deluvian::Dialog - Perl extension for very old style user interaction
=head1 SYNOPSIS
use Ante::Deluvian::Dialog;
$d = Ante::Deluvian::Dialog->new(
platform => "MSWIN",
drawframe => 1,
title => "Title of Window",
prompt => "Please make your choice:",
# record => 1,
# replay => "C:/temp/addialog/<username>_<pid>.txt",
);
$fdir = $d->dselect();
print "You have selected directory $fdir ...\n";
$fname = $d->fselect($fdir);
if ($pltFrm =~ /win32/i) {
$pltFrm = "MSWIN";
$isWin = $TRUE;
binmode(STDOUT, ":encoding(cp437)"); # für die korrekte Darstellung deutscher Umlaute
}
else {
$pltFrm = "UNIX";
}
my $ed = Ante::Deluvian::Dialog->new(
platform => $pltFrm,
drawframe => $TRUE,
title => "Fenster-Überschrift",
header => "Das ist der sog. Kopf",
prompt => "Bitte wählen Sie:",
# record => 1,
);
# print "Fenstergröße: $ed->{'cols'} Spalten und $ed->{'rows'} Zeilen ...\n";
$ed->_getinput();
# print Dumper $ed;
my $fdir = $ed->dselect();
( run in 0.928 second using v1.01-cache-2.11-cpan-df04353d9ac )