Without any change, we can get a decent dialog box with a default progress meter such as :
As you can see in source code below, there are no difficulty.
<?php
require_once 'HTML/Progress2/Monitor.php';
$pm = new HTML_Progress2_Monitor();
$pb =& $pm->getProgressElement();
$pb->setAnimSpeed(200);
$pb->setIncrement(10);
?>
<html>
<head>
<?php
echo $pm->getStyle(false);
echo $pm->getScript(false);
?>
</head>
<body>
<?php
$pm->display();
$pm->run();
?>
</body>
</html>
|
Without any arguments, all defaults are applied on HTML_Progress2_Monitor new instance construction.
- $formName (argument 1 of class constructor)
-
Name of monitor dialog box (QuickForm). Default is
ProgressMonitor
- $attributes (argument 2 of class constructor)
-
List of renderer options. Default are
- dialog box title = In progress ...
- dialog box start button = Start
- dialog box cancel button = Cancel
- dialog box button style = no style
- autorun feature = false
- dialog box caption = bottom left aligned under progress meter
|
|
For demonstration purpose only, we get embedded basic progress meter into the progress monitor and change increment and speed(delay) to do a smooth animation.
|
|
We get cascading stylesheet and javascript code mandatory to a good progress meter presentation and handling.
|
|
Show initial state of progress monitor before running. Will works only with default QF renderer.
|
|
Catch user actions (start, stop) and meter progression.
|
This monitor do nothing yet. In next example we will see how to improve a bit the presentation.