HTML_Progress_UI::setOrientation

HTML_Progress

Prev |  | Next
HTML_Progress_UI::setOrientation sets the orientation of the progress meter ## Synopsis require_once 'HTML/Progress/UI.php'; void HTML_Progress_UI::setOrientation( integer $orient) ## Description This method is used to change orientation of the progress meter in one step.

It could be:

Orientation | Use constant
horizontal | HTML_PROGRESS_BAR_HORIZONTAL
vertical | HTML_PROGRESS_BAR_VERTICAL
polygonal (square, rectangle) | HTML_PROGRESS_POLYGONAL
circle, ellipse | HTML_PROGRESS_CIRCLE
## Parameter integer $orient the new progress meter orientation. ## Throws

Possible PEAR_Error values

Error level | Error code | Error message | Solution
exception | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #1 "$orient" was expecting "integer" | Fixed the cast of parameter
error | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #1 "$orient" was expecting "1|2|3|4" | Expected one of these constants: HTML_PROGRESS_BAR_HORIZONTAL HTML_PROGRESS_BAR_VERTICAL HTML_PROGRESS_POLYGONAL HTML_PROGRESS_CIRCLE
## Note ( HTML_Progress >= 1.0 )
| This function can not be called statically.
| Parameter $orient is an integer which identify only 2 shapes (in version 1.0): Horizontal and Vertical progress bars. Polygonal and Circle shapes are available only since version 1.2.0RC1.
## See HTML_Progress_UI::getOrientation ## Example Example below (that requires HTML_Progress >= 1.2.0RC3) will produced a vertical progress bar (see line 11) with only 6 cells. It's a dynamic example, the progress bar will run.

    <?php
    require_once 'HTML/Progress.php';

    $bar = new HTML_Progress();
    $bar->setAnimSpeed(100);
    $bar->setIdent('PB1');
    $bar->setIncrement(10);
    $bar->setBorderPainted(true);

    $ui =& $bar->getUI();
    $ui->setOrientation(HTML_PROGRESS_BAR_VERTICAL);
    $ui->setFillWay('natural');
    $ui->setCellCount(6);
    $ui->setCellAttributes(array(
        'active-color' => '#970038',
        'inactive-color' => '#FFDDAA',
        'width' => 50,
        'height' => 13
    ));
    $ui->setBorderAttributes('width=1');
    $ui->setStringAttributes(array(
        'font-size' => 8,
        'color' => '#FF0000',
        'background-color' => '#C3C6C3',
        'align' => 'center',
        'valign' => 'bottom'
    ));

    ?>
    <!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <title>setOrientation example</title>
    <style type="text/css">
    <!--
    <?php echo $bar->getStyle(); ?>

    body {
        background-color: #C3C6C3;
        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>
Prev | Up | Next
HTML_Progress_UI::getOrientation | Reference Guide | HTML_Progress_UI::getFillWay
Documentation generated on Sun, 12 Sep 2004 20:23:19 +0200 by phpDocumentor 1.3.0RC3