![]() HTML_Progress2 : The Definitive Guide
|
Sets the number of cell in the progress bar
This method accept now zero as minimum value for smooth progress meter. That means that a progress bar with zero cell, will render a full bar as HTML_Progress2_Lite do.
With HTML_Progress 1.x you might only defines one custom text label. Now with new multiple label system you can do it at infinite. There is no label number limit (except memory).
![]() |
Important |
---|---|
You have to define first each label you will put around the progress meter by the
addLabel() method, before to set its attributes.
|
While with HTML_Progress 1.x, you could have a script like this:
<?php require_once 'HTML/Progress.php'; $bar = new HTML_Progress(); $bar->setAnimSpeed(100); $bar->setIncrement(5); $bar->setStringPainted(true); // get space for the string $bar->setString(''); // but don't paint it $ui =& $bar->getUI(); $ui->setStringAttributes('width=350 align=left'); // ... ?>
which prepare to render a custom string on right side of the progress bar.
Now with HTML_Progress2, you will have a modified script like:
<?php require_once 'HTML/Progress2.php'; $bar = new HTML_Progress2(); $bar->setAnimSpeed(100); $bar->setIncrement(5); $bar->addLabel(HTML_PROGRESS2_LABEL_TEXT, 'txt1', 'Simple static text'); $bar->setLabelAttributes('txt1', array( 'valign' => 'top', 'left' => 0 )); // ... ?>
The percent info will be render alone at right side of the progress bar (default) and we have added a static text label on top side of the same progress bar.
HTML_Progress2 : The Definitive Guide | v 2.1.0 : August 12, 2006 |