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
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. |
See |
|
See |
|
wx.html.
HtmlContainerCell
(HtmlCell)¶Possible constructors:
HtmlContainerCell(parent)
The HtmlContainerCell class is an implementation of a cell that may contain more cells in it.
__init__
(self, parent)¶Constructor.
parent is pointer to parent container or None
.
parent (wx.html.HtmlContainerCell) –
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.
cell (wx.html.HtmlCell) – Must be non-null and an immediate child of this cell.
New in version 4.1/wxWidgets-3.1.2.
GetAlignHor
(self)¶Returns container’s horizontal alignment.
int
GetAlignVer
(self)¶Returns container’s vertical alignment.
int
GetBackgroundColour
(self)¶Returns the background colour of the container or NullColour
if no background colour is set.
Colour
GetIndent
(self, ind)¶Returns the indentation.
ind is one of the HTML_INDENT_
constants.
ind (int) –
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.
ind (int) –
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.
cell (wx.html.HtmlCell) –
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 to SetAlignHor
and SetAlignVer
.
tag (wx.html.HtmlTag) –
SetAlignHor
(self, al)¶Sets the container’s horizontal alignment.
During wx.html.HtmlCell.Layout
each line is aligned according to al value.
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 justified
wx.html.HTML_ALIGN_CENTER
: lines are centered
wx.html.HTML_ALIGN_RIGHT
: lines are right-aligned
SetAlignVer
(self, al)¶Sets the container’s vertical alignment.
This is per-line alignment!
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 line
wx.html.HTML_ALIGN_TOP
: cells are under the line
SetBackgroundColour
(self, clr)¶Sets the background colour for this container.
clr (wx.Colour) –
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).
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 border
wx.html.HTML_INDENT_BOTTOM
: bottom
wx.html.HTML_INDENT_LEFT
: left
wx.html.HTML_INDENT_RIGHT
: right
wx.html.HTML_INDENT_HORIZONTAL
: left and right
wx.html.HTML_INDENT_VERTICAL
: top and bottom
wx.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 pixels
wx.html.HTML_UNITS_PERCENT
: i is interpreted as percents of width of parent container
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.
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.
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.
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 pixels
wx.html.HTML_UNITS_PERCENT
: w is interpreted as percents of width of parent container
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.
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.
AlignHor
¶See GetAlignHor
and SetAlignHor
AlignVer
¶See GetAlignVer
and SetAlignVer
BackgroundColour
¶