Examples TOCexamples

Red Sand Back

$Date: 2005/07/25 10:25:30 $

 Table of contents

Introduction

This example requires :


This example will run a reverse horizontal ProgressBar, as javadanse.php. It also show how to decrease cell number (default is 10).

Percent text info is center aligned on bottom side of the progress bar.

[Top]

 Render options

Here are options to build the progress bar cells :
active-color   = #970038
inactive-color = #FFDDAA
width          = 20
HTML_Progress_UI::setCellAttributes()
Here are options to build the progress bar border :
width = 1
color = #000000
HTML_Progress_UI::setBorderAttributes()
Here are options to build the progress bar string (percent text info):
font-size = 14
color     = #FF0000
align     = left
valign    = bottom
HTML_Progress_UI::setStringAttributes()

[Top]

 Output

Screenshot

[Top]

 PHP source syntax highlight

  1. <?php
  2. /**
  3.  * 5 cells Reverse Horizontal ProgressBar example with red skin.
  4.  * See also ProgressMaker usage with pre-set UI model 'RedSandBack'.
  5.  *
  6.  * @version    $Id: redsandback.php,v 1.2 2005/07/25 10:25:30 farell Exp $
  7.  * @author     Laurent Laville <pear@laurent-laville.org>
  8.  * @package    HTML_Progress
  9.  * @subpackage Examples
  10.  */
  11.  
  12. require_once 'HTML/Progress.php';
  13.  
  14. $bar = new HTML_Progress();
  15. $bar->setAnimSpeed(100);
  16. $bar->setIncrement(10);
  17. $bar->setBorderPainted(true);
  18.  
  19. $ui =& $bar->getUI();
  20. $ui->setTab('    ');
  21. $ui->setFillWay('reverse');
  22. $ui->setCellCount(5);
  23. $ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=20');
  24. $ui->setBorderAttributes('width=1 color=#000000');
  25. $ui->setStringAttributes('font-size=14 color=#FF0000 align=left valign=bottom');
  26. ?>
  27. <!DOCTYPE html
  28.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  29.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  30.  
  31. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  32. <head>
  33. <title>RedSandBack Progress example</title>
  34. <style type="text/css">
  35. <!--
  36. <?php echo $bar->getStyle(); ?>
  37.  
  38. body {
  39.     background-color: #FFFFFF;
  40.     color: #000000;
  41.     font-family: Verdana, Arial;
  42. }
  43.  
  44. a:visited, a:active, a:link {
  45.     color: navy;
  46. }
  47. // -->
  48. </style>
  49. <script type="text/javascript">
  50. <!--
  51. <?php echo $bar->getScript(); ?>
  52. //-->
  53. </script>
  54. </head>
  55. <body>
  56.  
  57. <?php
  58. echo $bar->toHtml();
  59. $bar->run();
  60. ?>
  61.  
  62. </body>
  63. </html>

[Top]