| Version: 3.2.2

Public Member Functions | List of all members
wxHtmlContainerCell Class Reference
Class List by Category » HTML

`#include <wx/html/htmlcell.h>`

Inheritance diagram for wxHtmlContainerCell:
[legend]

## Detailed Description

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.

##

Library: wxHTML
Category: HTML

See also
  Cells and Containers

## Public Member Functions

| wxHtmlContainerCell (wxHtmlContainerCell *parent)
| Constructor. More...
void | Detach (wxHtmlCell *cell)
| Detach a child cell. More...
int | GetAlignHor () const
| Returns container's horizontal alignment. More...
int | GetAlignVer () const
| Returns container's vertical alignment. More...
wxColour | GetBackgroundColour ()
| Returns the background colour of the container or `wxNullColour` if no background colour is set. More...
int | GetIndent (int ind) const
| Returns the indentation. More...
int | GetIndentUnits (int ind) const
| Returns the units of indentation for ind where ind is one of the wxHTML_INDENT_* constants. More...
void | InsertCell (wxHtmlCell *cell)
| Inserts a new cell into the container. More...
void | SetAlign (const wxHtmlTag &tag)
| Sets the container's alignment (both horizontal and vertical) according to the values stored in tag. More...
void | SetAlignHor (int al)
| Sets the container's horizontal alignment. More...
void | SetAlignVer (int al)
| Sets the container's vertical alignment. More...
void | SetBackgroundColour (const wxColour &clr)
| Sets the background colour for this container. More...
void | SetBorder (const wxColour &clr1, const wxColour &clr2, int border=1)
| Sets the border (frame) colours. More...
void | SetIndent (int i, int what, int units=wxHTML_UNITS_PIXELS)
| Sets the indentation (free space between borders of container and subcells). More...
void | SetMinHeight (int h, int align=wxHTML_ALIGN_TOP)
| Sets minimal height of the container. More...
void | SetWidthFloat (int w, int units)
| Sets floating width adjustment. More...
void | SetWidthFloat (const wxHtmlTag &tag, double pixel_scale=1.0)
| Sets floating width adjustment. More...
Public Member Functions inherited from wxHtmlCell
| wxHtmlCell ()
| Constructor. More...
virtual bool | AdjustPagebreak (int *pagebreak, int pageHeight) const
| This method is called when paginating HTML, e.g. when printing. More...
virtual void | Draw (wxDC &dc, int x, int y, int view_y1, int view_y2, wxHtmlRenderingInfo &info)
| Renders the cell. More...
virtual void | DrawInvisible (wxDC &dc, int x, int y, wxHtmlRenderingInfo &info)
| This method is called instead of Draw() when the cell is certainly out of the screen (and thus invisible). More...
virtual const wxHtmlCell * | Find (int condition, const void *param) const
| Returns pointer to itself if this cell matches condition (or if any of the cells following in the list matches), NULL otherwise. More...
virtual wxHtmlCell * | FindCellByPos (wxCoord x, wxCoord y, unsigned flags=wxHTML_FIND_EXACT) const
| Find a cell inside this cell positioned at the given coordinates (relative to this's positions). More...
int | GetDescent () const
| Returns descent value of the cell (m_Descent member). More...
virtual wxHtmlCell * | GetFirstChild () const
| Returns pointer to the first cell in the list. More...
int | GetHeight () const
| Returns height of the cell (m_Height member). More...
const wxString & | GetId () const
| Returns unique cell identifier if there is any, the empty string otherwise. More...
virtual wxHtmlLinkInfo * | GetLink (int x=0, int y=0) const
| Returns hypertext link if associated with this cell or NULL otherwise. More...
virtual wxCursor | GetMouseCursor (wxHtmlWindowInterface *window) const
| Returns cursor to show when mouse pointer is over the cell. More...
virtual wxCursor | GetMouseCursorAt (wxHtmlWindowInterface *window, const wxPoint &rePos) const
| Returns cursor to show when mouse pointer is over the specified point. More...
wxHtmlCell * | GetNext () const
| Returns pointer to the next cell in list (see htmlcell.h if you're interested in details). More...
wxHtmlContainerCell * | GetParent () const
| Returns pointer to parent container. More...
int | GetPosX () const
| Returns X position within parent (the value is relative to parent's upper left corner). More...
int | GetPosY () const
| Returns Y position within parent (the value is relative to parent's upper left corner). More...
int | GetWidth () const
| Returns width of the cell (m_Width member). More...
virtual void | Layout (int w)
| Layouts the cell. More...
virtual bool | ProcessMouseClick (wxHtmlWindowInterface *window, const wxPoint &pos, const wxMouseEvent &event)
| This function is simple event handler. More...
void | SetId (const wxString &id)
| Sets unique cell identifier. More...
void | SetLink (const wxHtmlLinkInfo &link)
| Sets the hypertext link associated with this cell. More...
void | SetNext (wxHtmlCell *cell)
| Sets the next cell in the list. More...
void | SetParent (wxHtmlContainerCell *p)
| Sets parent container of this cell. More...
virtual void | SetPos (int x, int y)
| Sets the cell's position within parent container. More...
virtual wxString | ConvertToText (wxHtmlSelection *sel) const
| Converts the cell into text representation. More...
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to NULL the internal reference data. More...
| wxObject (const wxObject &other)
| Copy ctor. More...
virtual | ~wxObject ()
| Destructor. More...
virtual wxClassInfo * | GetClassInfo () const
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class. More...
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj. More...
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone. More...
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer. More...
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
void | UnShare ()
| This is the same of AllocExclusive() but this method is public. More...
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...
void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...

## Additional Inherited Members

Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object. More...
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
virtual wxObjectRefData * | CloneRefData (const wxObjectRefData *data) const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data. More...

## Constructor & Destructor Documentation

## ◆ wxHtmlContainerCell()

wxHtmlContainerCell::wxHtmlContainerCell | ( | wxHtmlContainerCell * | parent | ) |

explicit

Constructor.

parent is pointer to parent container or NULL.

## Member Function Documentation

## ◆ Detach()

void wxHtmlContainerCell::Detach | ( | wxHtmlCell * | 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 | Must be non-null and an immediate child of this cell.

Since
  3.1.2

## ◆ GetAlignHor()

int wxHtmlContainerCell::GetAlignHor | ( |  | ) | const

Returns container's horizontal alignment.

## ◆ GetAlignVer()

int wxHtmlContainerCell::GetAlignVer | ( |  | ) | const

Returns container's vertical alignment.

## ◆ GetBackgroundColour()

wxColour wxHtmlContainerCell::GetBackgroundColour | ( |  | ) |

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

## ◆ GetIndent()

int wxHtmlContainerCell::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!

## ◆ GetIndentUnits()

int wxHtmlContainerCell::GetIndentUnits | ( | int | ind | ) | const

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

## ◆ InsertCell()

void wxHtmlContainerCell::InsertCell | ( | wxHtmlCell * | 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.

## ◆ SetAlign()

void wxHtmlContainerCell::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().

## ◆ SetAlignHor()

void wxHtmlContainerCell::SetAlignHor | ( | int | al | ) |

Sets the container's horizontal alignment.

During wxHtmlCell::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

## ◆ SetAlignVer()

void wxHtmlContainerCell::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

## ◆ SetBackgroundColour()

void wxHtmlContainerCell::SetBackgroundColour | ( | const wxColour & | clr | ) |

Sets the background colour for this container.

## ◆ SetBorder()

void wxHtmlContainerCell::SetBorder | ( | const wxColour & | clr1,
|  | const wxColour & | clr2,
|  | int | border = `1`
| ) |  |

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
  border | Size of the border in pixels

## ◆ SetIndent()

void wxHtmlContainerCell::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

## ◆ SetMinHeight()

void wxHtmlContainerCell::SetMinHeight | ( | int | h,
|  | int | align = `wxHTML_ALIGN_TOP`
| ) |  |

Sets minimal height of the container.

When container's wxHtmlCell::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.

## ◆ SetWidthFloat() [1/2]

void wxHtmlContainerCell::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 the floating width adjustment.

Parameters

  tag | In the second version of method, w and units info is extracted from tag's WIDTH parameter.
  pixel_scale | This is number of real pixels that equals to 1 HTML pixel.

## ◆ SetWidthFloat() [2/2]

void wxHtmlContainerCell::SetWidthFloat | ( | int | w,
|  | int | 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

  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)
  wxHtmlContainerCell::SetWidthFloat
  void SetWidthFloat(int w, int units)
  Sets floating width adjustment.
  wxHTML_UNITS_PIXELS
  #define wxHTML_UNITS_PIXELS
  Definition: htmldefs.h:41
  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