Examples TOCexamples

Smallest

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

 Table of contents

Introduction

This example requires :


This example will run the smallest ProgressBar, you can build.

Percent text info is right aligned on 50 pixels width area at right side of the progress bar (default).

[Top]

 Render options

Here are options to build the progress bar cells :
active-color   = #970038
inactive-color = #FFDDAA
width          = 7
height         = 12
HTML_Progress_UI::setCellAttributes()
Here are options to build the progress bar border :
width = 1
HTML_Progress_UI::setBorderAttributes()
Here are options to build the progress bar string (percent text info):
font-size        = 10
background-color = #C3C6C3
HTML_Progress_UI::setStringAttributes()

[Top]

 Output

Screenshot

[Top]

 PHP source syntax highlight

  1. <?php
  2. /**
  3.  * Natural Horizontal smallest ProgressBar example.
  4.  * See also ProgressMaker usage with pre-set UI model 'Smallest'.
  5.  *
  6.  * @version    $Id: smallest.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->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=7 height=12');
  22. $ui->setBorderAttributes('width=1');
  23. $ui->setStringAttributes(array(
  24.     'font-size' => 10,
  25.     'background-color' => '#C3C6C3'
  26. ));
  27. ?>
  28. <!DOCTYPE html
  29.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  30.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  31.  
  32. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  33. <head>
  34. <title>Smallest Progress example</title>
  35. <style type="text/css">
  36. <!--
  37. <?php echo $bar->getStyle(); ?>
  38.  
  39. body {
  40.     background-color: #C3C6C3;
  41.     color: #000000;
  42.     font-family: Verdana, Arial;
  43. }
  44.  
  45. a:visited, a:active, a:link {
  46.     color: navy;
  47. }
  48. // -->
  49. </style>
  50. <script type="text/javascript">
  51. <!--
  52. <?php echo $bar->getScript(); ?>
  53. //-->
  54. </script>
  55. </head>
  56. <body>
  57.  
  58. <?php
  59. echo $bar->toHtml();
  60. $bar->run();
  61. ?>
  62.  
  63. </body>
  64. </html>

[Top]