## wxHtmlContainerCell

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

Derived from

wxHtmlCell

Include files

<wx/html/htmlcell.h>

See Also

Cells Overview

Members

wxHtmlContainerCell::wxHtmlContainerCell
wxHtmlContainerCell::GetAlignHor
wxHtmlContainerCell::GetAlignVer
wxHtmlContainerCell::GetFirstCell
wxHtmlContainerCell::GetIndent
wxHtmlContainerCell::GetIndentUnits
wxHtmlContainerCell::InsertCell
wxHtmlContainerCell::SetAlign
wxHtmlContainerCell::SetAlignHor
wxHtmlContainerCell::SetAlignVer
wxHtmlContainerCell::SetBackgroundColour
wxHtmlContainerCell::SetBorder
wxHtmlContainerCell::SetIndent
wxHtmlContainerCell::SetMinHeight
wxHtmlContainerCell::SetWidthFloat

### wxHtmlContainerCell::wxHtmlContainerCell

wxHtmlContainerCell(wxHtmlContainerCell *parent)

Constructor. parent is pointer to parent container or NULL.

### wxHtmlContainerCell::GetAlignHor

int GetAlignHor() const

Returns container's horizontal alignment.

### wxHtmlContainerCell::GetAlignVer

int GetAlignVer() const

Returns container's vertical alignment.

### wxHtmlContainerCell::GetFirstCell

wxHtmlCell* GetFirstCell()

Returns pointer to the first cell in the list. You can then use wxHtmlCell's GetNext method to obtain pointer to the next cell in list.

Note: This shouldn't be used by the end user. If you need some way of finding particular cell in the list, try Find method instead.

### wxHtmlContainerCell::GetIndent

int GetIndent(int ind) const

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

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

### wxHtmlContainerCell::GetIndentUnits

int GetIndentUnits(int ind) const

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

### wxHtmlContainerCell::InsertCell

void InsertCell(wxHtmlCell *cell)

Inserts new cell into the container.

### wxHtmlContainerCell::SetAlign

void SetAlign(const wxHtmlTag& 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 SetAlignHor and SetAlignVer.

### wxHtmlContainerCell::SetAlignHor

void SetAlignHor(int 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:

wxHTML_ALIGN_LEFT | lines are left-aligned (default)
wxHTML_ALIGN_JUSTIFY | lines are justified
wxHTML_ALIGN_CENTER | lines are centered
wxHTML_ALIGN_RIGHT | lines are right-aligned

### wxHtmlContainerCell::SetAlignVer

void SetAlignVer(int al)

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

Parameters

al

new vertical alignment. May be one of these values:

wxHTML_ALIGN_BOTTOM | cells are over the line (default)
wxHTML_ALIGN_CENTER | cells are centered on line
wxHTML_ALIGN_TOP | cells are under the line

### wxHtmlContainerCell::SetBackgroundColour

void SetBackgroundColour(const wxColour& clr)

Sets the background colour for this container.

### wxHtmlContainerCell::SetBorder

void SetBorder(const wxColour& clr1, const wxColour& 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

### wxHtmlContainerCell::SetIndent

void SetIndent(int i, int what, int units = wxHTML_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:

wxHTML_INDENT_TOP | top border
wxHTML_INDENT_BOTTOM | bottom
wxHTML_INDENT_LEFT | left
wxHTML_INDENT_RIGHT | right
wxHTML_INDENT_HORIZONTAL | left and right
wxHTML_INDENT_VERTICAL | top and bottom
wxHTML_INDENT_ALL | all 4 borders

units

Units of i. This parameter affects interpretation of value.

wxHTML_UNITS_PIXELS | i is number of pixels
wxHTML_UNITS_PERCENT | i is interpreted as percents of width of parent container

### wxHtmlContainerCell::SetMinHeight

void SetMinHeight(int h, int align = wxHTML_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 wxHTML_ALIGN_TOP, wxHTML_ALIGN_BOTTOM, wxHTML_ALIGN_CENTER. It refers to the contents, not to the empty place.

### wxHtmlContainerCell::SetWidthFloat

void SetWidthFloat(int w, int units)

void SetWidthFloat(const wxHtmlTag& tag, double 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, wxHTML_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.

wxHTML_UNITS_PIXELS | w is number of pixels
wxHTML_UNITS_PERCENT | w is interpreted as percents of width of parent container

tag

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

wxPython note: The second form of this method is named SetWidthFloatFromTag in wxPython.