本文整理汇总了PHP中GenericFormattedBox类的典型用法代码示例。如果您正苦于以下问题:PHP GenericFormattedBox类的具体用法?PHP GenericFormattedBox怎么用?PHP GenericFormattedBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GenericFormattedBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: show
function show(&$driver)
{
// Now set the baseline of a button box to align it vertically when flowing isude the
// text line
$this->default_baseline = $this->content[0]->baseline + $this->get_extra_top();
$this->baseline = $this->content[0]->baseline + $this->get_extra_top();
/**
* If we're rendering the interactive form, the field content should not be rendered
*/
global $g_config;
if ($g_config['renderforms']) {
/**
* Render background/borders only
*/
$status = GenericFormattedBox::show($driver);
/**
* @todo encoding name?
* @todo font name?
* @todo check if font is embedded for PDFLIB
*/
$driver->field_text($this->get_left_padding(), $this->get_top_padding(), $this->get_width() + $this->get_padding_left() + $this->get_padding_right(), $this->get_height(), $this->_value, $this->_field_name);
} else {
/**
* Render everything, including content
*/
$status = GenericContainerBox::show($driver);
}
return $status;
}
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:29,代码来源:box.input.text.php
示例2: show
/**
* Renders the background for the given box object using an output driver
*
* @param OutputDriver $driver Output driver to be used
* @param GenericFormattedBox $box Box the background is rendered for
*
* @uses GenericFormattedBox
* @uses OutputDriver
*/
function show(&$driver, &$box)
{
/**
* Fill box with background color
*
* @see Color::apply
* @see OutputDriver::moveto
* @see OutputDriver::lineto
* @see OutputDriver::closepath
* @see OutputDriver::fill
*/
if (!$this->_color->transparent) {
$this->_color->apply($driver);
$driver->moveto($box->get_left_background(), $box->get_top_background());
$driver->lineto($box->get_right_background(), $box->get_top_background());
$driver->lineto($box->get_right_background(), $box->get_bottom_background());
$driver->lineto($box->get_left_background(), $box->get_bottom_background());
$driver->closepath();
$driver->fill();
}
/**
* Render background image
*
* @see BackgroundImage::show
*/
$this->_image->show($driver, $box, $this->_repeat, $this->_position, $this->_attachment);
}
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:36,代码来源:value.background.php
示例3: reflow
function reflow(&$parent, &$context)
{
// Check if there are any boxes in parent's line box
if ($parent->line_box_empty()) {
// The very first whitespace in the line box should not affect neither height nor baseline of the line box;
// because following boxes can be smaller that assumed whitespace height
// Example: <br>[whitespace]<img height="2" width="2"><br>; whitespace can overextend this line
$this->width = 0;
$this->height = 0;
} elseif (is_a($parent->last_in_line(), "WhitespaceBox")) {
// Duplicate whitespace boxes should not offset further content and affect the line box length
$this->width = 0;
$this->height = 0;
}
GenericFormattedBox::reflow($parent, $context);
// Apply 'line-height'
$this->_apply_line_height();
// default baseline
$this->baseline = $this->default_baseline;
// append to parent line box
$parent->append_line($this);
// Move box to the parent current point
$this->guess_corner($parent);
// Offset parent's current point
$parent->_current_x += $this->width;
// Extend parent height
$parent->extend_height($this->get_bottom_margin());
// Update the value of current collapsed margin; pure text (non-span)
// boxes always have zero margin
$context->pop_collapsed_margin();
$context->push_collapsed_margin(0);
}
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:32,代码来源:box.whitespace.php
示例4: reflow_static
function reflow_static(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
// Determine the box width
$this->_calc_percentage_width($parent, $context);
$this->put_full_width($this->get_min_width($context, $parent->get_width()));
$this->setCSSProperty(CSS_WIDTH, new WCNone());
// Check if we need a line break here
$this->maybe_line_break($parent, $context);
// append to parent line box
$parent->append_line($this);
// Determine coordinates of upper-left _margin_ corner
$this->guess_corner($parent);
$this->reflow_content($context);
/**
* After text content have been reflown, we may determine the baseline of the control item itself;
*
* As there will be some extra whitespace on the top of the control box, we must add this whitespace
* to the calculated baseline value, so text before and after control item will be aligned
* with the text inside the box.
*/
$this->default_baseline = $this->content[0]->baseline + $this->get_extra_top();
$this->baseline = $this->content[0]->baseline + $this->get_extra_top();
// center the button text vertically inside the button
$text =& $this->content[0];
$delta = $text->get_top() - $text->get_height() / 2 - ($this->get_top() - $this->get_height() / 2);
$text->offset(0, -$delta);
// Offset parent current X coordinate
$parent->_current_x += $this->get_full_width();
// Extends parents height
$parent->extend_height($this->get_bottom_margin());
}
开发者ID:emildev35,项目名称:processmaker,代码行数:32,代码来源:box.inline.control.php
示例5: show_field
function show_field(&$driver)
{
if (is_null(GenericFormattedBox::show($driver))) {
return null;
}
$driver->field_select($this->get_left_padding(), $this->get_top_padding(), $this->get_width() + $this->get_padding_left() + $this->get_padding_right(), $this->get_height(), $this->_name, $this->_value, $this->_options);
return true;
}
开发者ID:isantiago,项目名称:foswiki,代码行数:8,代码来源:box.select.php
示例6: reflow_absolute
/**
* Reflow absolutely positioned block box. Note that according to CSS 2.1
* the only types of boxes which could be absolutely positioned are
* 'block' and 'table'
*
* @param FlowContext $context A flow context object containing the additional layout data.
*
* @link http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo CSS 2.1: Relationships between 'display', 'position', and 'float'
*/
function reflow_absolute(&$context)
{
GenericFormattedBox::reflow($this->parent, $context);
$position_strategy =& new StrategyPositionAbsolute();
$position_strategy->apply($this);
/**
* As sometimes left/right values may not be set, we need to use the "fit" width here.
* If box have a width constraint, 'get_max_width' will return constrained value;
* othersise, an intrictic width will be returned.
*
* Note that get_max_width returns width _including_ external space line margins, borders and padding;
* as we're setting the "internal" - content width, we must subtract "extra" space width from the
* value received
*
* @see GenericContainerBox::get_max_width()
*/
$this->put_width($this->get_max_width($context) - $this->_get_hor_extra());
/**
* Update the width, as it should be calculated based upon containing block width, not real parent.
* After this we should remove width constraints or we may encounter problem
* in future when we'll try to call get_..._width functions for this box
*
* @todo Update the family of get_..._width function so that they would apply constraint
* using the containing block width, not "real" parent width
*/
$wc = $this->getCSSProperty(CSS_WIDTH);
$containing_block =& $this->_get_containing_block();
$this->put_width($wc->apply($this->get_width(), $containing_block['right'] - $containing_block['left']));
$this->setCSSProperty(CSS_WIDTH, new WCNone());
/**
* Layout element's children
*/
$this->reflow_content($context);
/**
* As absolute-positioned box generated new flow contexy, extend the height to fit all floats
*/
$this->fitFloats($context);
/**
* If element have been positioned using 'right' or 'bottom' property,
* we need to offset it, as we assumed it had zero width and height at
* the moment we placed it
*/
$right = $this->getCSSProperty(CSS_RIGHT);
$left = $this->getCSSProperty(CSS_LEFT);
if ($left->isAuto() && !$right->isAuto()) {
$this->offset(-$this->get_width(), 0);
}
$bottom = $this->getCSSProperty(CSS_BOTTOM);
$top = $this->getCSSProperty(CSS_TOP);
if ($top->isAuto() && !$bottom->isAuto()) {
$this->offset(0, $this->get_height());
}
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:62,代码来源:box.frame.php
示例7: reflow
function reflow(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
// set default baseline
$this->baseline = $this->default_baseline;
// append to parent line box
$parent->append_line($this);
// Determine coordinates of upper-left _margin_ corner
$this->guess_corner($parent);
// Offset parent current X coordinate
$parent->_current_x += $this->get_full_width();
// Extends parents height
$parent->extend_height($this->get_bottom_margin());
}
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:14,代码来源:box.radiobutton.php
示例8: show
function show(&$driver)
{
/**
* If we're rendering the interactive form, the field content should not be rendered
*/
global $g_config;
if ($g_config['renderforms']) {
$status = GenericFormattedBox::show($driver);
$driver->field_multiline_text($this->get_left_padding(), $this->get_top_padding(), $this->get_width() + $this->get_padding_left() + $this->get_padding_right(), $this->get_height() + $this->get_padding_top() + $this->get_padding_bottom(), $this->_value, $this->_field_name);
} else {
$status = GenericContainerBox::show($driver);
}
return $status;
}
开发者ID:isantiago,项目名称:foswiki,代码行数:14,代码来源:box.input.textarea.php
示例9: reflow
function reflow(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
// Determine upper-left _content_ corner position of current box
$this->put_left($parent->get_left_padding());
$this->put_top($parent->get_top_padding());
// Legends will not wrap
$this->put_full_width($this->get_max_width($context));
// Reflow contents
$this->reflow_content($context);
// Adjust legend position
$height = $this->get_full_height();
$this->offset(units2pt(LEGEND_HORIZONTAL_OFFSET) + $this->get_extra_left(), $height / 2);
// Adjust parent position
$parent->offset(0, -$height / 2);
// Adjust parent content position
for ($i = 0; $i < count($parent->content); $i++) {
if ($parent->content[$i]->uid != $this->uid) {
$parent->content[$i]->offset(0, -$height / 2);
}
}
$parent->_current_y -= $height / 2;
$parent->extend_height($this->get_bottom_margin());
}
开发者ID:isantiago,项目名称:foswiki,代码行数:24,代码来源:box.legend.php
示例10: reflow_static
/**
* Layout current 'inline-block' element assument it has 'position: static'
*
* @param GenericContainerBox $parent The document element which should
* be treated as the parent of current element
*
* @param FlowContext $context The flow context containing the additional layout data
*
* @see FlowContext
* @see GenericContainerBox
*
* @todo re-check this layout routine; it seems that 'inline-block' boxes have
* their width calculated incorrectly
*/
function reflow_static(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
/**
* Calculate margin values if they have been set as a percentage
*/
$this->_calc_percentage_margins($parent);
/**
* Calculate width value if it had been set as a percentage
*/
$this->_calc_percentage_width($parent, $context);
/**
* Calculate 'auto' values of width and margins
*/
$this->_calc_auto_width_margins($parent);
/**
* add current box to the parent's line-box (alone)
*/
$parent->append_line($this);
/**
* Calculate position of the upper-left corner of the current box
*/
$this->guess_corner($parent);
/**
* By default, child block box will fill all available parent width;
* note that actual content width will be smaller because of non-zero padding, border and margins
*/
$this->put_full_width($parent->get_width());
/**
* Layout element's children
*/
$this->reflow_content($context);
/**
* Calculate element's baseline, as it should be aligned inside the
* parent's line box vertically
*/
$this->default_baseline = $this->get_height() + $this->font_size;
/**
* Extend parent's height to fit current box
*/
$parent->extend_height($this->get_bottom_margin());
/**
* Offset current x coordinate of parent box
*/
$parent->_current_x = $this->get_right_margin();
}
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:60,代码来源:box.block.inline.php
示例11: show
function show(&$driver)
{
// draw generic box
GenericFormattedBox::show($driver);
// Check if "designer" set the height or width of this image to zero; in this there will be no reason
// in drawing the image at all
//
if ($this->get_width() < EPSILON || $this->get_height() < EPSILON || is_null($this->image->_handle)) {
return true;
}
$driver->image_scaled($this->image, $this->get_left(), $this->get_bottom(), $this->get_width() / $this->image->sx(), $this->get_height() / $this->image->sy());
$strategy =& new StrategyLinkRenderingNormal();
$strategy->apply($this, $driver);
return true;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:15,代码来源:box.img.php
示例12: reflow_anchors
function reflow_anchors(&$viewport, &$anchors)
{
GenericFormattedBox::reflow_anchors($viewport, $anchors);
$size = count($this->content);
for ($i = 0; $i < $size; $i++) {
$this->content[$i]->reflow_anchors($viewport, $anchors);
}
}
开发者ID:emildev35,项目名称:processmaker,代码行数:8,代码来源:box.container.php
示例13: show
function show(&$viewport)
{
// draw generic box
GenericFormattedBox::show($viewport);
// Check if "designer" set the height or width of this image to zero; in this there will be no reason
// in drawing the image at all
//
if ($this->get_width() < EPSILON || $this->get_height() < EPSILON) {
return true;
}
$viewport->image_scaled($this->image, $this->get_left(), $this->get_bottom(), $this->get_width() / imagesx($this->image), $this->get_height() / imagesy($this->image));
return true;
}
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:13,代码来源:box.img.php
示例14: reflow_static_normal
/**
* Layout normal (non-floating) static-positioned block box.
*
* @param GenericContainerBox $parent The document element which should be treated as the parent of current element
* @param FlowContext $context The flow context containing the additional layout data
*
* @see FlowContext
* @see GenericContainerBox
*/
function reflow_static_normal(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
if ($parent) {
/**
* Child block will fill the whole content width of the parent block.
*
* 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' +
* 'border-right-width' + 'margin-right' = width of containing block
*
* See CSS 2.1 for more detailed explanation
*
* @link http://www.w3.org/TR/CSS21/visudet.html#blockwidth CSS 2.1. 10.3.3 Block-level, non-replaced elements in normal flow
*/
$this->put_full_width($parent->get_width());
/**
* Calculate margin values if they have been set as a percentage; replace percentage-based values
* with fixed lengths.
*/
$this->_calc_percentage_margins($parent);
/**
* Calculate width value if it had been set as a percentage; replace percentage-based value
* with fixed value
*/
$this->_calc_percentage_width($parent, $context);
/**
* Calculate 'auto' values of width and margins. Unlike tables, DIV width is either constrained
* by some CSS rules or expanded to the parent width; thus, we can calculate 'auto' margin
* values immediately.
*
* @link http://www.w3.org/TR/CSS21/visudet.html#Computing_widths_and_margins CSS 2.1 Calculating widths and margins
*/
$this->_calc_auto_width_margins($parent);
/**
* Collapse top margin
*
* @see GenericFormattedBox::collapse_margin()
*
* @link http://www.w3.org/TR/CSS21/box.html#collapsing-margins CSS 2.1 Collapsing margins
*/
$y = $this->collapse_margin($parent, $context);
/**
* At this moment we have top parent/child collapsed margin at the top of context object
* margin stack
*/
/**
* Apply 'clear' property; the current Y coordinate can be modified as a result of 'clear'.
*/
$y = $this->apply_clear($y, $context);
/**
* Store calculated Y coordinate as current Y coordinate in the parent box
* No more content will be drawn abowe this mark; current box padding area will
* start below.
*/
$parent->_current_y = $y;
/**
* Terminate current parent line-box (as current box is not inline)
*/
$parent->close_line($context);
/**
* Add current box to the parent's line-box; we will close the line box below
* after content will be reflown, so the line box will contain only current box.
*/
$parent->append_line($this);
/**
* Now, place the current box upper left content corner. Note that we should not
* use get_extra_top here, as _current_y value already culculated using the top margin value
* of the current box! The top content edge should be offset from that level only of padding and
* border width.
*/
$this->moveto($parent->get_left() + $this->get_extra_left(), $parent->_current_y - $this->border->top->get_width() - $this->padding->top->value);
}
/**
* Reflow element's children
*/
$this->reflow_content($context);
/**
* After child elements have been reflown, we should the top collapsed margin stack value
* replaced by the value of last child bottom collapsed margin;
* if no children contained, then this value should be reset to 0.
*
* Note that invisible and
* whitespaces boxes would not affect the collapsed margin value, so we need to
* use 'get_first' function instead of just accessing the $content array.
*
* @see GenericContainerBox::get_first
*/
if (!is_null($this->get_first())) {
$cm = 0;
} else {
$cm = $context->get_collapsed_margin();
//.........这里部分代码省略.........
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:101,代码来源:box.block.php
示例15: reflow_static_normal
/**
* TODO: unlike block elements, table unconstrained width is determined
* with its content, so it may be smaller than parent available width!
*/
function reflow_static_normal(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
// Calculate margin values if they have been set as a percentage
$this->_calc_percentage_margins($parent);
// Calculate width value if it had been set as a percentage
$this->_calc_percentage_width($parent, $context);
$wc = $this->getCSSProperty(CSS_WIDTH);
if ($wc && !$wc->isNull()) {
$col_width = $this->get_table_columns_min_widths($context);
$maxw = $this->get_table_columns_max_widths($context);
$col_width = $this->_table_apply_colspans($col_width, $context, 'get_min_width', $col_width, $maxw);
if (array_sum($col_width) > $this->get_width()) {
$wc = new WCConstant(array_sum($col_width));
}
}
// As table width can be deterimined by its contents, we may calculate auto values
// only AFTER the contents have been reflown; thus, we'll offset the table
// as a whole by a value of left margin AFTER the content reflow
// Do margin collapsing
$y = $this->collapse_margin($parent, $context);
// At this moment we have top parent/child collapsed margin at the top of context object
// margin stack
$y = $this->apply_clear($y, $context);
// Store calculated Y coordinate as current Y in the parent box
$parent->_current_y = $y;
// Terminate current parent line-box
$parent->close_line($context);
// And add current box to the parent's line-box (alone)
$parent->append_line($this);
// Determine upper-left _content_ corner position of current box
// Also see note above regarding margins
$border = $this->getCSSProperty(CSS_BORDER);
$padding = $this->getCSSProperty(CSS_PADDING);
$plus = $parent->_current_x;
if ($border->left) {
$plus += $border->left->get_width();
}
if ($padding->left) {
$plus += $padding->left->value;
}
$this->put_left($plus);
// Note that top margin already used above during maring collapsing
$mins = $parent->_current_y;
if ($border->top) {
$mins -= $border->top->get_width();
}
if ($padding->top) {
$mins -= $padding->top->value;
}
$this->put_top($mins);
/**
* By default, child block box will fill all available parent width;
* note that actual width will be smaller because of non-zero padding, border and margins
*/
$this->put_full_width($parent->get_available_width($context));
// Reflow contents
$this->reflow_content($context);
// Update the collapsed margin value with current box bottom margin
$margin = $this->getCSSProperty(CSS_MARGIN);
$context->pop_collapsed_margin();
$context->pop_collapsed_margin();
$context->push_collapsed_margin($margin->bottom->value);
// Calculate margins and/or width is 'auto' values have been specified
$this->_calc_auto_width_margins($parent);
$this->offset($margin->left->value, 0);
// Extend parent's height to fit current box
$parent->extend_height($this->get_bottom_margin());
// Terminate parent's line box
$parent->close_line($context);
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:75,代码来源:box.table.php
示例16: show
/**
* Renders the backgroung image using the specified output driver.
*
* @param OutputDriver $driver an output driver object
* @param GenericFormattedBox $box an box owning this background image
* @param int $repeat the 'background-repeat' value
* @param BackgroundPosition $position the 'background-position' value
*
* @uses BackgroundPosition
* @uses OutputDriver
*/
function show(&$driver, $box, $repeat, $position, $attachment)
{
/**
* If no image should be rendered, just return
* @see BackgroundImage::$_url
*/
if (is_null($this->_url)) {
return;
}
if (is_null($this->_image)) {
return;
}
if ($attachment == BACKGROUND_ATTACHMENT_FIXED && $box->getCSSProperty(CSS_DISPLAY) == '-body') {
$media =& $driver->get_media();
$left = $box->get_left_background();
$right = $box->get_right_background();
$top = $driver->offset + mm2pt($media->margins['bottom']) + mm2pt($media->real_height());
$bottom = $driver->offset + mm2pt($media->margins['bottom']);
} else {
$left = $box->get_left_background();
$right = $box->get_right_background();
$top = $box->get_top_background();
$bottom = $box->get_bottom_background();
}
/**
* Setup clipping region for padding area. Note that background image is drawn in the padding
* area which in generic case is greater than content area.
*
* @see OutputDriver::clip()
*
* @link http://www.w3.org/TR/CSS21/box.html#box-padding-area CSS 2.1 definition of padding area
*/
$driver->save();
$driver->moveto($left, $top);
$driver->lineto($right, $top);
$driver->lineto($right, $bottom);
$driver->lineto($left, $bottom);
$driver->closepath();
$driver->clip();
/**
* get real image size in device points
*
* @see pt2pt()
* @see px2pt()
*/
$image_height = px2pt(imagesy($this->_image));
$image_width = px2pt(imagesx($this->_image));
/**
* Get dimensions of the rectangle to be filled with the background image
*/
$padding_width = $right - $left;
$padding_height = $top - $bottom;
/**
* Calculate the vertical offset from the top padding edge to the background image top edge using current
* 'background-position' value.
*
* @link file:///C:/docs/css/colors.html#propdef-background-position CSS 2 'background-position' description
*/
if ($position->x_percentage) {
$x_offset = ($padding_width - $image_width) * $position->x / 100;
} else {
$x_offset = $position->x;
}
/**
* Calculate the horizontal offset from the left padding edge to the background image left edge using current
* 'background-position' value
*
* @link file:///C:/docs/css/colors.html#propdef-background-position CSS 2 'background-position' description
*/
if ($position->y_percentage) {
$y_offset = ($padding_height - $image_height) * $position->y / 100;
} else {
$y_offset = $position->y;
}
/**
* Output the image (probably tiling it; depends on current value of 'background-repeat') using
* current output driver's tiled image output functions. Note that px2pt(1) is an image scaling factor; as all
* page element are scaled to fit the media, background images should be scaled too!
*
* @see OutputDriver::image()
* @see OutputDriver::image_rx()
* @see OutputDriver::image_ry()
* @see OutputDriver::image_rxry()
*
* @link file:///C:/docs/css/colors.html#propdef-background-repeat CSS 2.1 'background-repeat' property description
*/
switch ($repeat) {
case BR_NO_REPEAT:
/**
//.........这里部分代码省略.........
开发者ID:emildev35,项目名称:processmaker,代码行数:101,代码来源:background.image.php
示例17: reflow_static_normal
function reflow_static_normal(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
// if ($parent) {
// Calculate margin values if they have been set as a percentage
$this->_calc_percentage_margins($parent);
// Calculate width value if it had been set as a percentage
$this->_calc_percentage_width($parent, $context);
if (!is_a($this->_width_constraint, "WCNone")) {
$col_width = $this->get_table_columns_min_widths($context);
if (array_sum($col_width) > $this->get_width()) {
$this->_width_constraint = new WCNone();
}
}
// As table width can be deterimined by its contents, we may calculate auto values
// only AFTER the contents have been reflown; thus, we'll offset the table
// as a whole by a value of left margin AFTER the content reflow
// Do margin collapsing
$y = $this->collapse_margin($parent, $context);
// At this moment we have top parent/child collapsed margin at the top of context object
// margin stack
$y = $this->apply_clear($y, $context);
// Store calculated Y coordinate as current Y in the parent box
$parent->_current_y = $y;
// Terminate current parent line-box
$parent->close_line($context);
// And add current box to the parent's line-box (alone)
$parent->append_line($this);
// Determine upper-left _content_ corner position of current box
// Also see note above regarding margins
$this->put_left($parent->_current_x + $this->border->left->get_width() + $this->padding->left->value);
// Note that top margin already used above during maring collapsing
$this->put_top($parent->_current_y - $this->border->top->get_width() - $this->padding->top->value);
// By default, child block box will fill all available parent width;
// note that actual width will be smaller because of non-zero padding, border and margins
$this->put_full_width($parent->get_available_width($context));
// }
// Reflow contents
$this->reflow_content($context);
// Update the collapsed margin value with current box bottom margin
$context->pop_collapsed_margin();
$context->pop_collapsed_margin();
$context->push_collapsed_margin($this->margin->bottom->value);
// if ($parent) {
// Calculate margins and/or width is 'auto' values have been specified
$this->_calc_auto_width_margins($parent);
$this->offset($this->margin->left->value, 0);
// Extend parent's height to fit current box
$parent->extend_height($this->get_bottom_margin());
// Terminate parent's line box
$parent->close_line($context);
// };
}
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:53,代码来源:box.table.php
示例18: reflow
/**
* Layout current checkbox element. Note that most CSS properties do not apply to the
* checkboxes; i.e. margin/padding values are ignored, checkboxes always aligned to
* to bottom of current line, etc.
*
* @param GenericContainerBox $parent
* @param FlowContext $context Context object describing current flow parameters
*
* @return Boolean flag indicating the error/success state; 'null' value in case of critical error
*/
function reflow(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
/**
* Check box size is constant (defined in config.inc.php) and is never affected
* neither by CSS nor HTML. Call setup_dimensions once more to restore possible
* changes size
*
* @see CHECKBOX_SIZE
*/
$this->setup_dimensions();
// set default baseline
$this->baseline = $this->default_baseline;
// // Vertical-align
// $this->_apply_vertical_align($parent);
/**
* append to parent line box
*/
$parent->append_line($this);
/**
* Determine coordinates of upper-left margin corner
*/
$this->guess_corner($parent);
/**
* Offset parent current X coordinate
*/
$parent->_current_x += $this->get_full_width();
/**
* Extend parents height to fit the checkbox
*/
$parent->extend_height($this->get_bottom_margin());
}
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:42,代码来源:box.checkbutton.php
示例19: reflow
/**
* Layout current checkbox element. Note that most CSS properties do not apply to the
* checkboxes; i.e. margin/padding values are ignored, checkboxes always aligned to
* to bottom of current line, etc.
*
* @param GenericContainerBox $parent
* @param FlowContext $context Context object describing current flow parameters
*
* @return Boolean flag indicating the error/success state; 'null' value in case of critical error
*/
function reflow(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
// set default baseline
$this->baseline = $this->default_baseline;
// // Vertical-align
// $this->_apply_vertical_align($parent);
/**
* append to parent line box
*/
$parent->append_line($this);
/**
* Determine coordinates of upper-left margin corner
*/
$this->guess_corner($parent);
/**
* Offset parent current X coordinate
*/
$parent->_current_x += $this->get_full_width();
/**
* Extend parents height to fit the checkbox
*/
$parent->extend_height($this->get_bottom_margin());
}
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:34,代码来源:box.checkbutton.php
示例20: reflow
function reflow(&$parent, &$context)
{
GenericFormattedBox::reflow($parent, $context);
global $g_config;
$size = count($this->content);
if ($g_config['mode'] == "quirks" && $size > 0) {
// QUIRKS MODE:
// H1-H6 and P elements should have their top/bottom margin suppressed if they occur as the first/last table cell child
// correspondingly; note that we cannot do it usung CSS rules, as there's no selectors for the last child.
//
$first =& $this->get_first();
if (!is_null($first) && $this->_suppress_first && $first->isBlockLevel()) {
$first->margin->top->value = 0;
$first->margin->top->percentage = null;
}
$last =& $this->get_last();
if (!is_null($last) && $this->_suppress_last && $last->isBlockLevel()) {
$last->margin->bottom->value = 0;
$last->margin->bottom->percentage = null;
}
}
// Determine upper-left _content_ corner position of current box
$this->put_left($parent->_current_x + $this->get_extra_left());
// NOTE: Table cell margin is used as a cell-spacing value
$border = $this->getCSSProperty(CSS_BORDER);
$padding = $this->getCSSProperty(CSS_PADDING);
$this->put_top($parent->_current_y - $border->top->get_width() - $padding->top->value);
// CSS 2.1:
// Floats, absolutely positioned elements, inline-blocks, table-cells, and elements with 'overflow' other than
// 'visible' establish new block formatting contexts.
$context->push();
$context->push_container_uid($this->uid);
// Reflow cell content
$this->reflow_content($context);
// Extend the table cell height to fit all contained floats
//
// Determine the bottom edge corrdinate of the bottommost float
//
$float_bottom = $context->float_bottom();
if (!is_null($float_bottom)) {
$this->extend_height($float_bottom);
}
// Restore old context
$context->pop_container_uid();
$context->pop();
}
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:46,代码来源:box.table.cell.php
注:本文中的GenericFormattedBox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论