wxRuby Documentation Home

# Wx::HtmlContainerCell

The HtmlContainerCell class is an implementation of a cell that may
contain more cells in it. It is heavily used in the HTML layout algorithm.

## Derived from

HtmlCell

## See Also

Cells Overview

## Methods

- HtmlContainerCell.new
- HtmlContainerCell#get_align_hor
- HtmlContainerCell#get_align_ver
- HtmlContainerCell#get_background_colour
- HtmlContainerCell#get_indent
- HtmlContainerCell#get_indent_units
- HtmlContainerCell#insert_cell
- HtmlContainerCell#set_align
- HtmlContainerCell#set_align_hor
- HtmlContainerCell#set_align_ver
- HtmlContainerCell#set_background_colour
- HtmlContainerCell#set_border
- HtmlContainerCell#set_indent
- HtmlContainerCell#set_min_height
- HtmlContainerCell#set_width_float

### HtmlContainerCell.new

HtmlContainerCell.new(%(arg-type)HtmlContainerCell% parent)

Constructor. parent is pointer to parent container or NULL.

### HtmlContainerCell#get_align_hor

Integer get_align_hor()

Returns container’s horizontal alignment.

### HtmlContainerCell#get_align_ver

Integer get_align_ver()

Returns container’s vertical alignment.

### HtmlContainerCell#get_background_colour

Colour get_background_colour()

Returns the background colour of the container or `NullColour` if no background
colour is set.

### HtmlContainerCell#get_indent

Integer get_indent(%(arg-type)Integer% ind)

Returns the indentation. ind is one of the *HTML_INDENT_** constants.

Note: You must call get_indent_units
with same ind parameter in order to correctly interpret the returned integer value.
It is NOT always in pixels!

### HtmlContainerCell#get_indent_units

Integer get_indent_units(%(arg-type)Integer% ind)

Returns the units of indentation for ind where ind is one
of the *HTML_INDENT_** constants.

### HtmlContainerCell#insert_cell

insert_cell(%(arg-type)HtmlCell% cell)

Inserts new cell into the container.

### HtmlContainerCell#set_align

set_align(%(arg-type)HtmlTag% tag)

Sets the container’s alignment (both horizontal and vertical) according to
the values stored in tag_. (Tags `ALIGN` parameter is extracted.) In fact
it is only a front-end to set_align_hor
and set_align_versetalignver.

### HtmlContainerCell#set_align_hor

set_align_hor(%(arg-type)Integer% al)

Sets the container’s horizontal alignment. During Layout
each line is aligned according to al value.

#### Parameters

- al new horizontal alignment. May be one of these values:

HTML_ALIGN_LEFT | lines are left-aligned (default)
HTML_ALIGN_JUSTIFY | lines are justified
HTML_ALIGN_CENTER | lines are centered
HTML_ALIGN_RIGHT | lines are right-aligned

### HtmlContainerCell#set_align_ver

set_align_ver(%(arg-type)Integer% al)

Sets the container’s vertical alignment. This is per-line alignment!

#### Parameters

- al new vertical alignment. May be one of these values:

HTML_ALIGN_BOTTOM | cells are over the line (default)
HTML_ALIGN_CENTER | cells are centered on line
HTML_ALIGN_TOP | cells are under the line

alignv.bmp

### HtmlContainerCell#set_background_colour

set_background_colour(%(arg-type)Colour% clr)

Sets the background colour for this container.

### HtmlContainerCell#set_border

set_border(%(arg-type)Colour% clr1, Colour clr2)

Sets the border (frame) colours. A border is a rectangle around the container.

#### Parameters

- clr1 Colour of top and left lines
- clr2 Colour of bottom and right lines

### HtmlContainerCell#set_indent

set_indent(%(arg-type)Integer% i, Integer what, Integer units = HTML_UNITS_PIXELS)

Sets the indentation (free space between borders of container and subcells).

#### Parameters

- i Indentation value.
- what Determines which of the four borders we’re setting. It is OR
  combination of following constants:

HTML_INDENT_TOP | top border
HTML_INDENT_BOTTOM | bottom
HTML_INDENT_LEFT | left
HTML_INDENT_RIGHT | right
HTML_INDENT_HORIZONTAL | left and right
HTML_INDENT_VERTICAL | top and bottom
HTML_INDENT_ALL | all 4 borders

indent.bmp

- units Units of i. This parameter affects interpretation of value.

HTML_UNITS_PIXELS | i is number of pixels
HTML_UNITS_PERCENT | i is interpreted as percents of widthof parent container

### HtmlContainerCell#set_min_height

set_min_height(%(arg-type)Integer% h, Integer align = HTML_ALIGN_TOP)

Sets minimal height of the container.

When container’s Layout is called, m_Height
is set depending on layout of subcells to the height of area covered
by layed-out subcells. Calling this method guarantees you that the height
of container is never smaller than h – even if the subcells cover
much smaller area.

#### Parameters

- h The minimal height.
- align If height of the container is lower than the minimum height, empty space must be inserted
  somewhere in order to ensure minimal height. This parameter is one of HTML_ALIGN_TOP,
  HTML_ALIGN_BOTTOM, HTML_ALIGN_CENTER. It refers to the contents, not to the
  empty place.

### HtmlContainerCell#set_width_float

set_width_float(%(arg-type)Integer% w, Integer units) set_width_float(%(arg-type)HtmlTag% tag, Float pixel_scale = 1.0)

Sets floating width adjustment.

The normal behaviour of container is that its width is the same as the width of
parent container (and thus you can have only one sub-container per line).
You can change this by setting FWA.

pixel_scale is number of real pixels that equals to 1 HTML pixel.

#### Parameters

- w Width of the container. If the value is negative it means
  complement to full width of parent container (e.g.
  `SetWidthFloat(-50, HTML_UNITS_PIXELS)` sets the width
  of container to parent’s width minus 50 pixels. This is useful when
  creating tables – you can call SetWidthFloat(50) and SetWidthFloat(-50))
- units Units of w This parameter affects the interpretation of value.

HTML_UNITS_PIXELS | w is number of pixels
HTML_UNITS_PERCENT | w is interpreted as percents of widthof parent container

- tag In the second version of method, w and units
  info is extracted from tag’s `WIDTH` parameter.

[This page automatically generated from the Textile source at 2023-06-09 00:45:29 +0000]