HTML_Progress_UI::setFillWay
decides how the progress meter will be filled
Synopsis
require_once 'HTML/Progress/UI.php';
void
HTML_Progress_UI::setFillWay(
string
$way)
Description
This method is used to change the fill way of the progress meter.
It could be natural (left to right for horizontal progress bar),
(down to up for vertical progress bar) or reverse
(right to left for horizontal progress bar), (up to down for vertical progress bar).
Parameter
- string
$way
-
the new progress meter fill way.
Throws
Possible PEAR_Error values
Error level |
Error code |
Error message |
Solution |
exception |
HTML_PROGRESS_ERROR_INVALID_INPUT |
invalid input, parameter #1 "$way" was expecting "string" |
Fixed the cast of parameter |
error |
HTML_PROGRESS_ERROR_INVALID_INPUT |
invalid input, parameter #1 "$way" was expecting "natural|reverse" |
Choose one of both label |
Note
( HTML_Progress >= 1.0 )
| This function can not be called statically. |
See
HTML_Progress_UI::getFillWay
Example
Example below (that requires HTML_Progress >= 1.2.0RC3) will produced a vertical progress bar
with only 5 cells filled in reverse order (see line 12).
It's a dynamic example, the progress bar will run.
| |
- <?php
- require_once 'HTML/Progress.php';
-
- $bar = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
- $bar->setAnimSpeed(100);
- $bar->setIdent('PB1');
- $bar->setIncrement(10);
-
- $ui =& $bar->getUI();
- $ui->setComment('Reverse ProgressBar example');
- $ui->setTabOffset(1);
- $ui->setFillWay('reverse');
- $ui->setCellCount(5);
- $ui->setProgressAttributes(array(
- 'background-color' => '#e0e0e0'
- ));
- $ui->setStringAttributes(array(
- 'valign' => 'left',
- 'color' => 'red',
- 'background-color' => 'lightblue'
- ));
- ?>
- <html>
- <head>
- <title>setFillWay example</title>
- <style type="text/css">
- <!--
- <?php echo $bar->getStyle(); ?>
-
- body {
- background-color: lightblue;
- color: #000000;
- font-family: Verdana, Arial;
- }
- // -->
- </style>
- <script type="text/javascript">
- <!--
- <?php echo $bar->getScript(); ?>
- //-->
- </script>
- </head>
- <body>
-
- <?php
- echo $bar->toHtml();
- $bar->run();
- ?>
-
- </body>
- </html>