App-SourcePlot
view release on metacpan or search on metacpan
lib/App/SourcePlot.pm view on Meta::CPAN
$MW->update;
}
=item B<fillWithSourceList>
Fills a Text box with the list of current sources.
=cut
sub fillWithSourceList {
my (@bold, @normal);
my $Window = shift;
my $T = $Window->{'Text'};
my $selected = $Window->{'Selected'};
my $arrayOfSources = $Window->{'Sources'};
my $task = shift;
my $sort = shift;
my $index = shift;
my (@sources);
my ($source);
my @entered = ();
lib/App/SourcePlot.pm view on Meta::CPAN
# Clear the existing widgets
if (defined $task && $task eq 'full') {
$T->delete('1.0', 'end');
foreach my $source (@sources) {
$T->tagDelete('d' . $source->index());
}
}
# Set up display styles
if ($T->depth > 1) {
@bold = ('-background' => '#eeeeee', '-relief' => 'raised', '-borderwidth' => 1);
@normal = ('-background' => undef, '-relief' => 'flat');
}
else {
@bold = ('-foreground' => 'white', '-background' => 'black');
@normal = ('-foreground' => undef, '-background' => undef);
}
$T->tag(configure => 'normal', '-foreground' => 'blue');
$T->tag(configure => 'inactive', '-foreground' => 'black');
$T->tag(configure => 'selected', '-foreground' => 'red');
foreach (@COLOR_LIST) {
$T->tag('configure', $_, '-foreground' => $_);
}
# Insert the current values
lib/App/SourcePlot.pm view on Meta::CPAN
}
}
}
$len = @sources;
for ($itag = 0; $itag < $len; $itag ++) {
my $dtag = "d$itag";
$T->tag(
'bind', $dtag,
'<Any-Enter>' => sub {
shift->tag('configure', $dtag, @bold);
if ($Window->{'Changeable'} && $sources[substr($dtag, 1, 99)]->active()) {
$plotter->configureTag(
'l' . $sources[substr($dtag, 1, 99)]->name(),
-width => 3);
}
},
);
$T->tag(
'bind', $dtag,
'<Any-Leave>' => sub {
lib/App/SourcePlot.pm view on Meta::CPAN
$prevx = $x;
$prevy = $y;
}
@points = @second;
}
my $len2 = @points;
$plotter->drawSmoothLine(@points, 'l' . $source->name())
if ($len2 > 0);
my @bold = (
'-background' => "#bbbbbb",
'-foreground' => 'black',
'-relief' => 'raised',
'-borderwidth' => 1,
);
my @normal = (
'-background' => undef,
'-foreground' => $source->color(),
'-relief' => 'flat',
);
$plotter->bindTag(
'l' . $source->name(),
'<Any-Enter>' => sub {
my $s = $source;
if ($s->active()) {
$EditWin->{'Text'}->tag('configure', 'd' . $s->index(), @bold)
if $EDIT_OPEN;
$plotter->configureTag('l' . $s->name(), -width => 3);
}
},
);
$plotter->bindTag(
'l' . $source->name(),
'<Any-Leave>' => sub {
my $s = $source;
if ($s->active()) {
( run in 1.014 second using v1.01-cache-2.11-cpan-39bf76dae61 )