wx.html.HtmlContainerCell¶
The wx.html.HtmlContainerCell class is an implementation of a cell that may contain more cells in it.
It is heavily used in the HTML layout algorithm.
See also
Class Hierarchy¶
Methods Summary¶
Constructor. |
|
Detach a child cell. |
|
Returns container’s horizontal alignment. |
|
Returns container’s vertical alignment. |
|
Returns the background colour of the container or |
|
Returns the indentation. |
|
Returns the units of indentation for ind where ind is one of the |
|
Inserts a new cell into the container. |
|
Sets the container’s alignment (both horizontal and vertical) according to the values stored in tag. |
|
Sets the container’s horizontal alignment. |
|
Sets the container’s vertical alignment. |
|
Sets the background colour for this container. |
|
Sets the border (frame) colours. |
|
Sets the indentation (free space between borders of container and subcells). |
|
Sets minimal height of the container. |
|
Sets floating width adjustment. |
Properties Summary¶
See |
|
See |
|
Class API¶
- class wx.html.HtmlContainerCell(HtmlCell)¶
Possible constructors:
HtmlContainerCell(parent) -> None
The HtmlContainerCell class is an implementation of a cell that may contain more cells in it.
Methods¶
- __init__(self, parent)¶
Constructor.
parent is pointer to parent container or
None
.- Parameters:
parent (wx.html.HtmlContainerCell)
- Return type:
None
- Detach(self, cell)¶
Detach a child cell.
Detaching a cell removes it from this container and allows reattaching it to another one by using
InsertCell
. Alternatively, this method can be used to selectively remove some elements of the HTML document tree by deleting the cell after calling it.- Parameters:
cell (wx.html.HtmlCell) – Must be non-null and an immediate child of this cell.
- Return type:
None
Added in version 4.1/wxWidgets-3.1.2.
- GetAlignHor(self)¶
Returns container’s horizontal alignment.
- Return type:
int
- GetAlignVer(self)¶
Returns container’s vertical alignment.
- Return type:
int
- GetBackgroundColour(self)¶
Returns the background colour of the container or
NullColour
if no background colour is set.- Return type:
Colour
- GetIndent(self, ind)¶
Returns the indentation.
ind is one of the
HTML_INDENT_
constants.- Parameters:
ind (int)
- Return type:
int
Note
You must call
GetIndentUnits
with same ind parameter in order to correctly interpret the returned integer value. It is NOT always in pixels!
- GetIndentUnits(self, ind)¶
Returns the units of indentation for ind where ind is one of the
HTML_INDENT_
constants.- Parameters:
ind (int)
- Return type:
int
- InsertCell(self, cell)¶
Inserts a new cell into the container.
Note that the container takes ownership of the cell and will delete it when it itself is destroyed.
- Parameters:
cell (wx.html.HtmlCell)
- Return type:
None
- SetAlign(self, 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 toSetAlignHor
andSetAlignVer
.- Parameters:
tag (wx.html.HtmlTag)
- Return type:
None
- SetAlignHor(self, al)¶
Sets the container’s horizontal alignment.
During
wx.html.HtmlCell.Layout
each line is aligned according to al value.- Parameters:
al (int) – new horizontal alignment. May be one of these values:
wx.html.HTML_ALIGN_LEFT
: lines are left-aligned (default)wx.html.HTML_ALIGN_JUSTIFY
: lines are justifiedwx.html.HTML_ALIGN_CENTER
: lines are centeredwx.html.HTML_ALIGN_RIGHT
: lines are right-aligned
- Return type:
None
- SetAlignVer(self, al)¶
Sets the container’s vertical alignment.
This is per-line alignment!
- Parameters:
al (int) – new vertical alignment. May be one of these values:
wx.html.HTML_ALIGN_BOTTOM
: cells are over the line (default)wx.html.HTML_ALIGN_CENTER
: cells are centered on linewx.html.HTML_ALIGN_TOP
: cells are under the line
- Return type:
None
- SetBackgroundColour(self, clr)¶
Sets the background colour for this container.
- Parameters:
clr (wx.Colour)
- Return type:
None
- SetBorder(self, clr1, clr2, border=1)¶
Sets the border (frame) colours.
A border is a rectangle around the container.
- SetIndent(self, i, what, units=HTML_UNITS_PIXELS)¶
Sets the indentation (free space between borders of container and subcells).
- Parameters:
i (int) – Indentation value.
what (int) – Determines which of the four borders we’re setting. It is
wx.OR
combination of following constants:wx.html.HTML_INDENT_TOP
: top borderwx.html.HTML_INDENT_BOTTOM
: bottomwx.html.HTML_INDENT_LEFT
: leftwx.html.HTML_INDENT_RIGHT
: rightwx.html.HTML_INDENT_HORIZONTAL
: left and rightwx.html.HTML_INDENT_VERTICAL
: top and bottomwx.html.HTML_INDENT_ALL
: all 4 borders
units (int) – Units of i. This parameter affects interpretation of value.
wx.html.HTML_UNITS_PIXELS
: i is number of pixelswx.html.HTML_UNITS_PERCENT
: i is interpreted as percents of width of parent container
- Return type:
None
- SetMinHeight(self, h, align=HTML_ALIGN_TOP)¶
Sets minimal height of the container.
When container’s
wx.html.HtmlCell.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 (int) – The minimal height.
align (int) – 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.
- Return type:
None
- SetWidthFloat(self, *args, **kw)¶
-
SetWidthFloat (self, w, units)
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 the floating width adjustment.
- Parameters:
w (int) – Width of the container. If the value is negative it means complement to full width of parent container. E.g.:
SetWidthFloat(-50, wx.html.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 (int) – Units of w This parameter affects the interpretation of value.
wx.html.HTML_UNITS_PIXELS
: w is number of pixelswx.html.HTML_UNITS_PERCENT
: w is interpreted as percents of width of parent container
- Return type:
None
SetWidthFloat (self, tag, 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 the floating width adjustment.
- Parameters:
tag (wx.html.HtmlTag) – In the second version of method, w and units info is extracted from tag’s
WIDTH
parameter.pixel_scale (float) – This is number of real pixels that equals to 1 HTML pixel.
- Return type:
None
Properties¶
- AlignHor¶
See
GetAlignHor
andSetAlignHor
- AlignVer¶
See
GetAlignVer
andSetAlignVer
- BackgroundColour¶