HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]
Prev Next
HTML_Progress_UI::setFillWay
decides how the progress meter will be filled

Synopsis

require_once 'HTML/Progress/UI.php';

void HTML_Progress_UI::setFillWay( string $way)

Description

This method is used to change the fill way of the progress meter.

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).

Parameter

    string $way
  • the new progress meter fill way.

Throws

Possible PEAR_Error values

Error level Error code Error message Solution
exception HTML_PROGRESS_ERROR_INVALID_INPUT invalid input, parameter #1 "$way" was expecting "string" Fixed the cast of parameter
error HTML_PROGRESS_ERROR_INVALID_INPUT invalid input, parameter #1 "$way" was expecting "natural|reverse" Choose one of both label

Note

( HTML_Progress >= 1.0 )

This function can not be called statically.

See

HTML_Progress_UI::getFillWay

Example

Example below (that requires HTML_Progress >= 1.2.0RC3) will produced a vertical progress bar with only 5 cells filled in reverse order (see line 12). 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. <html>
  24. <head>
  25. <title>setFillWay example</title>
  26. <style type="text/css">
  27. <!--
  28. <?php echo $bar->getStyle(); ?>
  29.  
  30. body {
  31. background-color: lightblue;
  32. color: #000000;
  33. font-family: Verdana, Arial;
  34. }
  35. // -->
  36. </style>
  37. <script type="text/javascript">
  38. <!--
  39. <?php echo $bar->getScript(); ?>
  40. //-->
  41. </script>
  42. </head>
  43. <body>
  44.  
  45. <?php
  46. echo $bar->toHtml();
  47. $bar->run();
  48. ?>
  49.  
  50. </body>
  51. </html>

Prev Up Next
HTML_Progress_UI::getFillWay Reference Guide HTML_Progress_UI::getCellCount

Documentation generated on Sun, 12 Sep 2004 20:23:20 +0200 by phpDocumentor 1.3.0RC3