HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]
Prev Next

setCellCoordinates Manual

defines coordinates of each cell for a polygonal progress shape

by by Laurent Laville
mailto:pear@laurent-laville.org
March 2004, Laurent Laville
(HTML_Progress 1.2+)

Synopsis

void setCellCoordinates( $xgrid, $ygrid, $coord )

Attributes

Name Type
xgrid integer
ygrid integer
coord array

Description

The setCellCoordinates() method is used to define all cell coordinates of any progress polygonal shape (square, rectangle ...)

Example

Example below will create a rectangle 6x4 progress shape:

  1. <?php
  2. require_once ('HTML/Progress.php');
  3.  
  4. $bar = new HTML_Progress();
  5. $bar->setAnimSpeed(500);
  6. $bar->setIncrement(10);
  7.  
  8. $ui =$bar->getUI();
  9. $ui->setStringAttributes('valign=bottom align=center width=90 height=30');
  10. $ui->setOrientation(HTML_PROGRESS_POLYGONAL);
  11. $ui->setCellAttributes(array(
  12.         'width'  => 15,
  13.         'height' => 15,
  14.         'active-color'   => 'red',
  15.         'inactive-color' => 'orange',
  16.         )
  17. );
  18. $ui->setCellCoordinates(6,4);          // Rectangle 6x4
  19. ?>
  20. <!DOCTYPE html
  21.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  22.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  23.  
  24. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  25. <head>
  26. <title>setCellCoordinates example</title>
  27. <style type="text/css">
  28. <!--
  29. <?php echo $bar->getStyle()?>
  30. // -->
  31. </style>
  32. <script type="text/javascript">
  33. <!--
  34. <?php echo $ui->getScript()?>
  35. //-->
  36. </script>
  37. </head>
  38. <body>
  39.  
  40. <?php 
  41. echo $bar->toHtml()
  42.  
  43. do {
  44.     $bar->display();
  45.     if ($bar->getPercentComplete(== 1{
  46.         break;   // the progress bar has reached 100%
  47.     }
  48.     $bar->incValue();
  49. while(1);
  50.  
  51. ?>
  52.  
  53. </body>
  54. </html>

See Also

getCellCoordinates Manual

Prev Up Next
getCellCoordinates Manual Reference Guides getCellCount Manual

Documentation generated on Mon, 11 Mar 2019 13:52:35 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.