HTML_Progress_UI::setCellCoordinates

HTML_Progress

Prev |  | Next
HTML_Progress_UI::setCellCoordinates sets the coordinates of each cell for a polygonal shape ## Synopsis require_once 'HTML/Progress/UI.php'; mixed HTML_Progress_UI::setCellCoordinates( int $xgrid int $ygrid array $coord = NULL) ## Description This method is used to define all cell coordinates of any progress meter polygonal shape (square, rectangle ...) ## Parameter integer $xgrid the grid width in cell size. integer $ygrid the grid height in cell size. array $coord the coordinates (x,y) in the grid, of each cell. ## Throws

Possible PEAR_Error values

Error level | Error code | Error message | Solution
exception | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #1 "$xgrid" was expecting "integer" | Fixed the cast of parameter
error | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #1 "$xgrid" was expecting "greater than 2" | Give an integer greater than two
exception | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #2 "$ygrid" was expecting "integer" | Fixed the cast of parameter
error | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #2 "$ygrid" was expecting "greater than 2" | Give an integer greater than two
exception | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #3 "$coord" was expecting "array" | Fixed the cast of parameter
error | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #3 "$coord" was expecting "coordinate less than grid width" | Fixed the cell x-coordinate or the parameter #1 (grid width)
error | HTML_PROGRESS_ERROR_INVALID_INPUT | invalid input, parameter #3 "$coord" was expecting "coordinate less than grid height" | Fixed the cell y-coordinate or the parameter #2 (grid height)
## Note ( HTML_Progress >= 1.2.0RC1 )
| This function can not be called statically.
| For basic shapes (square, rectangle), you don't have to give all cell coordinates. HTML_Progress will compute it for you. You should have to give the cell coordinates list only for free polygonal shape.
## See HTML_Progress_UI::getCellCoordinates ## Example Example below will create a rectangle 6x4 (see line 18).

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

    $bar = new HTML_Progress();
    $bar->setAnimSpeed(250);
    $bar->setIncrement(10);

    $ui =& $bar->getUI();
    $ui->setStringAttributes('valign=bottom align=center width=90 height=30');
    $ui->setOrientation(HTML_PROGRESS_POLYGONAL);
    $ui->setCellAttributes(array(
            'width'  => 15,
            'height' => 15,
            'active-color'   => 'red',
            'inactive-color' => 'orange',
            )
    );
    $ui->setCellCoordinates(6,4);     // Rectangle 6x4
    ?>
    <html>
    <head>
    <title>setCellCoordinates example</title>
    <style type="text/css">
    <!--
    <?php echo $bar->getStyle(); ?>
    // -->
    </style>
    <script type="text/javascript">
    <!--
    <?php echo $ui->getScript(); ?>
    //-->
    </script>
    </head>
    <body>

    <?php
    echo $bar->toHtml();
    $bar->run();
    ?>

    </body>
    </html>
Prev | Up | Next
HTML_Progress_UI::getCellCoordinates | Reference Guide | HTML_Progress_UI::getBorderAttributes
Documentation generated on Sun, 12 Sep 2004 20:23:24 +0200 by phpDocumentor 1.3.0RC3