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

setFillWay Manual

decides how the progress bar will be filled

by by Laurent Laville
mailto:pear@laurent-laville.org
November 2003, Laurent Laville
(HTML_Progress 1.0+)

Synopsis

void setFillWay( $way )

Attributes

Name Type Default
way string natural

Description

The setFillWay() method is used to change the fill way of the progress bar. It could be natural (left to right for horizontal progress bar), (down to up for vertical progress bar) or reverse (right to left for horizontal progress bar), (up to down for vertical progress bar).

Example

Example below will produced a vertical progress bar with only 5 cells filled in reverse order. It's a dynamic example, the progress bar will run.

  1. <?php
  2. require_once ('HTML/Progress.php');
  3.  
  4. $bar = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
  5. $bar->setAnimSpeed(100);
  6. $bar->setIdent('PB1');
  7. $bar->setIncrement(10);
  8.  
  9. $ui =$bar->getUI();
  10. $ui->setComment('Reverse ProgressBar example');
  11. $ui->setTabOffset(1);
  12. $ui->setFillWay('reverse');
  13. $ui->setCellCount(5);
  14. $ui->setProgressAttributes(array(
  15.     'background-color' => '#e0e0e0'
  16. ));        
  17. $ui->setStringAttributes(array(
  18.     'valign' => 'left',
  19.     'color'  => 'red',
  20.     'background-color' => 'lightblue'
  21.     ));
  22. ?>
  23. <!DOCTYPE html
  24.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  25.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  26.  
  27. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  28. <head>
  29. <title>setFillWay example</title>
  30. <style type="text/css">
  31. <!--
  32. <?php echo $bar->getStyle()?>
  33.  
  34. body {
  35.     background-color: lightblue;
  36.     color: #000000;
  37.     font-family: Verdana, Arial;
  38. }
  39. // -->
  40. </style>
  41. <script type="text/javascript">
  42. <!--
  43. <?php echo $bar->getScript()?>
  44. //-->
  45. </script>
  46. </head>
  47. <body>
  48.  
  49. <?php 
  50. echo $bar->toHtml()
  51.  
  52. do {
  53.     $bar->display();
  54.     if ($bar->getPercentComplete(== 1{
  55.         break;   // the progress bar has reached 100%
  56.     }
  57.     $bar->incValue();
  58. while(1);
  59. ?>
  60.  
  61. </body>
  62. </html>

See Also

setOrientation Manual

Prev Up Next
getFillWay Manual Reference Guides getOrientation Manual

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