Module: nagvis Branch: master Commit: bd3fbf25f7a23371d3ed6a7988115e85b4482637 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=bd3fbf25f7a23371d3ed6a7988115e85b4482637
Author: LaMi <[email protected]> Date: Tue Dec 22 20:36:15 2009 +0100 #145 Textboxes can now be moved simply by dragging --- share/frontend/wui/classes/WuiMap.php | 19 ++++++------------- 1 files changed, 6 insertions(+), 13 deletions(-) diff --git a/share/frontend/wui/classes/WuiMap.php b/share/frontend/wui/classes/WuiMap.php index 1249d69..29e35ac 100644 --- a/share/frontend/wui/classes/WuiMap.php +++ b/share/frontend/wui/classes/WuiMap.php @@ -113,28 +113,21 @@ class WuiMap extends GlobalMap { foreach($this->objects AS $var => $obj) { switch($obj['type']) { case 'textbox': - $obj['class'] = "box"; - $obj['icon'] = "20x20.gif"; - $obj['iconParams'] = ''; - $ret .= $this->textBox($obj); - $obj = $this->fixIcon($obj); - $ret .= $this->parseIcon($obj); + + $this->moveable .= "\"box_".$obj['type']."_".$obj['id']."\","; break; default: - if(isset($obj['line_type'])) { + if(isset($obj['view_type']) && $obj['view_type'] == 'line') { list($pointa_x,$pointb_x) = explode(",", $obj['x']); list($pointa_y,$pointb_y) = explode(",", $obj['y']); $ret .= "<script type=\"text/javascript\">myshape_background.drawLine(".$pointa_x.",".$pointa_y.",".$pointb_x.",".$pointb_y.");</script>"; + $obj['x'] = round(($pointa_x+($pointb_x-$pointa_x)/2) - 10); $obj['y'] = round(($pointa_y+($pointb_y-$pointa_y)/2) - 10); - $obj['icon'] = '20x20.gif'; } else { - // add this object to the list of the components which will have to be movable, if it's not a line or a textbox - if(!isset($obj['line_type']) && $obj['type'] != 'textbox') { - $this->moveable .= "\"box_".$obj['type']."_".$obj['id']."\","; - } + $this->moveable .= "\"box_".$obj['type']."_".$obj['id']."\","; } if(isset($obj['view_type']) && $obj['view_type'] == 'gadget') { @@ -445,7 +438,7 @@ class WuiMap extends GlobalMap { $sBorderColor = 'border_color'; } - $ret .= "<div class=\"".$obj['class']."\" style=\"border-color:".$sBorderColor.";background-color:".$sBgColor.";left: ".$obj['x']."px; top: ".$obj['y']."px; z-index: ".$obj['z']."; width: ".$obj['w']."; overflow: visible;\">"; + $ret .= "<div id=\"box_".$obj['type']."_".$obj['id']."\" class=\"box\" style=\"border-color:".$sBorderColor.";background-color:".$sBgColor.";left: ".$obj['x']."px; top: ".$obj['y']."px; z-index: ".$obj['z']."; width: ".$obj['w']."; overflow: visible;\" ".$this->infoBox($obj).">"; $ret .= "\t<span>".$obj['text']."</span>"; $ret .= "</div>"; ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
