mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 13:26:02 +00:00
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
This commit is contained in:
parent
fef48ba7cb
commit
6825d68056
@ -5,7 +5,7 @@
|
|||||||
# forked from 02_RSS.pm by Dr. Boris Neubert
|
# 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;
|
package main;
|
||||||
use strict;
|
use strict;
|
||||||
@ -200,12 +200,8 @@ sub btIP_itemArea {
|
|||||||
$id = ($id eq '-') ? createUniqueId() : $id;
|
$id = ($id eq '-') ? createUniqueId() : $id;
|
||||||
my $width = $x2 - $x1;
|
my $width = $x2 - $x1;
|
||||||
my $height = $y2 - $y1;
|
my $height = $y2 - $y1;
|
||||||
|
my $target;
|
||||||
# my $target = 'secret';
|
($link,$target) = btIP_findTarget($link);
|
||||||
# $target = '_top' if $link =~ s/^-//;
|
|
||||||
# $target = '_blank' if $link =~ s/^\+//;
|
|
||||||
|
|
||||||
my $target = btIP_findTarget($link);
|
|
||||||
|
|
||||||
my $output = "<a id=\”$id\” x=\"$x1\" y=\"$y1\" width=\"$width\" height=\"$height\" xlink:href=\"$link\" target=\"$target\" >\n";
|
my $output = "<a id=\”$id\” x=\"$x1\" y=\"$y1\" width=\"$width\" height=\"$height\" xlink:href=\"$link\" target=\"$target\" >\n";
|
||||||
$output .= "<rect id=\”$id\” x=\"$x1\" y=\"$y1\" width=\"$width\" height=\"$height\" opacity=\"0\" />\n";
|
$output .= "<rect id=\”$id\” x=\"$x1\" y=\"$y1\" width=\"$width\" height=\"$height\" opacity=\"0\" />\n";
|
||||||
@ -221,11 +217,8 @@ sub btIP_itemButton {
|
|||||||
my ($r,$g,$b,$a) = btIP_color($params{boxcolor});
|
my ($r,$g,$b,$a) = btIP_color($params{boxcolor});
|
||||||
$text = AnalyzePerlCommand(undef,$text);
|
$text = AnalyzePerlCommand(undef,$text);
|
||||||
$link = AnalyzePerlCommand(undef,$link);
|
$link = AnalyzePerlCommand(undef,$link);
|
||||||
# my $target = 'secret';
|
my $target;
|
||||||
# $target = '_top' if $link =~ s/^-//;
|
($link,$target) = btIP_findTarget($link);
|
||||||
# $target = '_blank' if $link =~ s/^\+//;
|
|
||||||
|
|
||||||
my $target = btIP_findTarget($link);
|
|
||||||
|
|
||||||
my $output = "<a id=\”$id\” x=\"$x1\" y=\"$y1\" width=\"$width\" height=\"$height\" ".
|
my $output = "<a id=\”$id\” x=\"$x1\" y=\"$y1\" width=\"$width\" height=\"$height\" ".
|
||||||
"xlink:href=\"$link\" target=\"$target\" >\n";
|
"xlink:href=\"$link\" target=\"$target\" >\n";
|
||||||
@ -245,12 +238,21 @@ sub btIP_itemButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub btIP_itemCircle {
|
sub btIP_itemCircle {
|
||||||
my ($id,$x,$y,$r,$filled,%params)= @_;
|
my ($id,$x,$y,$r,$filled,$stroked,%params)= @_;
|
||||||
$id = ($id eq '-') ? createUniqueId() : $id;
|
$id = ($id eq '-') ? createUniqueId() : $id;
|
||||||
my $output = "<circle id=\”$id\” cx=\"$x\" cy=\"$y\" r=\"$r\" ";
|
my $output = "<circle id=\”$id\” cx=\"$x\" cy=\"$y\" r=\"$r\" ";
|
||||||
if($filled) {
|
if($filled > 0 || $stroked > 0) {
|
||||||
|
$output .= "style=\"";
|
||||||
|
if($filled > 0) {
|
||||||
my ($r,$g,$b,$a) = btIP_color($params{rgb});
|
my ($r,$g,$b,$a) = btIP_color($params{rgb});
|
||||||
$output .= "style=\"fill:rgb($r,$g,$b); fill-opacity:$a; stroke-width:0;\" "
|
$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";
|
$output .= "/>\n";
|
||||||
return $output;
|
return $output;
|
||||||
@ -264,12 +266,21 @@ sub btIP_itemDate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub btIP_itemEllipse {
|
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;
|
$id = ($id eq '-') ? createUniqueId() : $id;
|
||||||
my $output = "<ellipse $id=\"$id\" cx=\"$x\" cy=\"$y\" rx=\"$rx\" ry=\"$ry\" ";
|
my $output = "<ellipse $id=\"$id\" cx=\"$x\" cy=\"$y\" rx=\"$rx\" ry=\"$ry\" ";
|
||||||
if($filled) {
|
if($filled > 0 || $stroked > 0) {
|
||||||
|
$output .= "style=\"";
|
||||||
|
if($filled > 0) {
|
||||||
my ($r,$g,$b,$a) = btIP_color($params{rgb});
|
my ($r,$g,$b,$a) = btIP_color($params{rgb});
|
||||||
$output .= "style=\"fill:rgb($r,$g,$b); fill-opacity:$a; stroke-width:0;\" "
|
$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";
|
$output .= "/>\n";
|
||||||
return $output;
|
return $output;
|
||||||
@ -481,8 +492,8 @@ sub btIP_itemTextBox {
|
|||||||
$id = ($id eq '-') ? createUniqueId() : $id;
|
$id = ($id eq '-') ? createUniqueId() : $id;
|
||||||
my $color = substr($params{rgb},0,6);
|
my $color = substr($params{rgb},0,6);
|
||||||
$link =~ s/"//g;
|
$link =~ s/"//g;
|
||||||
|
my $target;
|
||||||
my $target = btIP_findTarget($link);
|
($link,$target) = btIP_findTarget($link);
|
||||||
|
|
||||||
my ($d,$output);
|
my ($d,$output);
|
||||||
|
|
||||||
@ -567,7 +578,7 @@ sub btIP_findTarget {
|
|||||||
my $target = 'secret';
|
my $target = 'secret';
|
||||||
$target = '_top' if $link =~ s/^-//;
|
$target = '_top' if $link =~ s/^-//;
|
||||||
$target = '_blank' if $link =~ s/^\+//;
|
$target = '_blank' if $link =~ s/^\+//;
|
||||||
return $target;
|
return ($link,$target);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub btIP_color {
|
sub btIP_color {
|
||||||
@ -825,10 +836,11 @@ sub btIP_evalLayout($$@) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
when("circle") {
|
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);
|
($x1,$y1)= btIP_xy($x1,$y1,%params);
|
||||||
$format //= 0; # set format to 0 as default (not filled)
|
$filled //= 0;
|
||||||
$svg .= btIP_itemCircle($id,$x1,$y1,$r1,$format,%params);
|
$stroked //= 0;
|
||||||
|
$svg .= btIP_itemCircle($id,$x1,$y1,$r1,$filled,$stroked,%params);
|
||||||
}
|
}
|
||||||
|
|
||||||
when("date") {
|
when("date") {
|
||||||
@ -840,10 +852,11 @@ sub btIP_evalLayout($$@) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
when("ellipse") {
|
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);
|
($x1,$y1)= btIP_xy($x1,$y1,%params);
|
||||||
$format //= 0; # set format to 0 as default (not filled)
|
$filled //= 0;
|
||||||
$svg .= btIP_itemEllipse($id,$x1,$y1,$r1,$r2,$format,%params);
|
$stroked //= 0;
|
||||||
|
$svg .= btIP_itemEllipse($id,$x1,$y1,$r1,$r2,$filled,$stroked,%params);
|
||||||
}
|
}
|
||||||
|
|
||||||
when("font") {
|
when("font") {
|
||||||
@ -1309,14 +1322,15 @@ Please read <a href="http://forum.fhem.de/index.php/topic,32828.0.html" target="
|
|||||||
<ul>needed once in your layout file if you intend to use buttons in the same layout.<br/>
|
<ul>needed once in your layout file if you intend to use buttons in the same layout.<br/>
|
||||||
</ul></li><br/>
|
</ul></li><br/>
|
||||||
<br/>
|
<br/>
|
||||||
<li><code>circle <id> <x> <y> <r> [<fill>]</code><br/>
|
<li><code>circle <id> <x> <y> <r> [<fill>] [<stroke-width>]</code><br/>
|
||||||
<br/>
|
<br/>
|
||||||
<ul>create a circle<br/>
|
<ul>create a circle<br/>
|
||||||
<br/>
|
<br/>
|
||||||
id = element id<br/>
|
id = element id<br/>
|
||||||
x,y = center coordinates of circle<br/>
|
x,y = center coordinates of circle<br/>
|
||||||
r = radius<br/>
|
r = radius<br/>
|
||||||
fill = circle will be filled with "rgb" color if set to 1<br/>
|
fill = circle will be filled with "rgb" color if set to 1. Default = 0<br/>
|
||||||
|
stroke-width = defines stroke width to draw around the circle. Default = 0<br/>
|
||||||
</ul></li><br/>
|
</ul></li><br/>
|
||||||
<br/>
|
<br/>
|
||||||
<li><code>date <id> <x> <y></code><br/>
|
<li><code>date <id> <x> <y></code><br/>
|
||||||
@ -1327,14 +1341,15 @@ Please read <a href="http://forum.fhem.de/index.php/topic,32828.0.html" target="
|
|||||||
x,y = position<br/>
|
x,y = position<br/>
|
||||||
</ul></li><br/>
|
</ul></li><br/>
|
||||||
<br/>
|
<br/>
|
||||||
<li><code>ellipse <id> <x> <y> <r1> <r2> [<fill>]</code><br/>
|
<li><code>ellipse <id> <x> <y> <r1> <r2> [<fill>] [<stroke-width>]</code><br/>
|
||||||
<br/>
|
<br/>
|
||||||
<ul>create an ellipse<br/>
|
<ul>create an ellipse<br/>
|
||||||
<br/>
|
<br/>
|
||||||
id = element id<br/>
|
id = element id<br/>
|
||||||
x,y = center coordinates of circle<br/>
|
x,y = center coordinates of circle<br/>
|
||||||
r1,r2 = radius<br/>
|
r1,r2 = radius<br/>
|
||||||
fill = ellipse will be filled with "rgb" color if set to 1<br/>
|
fill = ellipse will be filled with "rgb" color if set to 1. Default = 0<br/>
|
||||||
|
stroke-width = defines stroke width to draw around the ellipse. Default = 0<br/>
|
||||||
</ul></li><br/>
|
</ul></li><br/>
|
||||||
<br/>
|
<br/>
|
||||||
<li><code>font <font-family></code><br/>
|
<li><code>font <font-family></code><br/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user