From b305e90c818562d47f98a079ffe29052b19cb2a2 Mon Sep 17 00:00:00 2001 From: mariot Date: Wed, 26 Nov 2003 13:13:46 +0000 Subject: * Ajout de l'option -smallsize: affichage en 640x480. * Ajout de l'option -position. * Ajout des variables $smallsized $coef --- src/Agent.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/Agent.pm') diff --git a/src/Agent.pm b/src/Agent.pm index 75cf616..4a38434 100644 --- a/src/Agent.pm +++ b/src/Agent.pm @@ -14,7 +14,7 @@ use strict; #---------------------------------------------------------------------- my ($x0, $y0, $wmax, $dx, $dy, $cmin, $rmax, @matrix, @hosts, $tempo_id, $mw, $bg, $fg, $selcolor, $hlbg, $darkbg, $fontspec, @fontspec, - $on_img, $off_img, %instances, @instances, $bus, + $on_img, $off_img, %instances, @instances, $bus, $coef, $hosts_tl, $selected_host, $preselected_host); @@ -22,7 +22,7 @@ my ($x0, $y0, $wmax, $dx, $dy, $cmin, $rmax, @matrix, @hosts, $tempo_id, sub configure { shift; ($mw, $bg, $fg, $selcolor, $hlbg, $darkbg, - $fontspec, $x0, $y0, $wmax, $dy, $cmin, $rmax, $bus) = @_; + $fontspec, $x0, $y0, $wmax, $dy, $cmin, $rmax, $bus, $coef) = @_; @fontspec = @$fontspec if $fontspec; $off_img = $mw->Bitmap('off', -file => Tk::findINC('led.bmp'), -foreground => $bg); @@ -194,15 +194,15 @@ sub setposition { } $matrix[$r][$c]->[0] = $self; my ($x, $y) = ($matrix[$r][$c]->[1], $matrix[$r][$c]->[2]); - my $y2 = $y - 5; - $y2 -= 12 if ($self->{label}->cget(-text) =~ /\n/); + my $y2 = $y - 5*$coef; + $y2 -= 12*$coef if ($self->{label}->cget(-text) =~ /\n/); if ($self->{command}) { - $self->{led}->configure(-highlightthickness => 6); - $self->{led}->place(-x => $x+3, -y => $y+3); + $self->{led}->configure(-highlightthickness => 6*$coef); + $self->{led}->place(-x => $x+3*$coef, -y => $y+3*$coef); } else { - $self->{led}->configure(-highlightthickness => 2); - $self->{led}->place(-x => $x+6, -y => $y+6); + $self->{led}->configure(-highlightthickness => 2*$coef); + $self->{led}->place(-x => $x+6*$coef, -y => $y+6*$coef); } $self->{label}->place(-x => $x + 38, -y => $y2); @@ -219,7 +219,7 @@ sub createlabel { ); $self->{label} = $mw->Label(-text => $self->formatlabel, - -pady => 10, + -pady => 10*$coef, -justify => 'left', -relief => 'flat', -highlightthickness => 0, -- cgit v1.1