Default Monitor

Overview

This example will run a default Progress2 Monitor, which used a default QuickForm renderer without any form template customization.

Screenshot

sample screenshot

Demonstration

Give it a try

Dependencies

This example requires mandatory resources :

And also but optional :

Explains step by step

The progress meter wait 200ms (line 16) between each step of 10% (line 17).

The form windows (ProgressMonitor) have default title (In progress ...), buttons name (Start, Cancel) and size : see class constructor parameters (line 13).

There are 10 cells 15x20:

Property Value Default
active-color   #006600
inactive-color   #CCCCCC
width   15
height   20
spacing   2
See also :

With basic percent text info aligned on right side:

Property Value Default
left   5
top   5
width   50
height   0
align   right
valign   right
background-color   
font-size  11
font-family  Verdana, Tahoma, Arial
font-weight  normal
color  #000000
class  progressPercentLabel%s
See also :

Source Code

  1. <?php
  2. /**
  3. * Default Progress2 Monitor. Used default QF renderer.
  4. *
  5. * @version    $Id: monitordef.php,v 1.3 2005/08/01 08:45:05 farell Exp $
  6. * @author     Laurent Laville <pear@laurent-laville.org>
  7. * @package    HTML_Progress2
  8. * @subpackage Examples
  9. * @access     public
  10. */
  11. require_once 'HTML/Progress2/Monitor.php';
  12.  
  13. $pm = new HTML_Progress2_Monitor();
  14.  
  15. $pb =& $pm->getProgressElement();
  16. $pb->setAnimSpeed(200);
  17. $pb->setIncrement(10);
  18. ?>
  19. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  20.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  21. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  22. <head>
  23. <title>Default Progress2 Monitor </title>
  24. <?php
  25. echo $pm->getStyle(false);
  26. echo $pm->getScript(false);
  27. ?>
  28. </head>
  29. <body>
  30.  
  31. <?php
  32. $pm->display();
  33. $pm->run();
  34. ?>
  35.  
  36. </body>
  37. </html>