Packageindex Classtrees Modulegroups Elementlist Report XML Files

pc4p

pc4p_table

pc4p_object
  |
  +-- pc4p_table

private class pc4p_table extends pc4p_object

Provides table-functionality

AuthorsAlexander Wirtz <alex@pc4p.net>
Version$Id: pc4p_table.html,v 1.18.2.1 2002/08/12 22:47:10 eru Exp $

 

Methods inherited from pc4p_object

pc4p_object, pc4p_calc_rot, pc4p_calc_rot_dim, pc4p_set_rot, pc4p_set_margin, pc4p_set_width, pc4p_set_alignment, pc4p_set_textleading, pc4p_set_linecolor, pc4p_set_fillcolor, pc4p_make_objcopy, pc4p_draw

Public Method Summary

void pc4p_table(object pc4p_page &$parent)
pc4p_table constructor
void pc4p_create_tablematrix(integer $colsize, [ integer $rowsize, array $colnames, array $rownames ])
Creates a matrix in the table-object
void pc4p_add_tablerow([ string $rowname ])
Adds a row to the table
void pc4p_add_tablecol([ string $colname ])
Adds a column to the table
void pc4p_set_tablecolsize(array $colsize)
Sets the width for the columns
void pc4p_set_cellborder(object pc4p_object &$cell, [ mixed $border, mixed $style, mixed $width ])
Set the style and width of a cellborder
void pc4p_set_tableborder([ mixed $border, mixed $style, mixed $width ])
Set the style of the tableborder
void pc4p_set_cellbordercolor(object pc4p_object &$cell, [ mixed $border, mixed $color ])
Set the color of a cellborder
void pc4p_set_tablebordercolor([ mixed $border, mixed $color ])
Set the color of the tableborder
void pc4p_set_cellfillcolor(object pc4p_object &$cell, mixed $color)
Set the fillcolor of a cell
void pc4p_set_tablefillcolor(mixed $color)
Set the fillcolor of the table
void pc4p_set_tableheader(string $rowname)
Set the header of the table
object pc4p_table pc4p_split_table(integer $row)
Splits a table at a given row and returns the rest

Private Method Summary

void pc4p_draw_children()
Draw-children-function for the tableWarning: documentation is missing.
integer pc4p_calc_row_offset(object pc4p_page &$parent, integer $row)
Calculate the dimensions for a single row and each cell in it
integer pc4p_calc_offset(object pc4p_page &$parent)
Calculate the dimensions for the whole table and each cell in itWarning: documentation is missing.

Fields inherited from pc4p_object

$children, $pdfp, $pdfobj, $pagewidth, $pageheight, $width, $height, $margin, $act_x, $act_y, $draw_x, $draw_y, $alignment, $phi, $leading, $linecolor, $fillcolor

Private Field Summary

array $cell
Array for accessing the cells of the table
array $colsize
Array containing the sizes of each column
array $rowsize
Array containing the sizes of each row
array $colnames
Array containing the names of each column
array $rownames
Array containing the names of each row
string $tableheader
Contains the name of the row, where the header of this

Public Method Details

pc4p_table

public void pc4p_table(object pc4p_page &$parent)

  Calls the constructor of pc4p_object

Parameter
object pc4p_page &$parent
Parent of the table
Returns void

See Also pc4p_object::pc4p_object()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_create_tablematrix

public void pc4p_create_tablematrix(integer $colsize, [ integer $rowsize, array $colnames, array $rownames ])

  Creates the table and sets the names for columns and rows if provided, otherwise an index is used as name for each.

Parameter
integer $colsize
Number of columns
integer $rowsize = >>1<<
Number of rows
array $colnames = >>array()<<
Names of the columns - if provided, size of the array has to correspond with the number of columns
array $rownames = >>array()<<
Names of the rows - if provided, size of the array has to correspond with the number of rows
Returns void

See Also pc4p_init::&pc4p_create_object()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_add_tablerow

public void pc4p_add_tablerow([ string $rowname ])

  If you have already defined a tablematrix, you can add a row with this function to every column

Parameter
string $rowname = >>""<<
Name for the new row
Returns void

See Also pc4p_init::&pc4p_create_object()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_add_tablecol

public void pc4p_add_tablecol([ string $colname ])

  If you have already defined a tablematrix, you can add a column with this function to every row

Parameter
string $colname = >>""<<
Name for the new column
Returns void

See Also pc4p_init::&pc4p_create_object()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_tablecolsize

public void pc4p_set_tablecolsize(array $colsize)

  Takes the provided widths and checks, if you used absolute or percentual sizes

Parameter
array $colsize
Width for every column. Arraysize has to correspond with the number of columns
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_cellborder

public void pc4p_set_cellborder(object pc4p_object &$cell, [ mixed $border, mixed $style, mixed $width ])

  With this function you can set the borders of a given cell for each side individually, or completely

Parameter
object pc4p_object &$cell
Cell, where you'd like to set the borders
mixed $border = >>"all"<<
"top", "bottom", "left", "right" or an array of these or "all"
mixed $style = >>"single"<<
"none", "single" or "double" or an array of these
mixed $width = >>1<<
The width of the line or an array with widths
Returns void

See Also pc4p_line::pc4p_set_linestyle(), pc4p_line::pc4p_set_linewidth()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_tableborder

public void pc4p_set_tableborder([ mixed $border, mixed $style, mixed $width ])

  With this function you can set the borders of a whole table.

Parameter
mixed $border = >>"all"<<
"top", "bottom", "left", "right" or an array of these or all
mixed $style = >>"single"<<
"none", "single" or "double" or an array of these
mixed $width = >>1<<
The width of the line or an array with widths
Returns void

See Also pc4p_table::pc4p_set_cellborder()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_cellbordercolor

public void pc4p_set_cellbordercolor(object pc4p_object &$cell, [ mixed $border, mixed $color ])

  With this function you can set the bordercolor of a given cell for each side individually, or completely

Parameter
object pc4p_object &$cell
Cell, where you'd like to set the bordercolor
mixed $border = >>"all"<<
"top", "bottom", "left", "right" or an array of these or all
mixed $color = >>""<<
Accepted values are the 16 standardcolors from HTML, the hex-notation (#rrggbb) or an array of these
Returns void

See Also pc4p_line::pc4p_set_linecolor()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_tablebordercolor

public void pc4p_set_tablebordercolor([ mixed $border, mixed $color ])

  With this function you can set the bordercolor of a whole table.

Parameter
mixed $border = >>"all"<<
"top", "bottom", "left", "right" or an array of these or all
mixed $color = >>""<<
Accepted values are the 16 standardcolors from HTML, the hex-notation (#rrggbb) or an array ( "top" => color, "bottom" => color, "left" => color, "right" => color ) where 'color' is one of the forementioned
Returns void

See Also pc4p_table::pc4p_set_cellbordercolor()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_cellfillcolor

public void pc4p_set_cellfillcolor(object pc4p_object &$cell, mixed $color)

  With this function you can set the fillcolor of a given cell

Parameter
object pc4p_object &$cell
Cell, where you'd like to set the fillcolor
mixed $color
Accepted values are the 16 standardcolors from HTML or the hex-notation (#rrggbb)
Returns void

See Also pc4p_main::pc4p_check_color()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_tablefillcolor

public void pc4p_set_tablefillcolor(mixed $color)

  With this function you can set the fillcolor of a whole table.

Parameter
mixed $color
Accepted values are the 16 standardcolors from HTML or the hex-notation (#rrggbb)
Returns void

See Also pc4p_table::pc4p_set_cellfillcolor()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_tableheader

public void pc4p_set_tableheader(string $rowname)

  If you want to use a certain row as a header, which is repeated on every new page after a pagebreak within a table, you can supply a rowname here to set it

Parameter
string $rowname
Name of the row, which shall be used as header
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_split_table

public object pc4p_table pc4p_split_table(integer $row)

  Very important function for pagebreak

Parameter
integer $row
Row, where the table shall be split
Returns object pc4p_table $split

Rest of the table, including the row you specified

See Also pc4p_object::pc4p_make_objcopy()
Author(s) Alexander Wirtz <alex@pc4p.net>

Private Method Details

pc4p_draw_children

private void pc4p_draw_children()

  Walks through the rows and cols and calls pc4p_draw in each cell; draws the borders around the cells

Warning: documentation is missing.

Returns void

See Also pc4p_line::pc4p_get_linewidth(), pc4p_object::pc4p_draw()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_calc_row_offset

private integer pc4p_calc_row_offset(object pc4p_page &$parent, integer $row)

  Calculates the offsets in all cells, especially the x-coordinates!!! Checks for alignments, predefined columnwidths...

Parameter
object pc4p_page &$parent
Parent of the table
integer $row
Which row shall be calculated
Returns integer $row_height

Calculated height of the table

See Also pc4p_line::pc4p_get_linewidth(), pc4p_line::pc4p_calc_linejoin(), pc4p_line::pc4p_set_width(), pc4p_line::pc4p_calc_offset(), pc4p_object::pc4p_set_width(), pc4p_object::pc4p_calc_offset()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_calc_offset

private integer pc4p_calc_offset(object pc4p_page &$parent)

  Wraps pc4p_calc_row_offset...

Warning: documentation is missing.

Parameter
object pc4p_page &$parent
Parent of the table
Returns integer $this

->height Calculated height of the table

See Also pc4p_table::pc4p_calc_row_offset()
Author(s) Alexander Wirtz <alex@pc4p.net>

Private Field Details

$cell

private array $cell

>><<


$colsize

private array $colsize

>><<


$rowsize

private array $rowsize

>><<


$colnames

private array $colnames

>>array()<<


$rownames

private array $rownames

>>array()<<


$tableheader

private string $tableheader

>><<

table is in



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Tue, 13 Aug 2002 00:43:10 +0200 by PHPDoc v1.5 www.phpdoc.de