Examples TOCexamples

BullIt

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

 Table of contents

Introduction

This example requires :


This example will run a plain horizontal ProgressBar.


Have a look on cell spacing attribute (important):

Percent text info is right aligned on top side of the progress bar.

[Top]

 Render options

Here are options to build the progress bar cells :
active-color     = #000084
inactive-color   = #3A6EA5
width            = 20
spacing          = 0
HTML_Progress_UI::setCellAttributes()
Here are options to build the progress bar border :
width = 1
style = inset
color = white
HTML_Progress_UI::setBorderAttributes()
Here are options to build the progress bar string (percent text info):
width            = 200
height           = 20
font-size        = 14
background-color = #C3C6C3
valign           = top
HTML_Progress_UI::setStringAttributes()

[Top]

 Output

Screenshot

[Top]

 PHP source syntax highlight

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

[Top]