From 6825d68056e749477e01fddb58b11869cd3488db Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Sun, 8 Feb 2015 21:05:23 +0000 Subject: [PATCH] 55_InfoPanel.pm: updated added: fill/stroke to circle and ellipse fixed: target evaluation changed: commandref updated git-svn-id: https://svn.fhem.de/fhem/trunk@7922 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/55_InfoPanel.pm | 81 +++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/fhem/FHEM/55_InfoPanel.pm b/fhem/FHEM/55_InfoPanel.pm index cd48cef88..6d3aa4991 100644 --- a/fhem/FHEM/55_InfoPanel.pm +++ b/fhem/FHEM/55_InfoPanel.pm @@ -5,7 +5,7 @@ # forked from 02_RSS.pm by Dr. Boris Neubert # ############################################## -# $Id: 55_InfoPanel.pm 7910 2015-02-07 18:29:59Z betateilchen $ +# $Id: 55_InfoPanel.pm 7921 2015-02-08 20:34:48Z betateilchen $ package main; use strict; @@ -200,12 +200,8 @@ sub btIP_itemArea { $id = ($id eq '-') ? createUniqueId() : $id; my $width = $x2 - $x1; my $height = $y2 - $y1; - -# my $target = 'secret'; -# $target = '_top' if $link =~ s/^-//; -# $target = '_blank' if $link =~ s/^\+//; - - my $target = btIP_findTarget($link); + my $target; + ($link,$target) = btIP_findTarget($link); my $output = "\n"; $output .= "\n"; @@ -221,11 +217,8 @@ sub btIP_itemButton { my ($r,$g,$b,$a) = btIP_color($params{boxcolor}); $text = AnalyzePerlCommand(undef,$text); $link = AnalyzePerlCommand(undef,$link); -# my $target = 'secret'; -# $target = '_top' if $link =~ s/^-//; -# $target = '_blank' if $link =~ s/^\+//; - - my $target = btIP_findTarget($link); + my $target; + ($link,$target) = btIP_findTarget($link); my $output = "\n"; @@ -245,12 +238,21 @@ sub btIP_itemButton { } sub btIP_itemCircle { - my ($id,$x,$y,$r,$filled,%params)= @_; + my ($id,$x,$y,$r,$filled,$stroked,%params)= @_; $id = ($id eq '-') ? createUniqueId() : $id; my $output = " 0 || $stroked > 0) { + $output .= "style=\""; + if($filled > 0) { + my ($r,$g,$b,$a) = btIP_color($params{rgb}); + $output .= "fill:rgb($r,$g,$b); fill-opacity:$a; "; + } + if($stroked > 0) { + my ($r,$g,$b,$a) = btIP_color($params{rgb}); + $output .= "stroke:rgb($r,$g,$b); stroke-width:$stroked; "; + $output .= "fill:none; " if ($filled == 0); + } + $output .= "\" "; } $output .= "/>\n"; return $output; @@ -264,12 +266,21 @@ sub btIP_itemDate { } sub btIP_itemEllipse { - my ($id,$x,$y,$rx,$ry,$filled,%params)= @_; + my ($id,$x,$y,$rx,$ry,$filled,$stroked,%params)= @_; $id = ($id eq '-') ? createUniqueId() : $id; my $output = " 0 || $stroked > 0) { + $output .= "style=\""; + if($filled > 0) { + my ($r,$g,$b,$a) = btIP_color($params{rgb}); + $output .= "fill:rgb($r,$g,$b); fill-opacity:$a; "; + } + if($stroked > 0) { + my ($r,$g,$b,$a) = btIP_color($params{rgb}); + $output .= "stroke:rgb($r,$g,$b); stroke-width:$stroked; "; + $output .= "fill:none; " if ($filled == 0); + } + $output .= "\" "; } $output .= "/>\n"; return $output; @@ -481,8 +492,8 @@ sub btIP_itemTextBox { $id = ($id eq '-') ? createUniqueId() : $id; my $color = substr($params{rgb},0,6); $link =~ s/"//g; - - my $target = btIP_findTarget($link); + my $target; + ($link,$target) = btIP_findTarget($link); my ($d,$output); @@ -567,7 +578,7 @@ sub btIP_findTarget { my $target = 'secret'; $target = '_top' if $link =~ s/^-//; $target = '_blank' if $link =~ s/^\+//; - return $target; + return ($link,$target); } sub btIP_color { @@ -825,10 +836,11 @@ sub btIP_evalLayout($$@) { } when("circle") { - ($id,$x1,$y1,$r1,$format)= split("[ \t]+", $def, 5); + ($id,$x1,$y1,$r1,$filled,$stroked)= split("[ \t]+", $def, 6); ($x1,$y1)= btIP_xy($x1,$y1,%params); - $format //= 0; # set format to 0 as default (not filled) - $svg .= btIP_itemCircle($id,$x1,$y1,$r1,$format,%params); + $filled //= 0; + $stroked //= 0; + $svg .= btIP_itemCircle($id,$x1,$y1,$r1,$filled,$stroked,%params); } when("date") { @@ -840,10 +852,11 @@ sub btIP_evalLayout($$@) { } when("ellipse") { - ($id,$x1,$y1,$r1,$r2,$format)= split("[ \t]+", $def, 6); + ($id,$x1,$y1,$r1,$r2,$filled,$stroked)= split("[ \t]+", $def, 7); ($x1,$y1)= btIP_xy($x1,$y1,%params); - $format //= 0; # set format to 0 as default (not filled) - $svg .= btIP_itemEllipse($id,$x1,$y1,$r1,$r2,$format,%params); + $filled //= 0; + $stroked //= 0; + $svg .= btIP_itemEllipse($id,$x1,$y1,$r1,$r2,$filled,$stroked,%params); } when("font") { @@ -1309,14 +1322,15 @@ Please read + fill = circle will be filled with "rgb" color if set to 1. Default = 0
+ stroke-width = defines stroke width to draw around the circle. Default = 0


  • date <id> <x> <y>
    @@ -1327,14 +1341,15 @@ Please read
    + fill = ellipse will be filled with "rgb" color if set to 1. Default = 0
    + stroke-width = defines stroke width to draw around the ellipse. Default = 0


  • font <font-family>