HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]
Prev Next
HTML_Progress_UI::setCellCount
sets the new number of cell in a progress bar

Synopsis

require_once 'HTML/Progress/UI.php';

void HTML_Progress_UI::setCellCount( int $cells)

Description

This method is used to set the new number of cell in the progress bar.

Parameter

    integer $cells
  • the new count of cell in the progress bar.

Throws

Possible PEAR_Error values

Error level Error code Error message Solution
exception HTML_PROGRESS_ERROR_INVALID_INPUT invalid input, parameter #1 "$cells" was expecting "integer" Fixed the cast of parameter
error HTML_PROGRESS_ERROR_INVALID_INPUT invalid input, parameter #1 "$cells" was expecting "greater or equal 1" Give an integer greater than one

Note

( HTML_Progress >= 1.0 )

This function can not be called statically.

See

HTML_Progress_UI::getCellCount

Example

Example below (that requires HTML_Progress >= 1.2.0RC3) will produced a progress bar with less than ten default cells (see line 11). It's a dynamic example, the progress bar will run.

  1. <?php
  2. require_once 'HTML/Progress.php';
  3.  
  4. $bar = new HTML_Progress();
  5. $bar->setAnimSpeed(100);
  6. $bar->setIncrement(10);
  7. $bar->setBorderPainted(true);
  8.  
  9. $ui =& $bar->getUI();
  10. $ui->setFillWay('reverse');
  11. $ui->setCellCount(5);
  12. $ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=20');
  13. $ui->setBorderAttributes('width=1 color=#000000');
  14. $ui->setStringAttributes('font-size=14 color=#FF0000 align=left valign=bottom');
  15. ?>
  16. <!DOCTYPE html
  17. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  18. "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  19.  
  20. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  21. <head>
  22. <title>setCellCount example</title>
  23. <style type="text/css">
  24. <!--
  25. <?php echo $bar->getStyle(); ?>
  26. // -->
  27. </style>
  28. <script type="text/javascript">
  29. <!--
  30. <?php echo $bar->getScript(); ?>
  31. //-->
  32. </script>
  33. </head>
  34. <body>
  35.  
  36. <?php
  37. echo $bar->toHtml();
  38. $bar->run();
  39. ?>
  40.  
  41. </body>
  42. </html>

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

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