HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]
Prev Next
HTML_Progress::setStringPainted
allows or not, usage of a custom progress meter string

Synopsis

require_once 'HTML/Progress.php';

void HTML_Progress::setStringPainted( bool $paint)

Description

This method is used to decide whether the progress meter should paint a custom string or not. The default value is FALSE.

By default, the progress meter displays the value returned by HTML_Progress::getPercentComplete() method formatted as a percent such as 33%.

Parameter

    boolean $paint
  • whether the progress meter should render a custom string

Throws

Possible PEAR_Error values

Error level Error code Error message Solution
exception HTML_PROGRESS_ERROR_INVALID_INPUT invalid input, parameter #1 "$paint" was expecting "boolean" Fixed the cast of parameter

Note

( HTML_Progress >= 1.0 )

This function can not be called statically.

See

HTML_Progress::isStringPainted, HTML_Progress::setString

Example

Example below will produced a progress bar with a custom string.

  1. <?php
  2. require_once 'HTML/Progress.php';
  3.  
  4. $bar = new HTML_Progress();
  5. $bar->setStringPainted(true);
  6. $bar->setValue(25);
  7.  
  8. $ui =& $bar->getUI();
  9. $ui->setStringAttributes('width=350 align=left');
  10. ?>
  11. <html>
  12. <head>
  13. <title>setStringPainted example</title>
  14. <style type="text/css">
  15. <!--
  16. <?php echo $bar->getStyle(); ?>
  17. // -->
  18. </style>
  19. <script type="text/javascript">
  20. <!--
  21. <?php echo $bar->getScript(); ?>
  22. //-->
  23. </script>
  24. </head>
  25. <body>
  26.  
  27. <?php
  28. echo $bar->toHtml();
  29.  
  30. $msg = "&nbsp; installing package (25 %) ... : Config";
  31. $bar->setString($msg);
  32.  
  33. $bar->display();
  34. ?>
  35.  
  36. </body>
  37. </html>

Prev Up Next
HTML_Progress::isStringPainted Reference Guide HTML_Progress::isBorderPainted

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