diff options
author | Timothy Pearson <[email protected]> | 2012-01-01 18:29:30 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-01-01 18:29:30 -0600 |
commit | b2af005db21bd8fd068cb79b2ae700953128af2c (patch) | |
tree | abd0ed633726bf0bbecb57d30e92836c31e02695 /PerlQt/tutorials/t14/LCDRange.pm | |
parent | c1b9383f2032d82db5eb8918dca885e37a901dde (diff) | |
download | libtqt-perl-b2af005db21bd8fd068cb79b2ae700953128af2c.tar.gz libtqt-perl-b2af005db21bd8fd068cb79b2ae700953128af2c.zip |
Move PerlQt
Diffstat (limited to 'PerlQt/tutorials/t14/LCDRange.pm')
-rw-r--r-- | PerlQt/tutorials/t14/LCDRange.pm | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/PerlQt/tutorials/t14/LCDRange.pm b/PerlQt/tutorials/t14/LCDRange.pm deleted file mode 100644 index 1647e85..0000000 --- a/PerlQt/tutorials/t14/LCDRange.pm +++ /dev/null @@ -1,67 +0,0 @@ -package LCDRange; -use strict; -use TQt; -use TQt::isa qw(TQt::Widget); -use TQt::slots - setValue => ['int'], - setRange => ['int', 'int'], - setText => ['const char*']; -use TQt::signals - valueChanged => ['int']; -use TQt::attributes qw( - slider - label -); - -sub NEW { - my $class = shift; - my $s; - $s = shift if $_[0] and not ref $_[0]; - $class->SUPER::NEW(@_); - - init(); - setText($s) if $s; -} - - -sub init { - my $lcd = TQt::LCDNumber(2, this, "lcd"); - - slider = TQt::Slider(&Horizontal, this, "slider"); - slider->setRange(0, 99); - slider->setValue(0); - - label = TQt::Label(" ", this, "label"); - label->setAlignment(&AlignCenter); - - $lcd->connect(slider, TQT_SIGNAL('valueChanged(int)'), TQT_SLOT('display(int)')); - this->connect(slider, TQT_SIGNAL('valueChanged(int)'), TQT_SIGNAL('valueChanged(int)')); - - setFocusProxy(slider); - - my $l = TQt::VBoxLayout(this); - $l->addWidget($lcd, 1); - $l->addWidget(slider); - $l->addWidget(label); -} - -sub value { slider->value } - -sub text { label->text } - -sub setValue { slider->setValue(shift) } - -sub setRange { - my($minVal, $maxVal) = @_; - if($minVal < 0 || $maxVal > 99 || $minVal > $maxVal) { - warn "LCDRange::setRange($minVal,$maxVal)\n" . - "\tRange must be 0..99\n" . - "\tand minVal must not be greater than maxVal\n"; - return; - } - slider->setRange($minVal, $maxVal); -} - -sub setText { label->setText(shift) } - -1; |