ObjStore
view release on metacpan or search on metacpan
unloop();
}
my $reaper = QtREAPER->new;
$reaper->connect($app, 'lastWindowClosed()', 'shutdown()');
my $fd = Qt::xfd();
Event->io(fd => $fd, timeout => .25, poll => 'r',
cb => sub { $app->processEvents(3000); });
package QtposhAbout;
use Qt 2.00;
use vars qw(@ISA);
@ISA = 'Qt::Dialog';
sub new {
my $o = shift->SUPER::new(@_);
my (@w,$f,$w,$l);
$o->setCaption("About...");
$o->resize(350,215);
$f = $o;
$l = Qt::BoxLayout->new($f, Qt::BoxLayout::TopToBottom, 10);
push @w,$l;
$w = Qt::Label->new("qtposh $ObjStore::VERSION", $f);
$w->setAlignment(Qt::AlignCenter);
$w->setFont(Qt::Font->new("times", 50, Qt::Font::Black));
push @w,$w;
$l->addWidget($w,2);
$w = Qt::Label->new(
q[
Copyright © 1998-1999 Joshua Nathaniel Pritikin. All rights reserved.
qtposh is part of the ObjStore perl extension. This package is free
software and is provided "as is" without express or implied warranty.
It may be used, redistributed and/or modified under the terms of the
Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)
], $f);
$w->setFont(Qt::Font->new('helvetica',10));
$w->setAlignment(Qt::AlignLeft);
push @w,$w;
$l->addWidget($w,3);
$w = Qt::PushButton->new("Ok", $f);
$o->connect($w, 'clicked()', 'accept()');
push @w, $w;
$l->addWidget($w,1);
$$o{widgets} = \@w;
$o;
}
package Editor;
use ObjStore;
use IO::File;
use Qt;
use vars qw(@ISA $USER $ABOUT);
@ISA = qw(Qt::Widget);
$USER = scalar(getpwuid($>));
sub new {
my $o = shift->SUPER::new();
$o->resize(500,500);
$$o{db} = shift;
$o->setCaption("qtposh ".$$o{db}->get_pathname);
my @w;
my $m = Qt::MenuBar->new($o);
push @w, $m;
my $file = Qt::PopupMenu->new();
push @w, $file;
$m->insertItem('File', $file);
$file->insertItem('&New Window...', $o, 'opendb()');
$file->insertSeparator();
$file->insertItem('&Open...', $o, 'load()');
$file->insertItem('&Save...', $o, 'save()');
$file->insertItem('&Print...', $o, 'printer()');
$file->insertSeparator();
$file->insertItem('&Close Window', $o, 'closepane()');
my $help = Qt::PopupMenu->new();
push @w, $help;
$m->insertSeparator;
$m->insertItem('Help', $help);
$help->insertItem('How Does it Work?...', $o, 'how()');
$help->insertItem('Commands...', $o, 'simple_help()');
$help->insertSeparator();
$help->insertItem('About...', $o, 'about()');
my $l = Qt::BoxLayout->new($o, Qt::BoxLayout::Down);
push @w, $l;
$l->addSpacing($m->height()+2);
$$o{in} = Qt::MultiLineEdit->new($o);
$$o{in}->setFocus();
$$o{in}->setFrameStyle(Qt::Frame::Box | Qt::Frame::Plain);
$$o{in}->setLineWidth(1);
$$o{in}->setText("\n\n");
$$o{in}->setCursorPosition(10000, 0);
$o->connect($$o{in}, 'returnPressed()', 'execute()');
$l->addWidget($$o{in},3);
# $l->setRowStretch(1,2);
$l->addSpacing(3);
$$o{out} = Qt::MultiLineEdit->new($o);
$$o{out}->setFocusPolicy(Qt::Widget::NoFocus);
$$o{out}->setFrameStyle(Qt::Frame::Box | Qt::Frame::Plain);
$$o{out}->setLineWidth(1);
$$o{out}->setReadOnly(1);
$$o{out}->setText("connecting to ".$$o{db}->get_pathname."...");
$l->addWidget($$o{out},8);
# $l->setRowStretch(2,3);
$l->activate;
$$o{gui} = \@w;
$$o{timer} = Event->timer(interval => 1, cb => [$o,'refresh']);
$o->show;
$o;
( run in 2.827 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )