Examples TOCexamples

Ancestor

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

 Table of contents

Introduction

This example requires :


This example will run a basic horizontal ProgressBar v0.5 style.

There are 10 cells with default values:

Percent text info is centered on a white background area of 60 pixels width.

[Top]

 Render options

Here are options to build this progress bar string (percent text info):
width     = 60
font-size = 14
align     = center
HTML_Progress_UI::setStringAttributes()

[Top]

 Output

Screenshot

[Top]

 PHP source syntax highlight

  1. <?php
  2. /**
  3.  * Basic Horizontal ProgressBar v0.5 style example.
  4.  * See also ProgressMaker usage with pre-set UI model 'Ancestor'.
  5.  *
  6.  * @version    $Id: ancestor.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.  
  18. $ui =& $bar->getUI();
  19. $ui->setTab('    ');
  20. $ui->setStringAttributes('width=60 font-size=14 align=center');
  21. ?>
  22. <html>
  23. <head>
  24. <title>Ancestor Progress example</title>
  25. <style type="text/css">
  26. <!--
  27. <?php echo $bar->getStyle(); ?>
  28.  
  29. body {
  30.     background-color: #444444;
  31.     color: #EEEEEE;
  32.     font-family: Verdana, Arial;
  33. }
  34.  
  35. a:visited, a:active, a:link {
  36.     color: yellow;
  37. }
  38. // -->
  39. </style>
  40. <script type="text/javascript">
  41. <!--
  42. <?php echo $bar->getScript(); ?>
  43. //-->
  44. </script>
  45. </head>
  46. <body>
  47.  
  48. <?php
  49. echo $bar->toHtml();
  50. $bar->run();
  51. ?>
  52.  
  53. </body>
  54. </html>

[Top]