****************
wx.html.HtmlCell
****************
Inheritance diagram for `wx.html.HtmlCell`:
|
.. inheritance-diagram:: wx.html.HtmlCell
|
Description
===========
Internal data structure. It represents fragments of parsed HTML page, the so-called **cell** -- a word, picture, table, horizontal
line and so on. It is used by `wx.html.HtmlWindow `_ and `wx.html.HtmlWinParser `_
to represent HTML page in memory.
You can divide cells into two groups: *visible* cells with non-zero width and height and *helper* cells (usually with zero width and
height) that perform special actions such as color or font change.
.. seealso:: `wx.html.HtmlContainerCell `_
Derived From
^^^^^^^^^^^^^
* `wx.Object <../Widgets/wx.Object.html>`_
Known Subclasses
^^^^^^^^^^^^^^^^
`wx.html.HtmlColourCell `_, `wx.html.HtmlContainerCell `_,
`wx.html.HtmlFontCell `_, `wx.html.HtmlWidgetCell `_,
`wx.html.HtmlWordCell `_
Methods Summary
^^^^^^^^^^^^^^^
* `__init__ <#__init__>`_
* `ConvertToText <#ConvertToText>`_
* `Draw <#Draw>`_
* `DrawInvisible <#DrawInvisible>`_
* `Find <#Find>`_
* `FindCellByPos <#FindCellByPos>`_
* `GetAbsPos <#GetAbsPos>`_
* `GetCursor <#GetCursor>`_
* `GetDepth <#GetDepth>`_
* `GetDescent <#GetDescent>`_
* `GetFirstChild <#GetFirstChild>`_
* `GetFirstTerminal <#GetFirstTerminal>`_
* `GetHeight <#GetHeight>`_
* `GetId <#GetId>`_
* `GetLastTerminal <#GetLastTerminal>`_
* `GetLink <#GetLink>`_
* `GetMaxTotalWidth <#GetMaxTotalWidth>`_
* `GetMouseCursor <#GetMouseCursor>`_
* `GetNext <#GetNext>`_
* `GetParent <#GetParent>`_
* `GetPosX <#GetPosX>`_
* `GetPosY <#GetPosY>`_
* `GetRootCell <#GetRootCell>`_
* `GetWidth <#GetWidth>`_
* `IsBefore <#IsBefore>`_
* `IsFormattingCell <#IsFormattingCell>`_
* `IsLinebreakAllowed <#IsLinebreakAllowed>`_
* `IsTerminalCell <#IsTerminalCell>`_
* `Layout <#Layout>`_
* `ProcessMouseClick <#ProcessMouseClick>`_
* `SetCanLiveOnPagebreak <#SetCanLiveOnPagebreak>`_
* `SetId <#SetId>`_
* `SetLink <#SetLink>`_
* `SetNext <#SetNext>`_
* `SetParent <#SetParent>`_
* `SetPos <#SetPos>`_
Properties Summary
^^^^^^^^^^^^^^^^^^
* `Cursor <#Cursor>`_
* `Depth <#Depth>`_
* `Descent <#Descent>`_
* `FirstChild <#FirstChild>`_
* `FirstTerminal <#FirstTerminal>`_
* `Height <#Height>`_
* `Id <#Id>`_
* `LastTerminal <#LastTerminal>`_
* `Link <#Link>`_
* `MaxTotalWidth <#MaxTotalWidth>`_
* `MouseCursor <#MouseCursor>`_
* `Next <#Next>`_
* `Parent <#Parent>`_
* `PosX <#PosX>`_
* `PosY <#PosY>`_
* `RootCell <#RootCell>`_
* `Width <#Width>`_
Class API
=========
Methods
^^^^^^^
.. method:: __init__()
`No docstrings available for this method.`
--------
.. method:: ConvertToText(sel)
|
**Parameters:**
* `sel` (`wx.html.HtmlSelection`)
|
**Returns:**
`string`
--------
.. method:: Draw(dc, x, y, view_y1, view_y2, info)
Renders the cell.
**Parameters:**
* `dc` (`wx.DC <../Widgets/wx.DC.html>`_): Device context to which the cell is to be drawn
* `x`, `y` (int): Coordinates of parent's upper left corner (origin). You must add this to `GetPosX <#GetPosX>`_, `GetPosY <#GetPosY>`_ when passing
coordinates to dc's methods. Example::
dc.DrawText("hello", x + self.GetPosX(), y + self.GetPosY())
* `view_y1` (int): y-coord of the first line visible in window. This is used to optimize rendering speed
* `view_y2` (int): y-coord of the last line visible in window. This is used to optimize rendering speed
* `info` (`wx.html.HtmlRenderingInfo`)
--------
.. method:: DrawInvisible(dc, x, y, info)
This method is called instead of `Draw <#Draw>`_ when the cell is certainly out of the screen (and thus invisible).
This is not nonsense -- some tags (like `wx.html.HtmlColourCell `_ or font setter)
must be drawn even if they are invisible!
**Parameters:**
* `dc` (`wx.DC <../Widgets/wx.DC.html>`_): Device context to which the cell is to be drawn
* `x`, `y` (int): Coordinates of parent's upper left corner (origin). You must add this to `GetPosX`, `GetPosY` when passing
coordinates to dc's methods. Example::
dc.DrawText("hello", x + self.GetPosX(), y + self.GetPosY())
* `info` (`wx.html.HtmlRenderingInfo`)
--------
.. method:: Find(condition, param)
Returns pointer to itself if this cell matches condition (or if any of the cells following in the list matches), ``None``
otherwise. (In other words if you call top-level container's `Find` it will return pointer to the first cell that matches the condition).
It is recommended way how to obtain pointer to particular cell or to cell of some type (e.g. `wx.html.HtmlAnchorCell` reacts on
``wx.html.HTML_COND_ISANCHOR`` condition).
**Parameters:**
* `condition` (int): Unique integer identifier of condition, which may be one of:
====================================== ===================================
Condition Flag Description
====================================== ===================================
``wx.html.HTML_COND_ISANCHOR`` Finds particular anchor. `param` is a string with name of the anchor.
``wx.html.HTML_COND_USER`` User-defined conditions start from this number.
====================================== ===================================
* `param`: Optional parameters.
|
**Returns:**
`wx.html.HtmlCell `_
--------
.. method:: FindCellByPos()
`No docstrings available for this method.`
--------
.. method:: GetAbsPos(rootCell=None)
|
**Parameters:**
* `rootCell` (`wx.html.HtmlCell `_)
|
**Returns:**
`wx.Point <../Widgets/wx.Point.html>`_
--------
.. method:: GetCursor(window)
Returns cursor to show when mouse pointer is over the cell.
**Parameters:**
* `window` (`wx.html.HtmlWindowInterface`): interface to the parent HTML window
|
**Returns:**
`wx.Cursor <../Widgets/wx.Cursor.html>`_
.. warning:: This method is deprecated. Use `GetMouseCursor <#GetMouseCursor>`_ instead.
--------
.. method:: GetDepth()
`No docstrings available for this method.`
--------
.. method:: GetDescent()
Returns descent value of the cell. See this image for explanation:
.. image:: ../images/wxWidgets/descent.png
|
**Returns:**
`int`
--------
.. method:: GetFirstChild()
Returns pointer to the first cell in the list.
You can then use child's `GetNext <#GetNext>`_ method to obtain pointer to the next cell in list.
|
**Returns:**
`wx.html.HtmlCell `_
.. note:: This shouldn't be used by the end user. If you need some way of finding particular cell in the list,
try `Find <#Find>`_ method instead.
--------
.. method:: GetFirstTerminal()
`No docstrings available for this method.`
--------
.. method:: GetHeight()
Returns height of the cell.
|
**Returns:**
`int`
--------
.. method:: GetId()
Returns unique cell identifier if there is any, empty string otherwise.
|
**Returns:**
`string`
--------
.. method:: GetLastTerminal()
`No docstrings available for this method.`
--------
.. method:: GetLink(x=0, y=0)
Returns hypertext link if associated with this cell or ``None`` otherwise.
**Parameters:**
* `x, y` (int): Coordinates of position where the user pressed mouse button. These coordinates are used e.g. by COLORMAP.
Values are relative to the upper left corner of **this** cell (i.e. from 0 to `GetWidth <#GetWidth>`_ or `GetHeight <#GetHeight>`_).
|
**Returns:**
`wx.html.HtmlLinkInfo `_
.. note:: this makes sense only for visible tags.
.. seealso:: `wx.html.HtmlLinkInfo `_
--------
.. method:: GetMaxTotalWidth()
`No docstrings available for this method.`
--------
.. method:: GetMouseCursor(window)
Returns cursor to show when mouse pointer is over the cell.
This function is new since wxPython version 2.7.0 (before `GetCursor` method served a similar purpose, which is now deprecated).
**Parameters:**
* `window` (`wx.html.HtmlWindowInterface`): interface to the parent HTML window
|
**Returns:**
`wx.Cursor <../Widgets/wx.Cursor.html>`_
--------
.. method:: GetNext()
Returns pointer to the next cell in list.
|
**Returns:**
`wx.html.HtmlCell `_
--------
.. method:: GetParent()
Returns pointer to parent container.
|
**Returns:**
`wx.html.HtmlContainerCell `_
--------
.. method:: GetPosX()
Returns `X` position within parent (the value is relative to parent's upper left corner).
The returned value is meaningful only if parent's `Layout <#Layout>`_ was called before!
|
**Returns:**
`int`
--------
.. method:: GetPosY()
Returns `Y` position within parent (the value is relative to parent's upper left corner).
The returned value is meaningful only if parent's `Layout <#Layout>`_ was called before!
|
**Returns:**
`int`
--------
.. method:: GetRootCell()
`No docstrings available for this method.`
--------
.. method:: GetWidth()
Returns width of the cell.
|
**Returns:**
`int`
--------
.. method:: IsBefore(cell)
|
**Parameters:**
* `cell` (`wx.html.HtmlCell `_)
|
**Returns:**
`bool`
--------
.. method:: IsFormattingCell()
`No docstrings available for this method.`
--------
.. method:: IsLinebreakAllowed()
`No docstrings available for this method.`
--------
.. method:: IsTerminalCell()
`No docstrings available for this method.`
--------
.. method:: Layout(w)
This method performs two actions:
* Adjusts the cell's width according to the fact that maximal possible width is `w`. This has sense when working with horizontal lines, tables etc...
* Prepares layout based on actual width `w`.
It must be called before displaying cells structure because `GetPosX <#GetPosX>`_ and `GetPosY <#GetPosY>`_ are undefined
(or invalid) before calling `Layout`.
**Parameters:**
* `w` (int)
--------
.. method:: ProcessMouseClick(window, pos, event)
This function is simple event handler.
Each time the user clicks mouse button over a cell within `wx.html.HtmlWindow `_ this method of that cell
is called.
Default behavior is to call `wx.html.HtmlWindow.LoadPage `_.
**Parameters:**
* `window` (`wx.html.HtmlWindowInterface`): interface to the parent HTML window.
* `pos` (`wx.Point <../Widgets/wx.Point.html>`_): coordinates of mouse click (this is relative to cell's origin).
* `event` (`wx.MouseEvent <../Events/wx.MouseEvent.html>`_): mouse event that triggered the call.
|
**Returns:**
`bool`
--------
.. method:: SetCanLiveOnPagebreak(can)
|
**Parameters:**
* `can` (bool)
--------
.. method:: SetId(id)
Sets unique cell identifier. Default value is no identifier, i.e. empty string.
**Parameters:**
* `id` (string)
--------
.. method:: SetLink(link)
Sets the hypertext link associated with this cell.
Default value is `wx.html.HtmlLinkInfo `_ ("", "") -- i.e., no link.
**Parameters:**
* `link` (`wx.html.HtmlLinkInfo `_)
--------
.. method:: SetNext(cell)
Sets the next cell in the list. This shouldn't be called by user -- it is to be used only by
`wx.html.HtmlContainerCell.InsertCell `_.
**Parameters:**
* `cell` (`wx.html.HtmlCell `_)
--------
.. method:: SetParent(p)
Sets parent container of this cell.
This is called from `wx.html.HtmlContainerCell.InsertCell `_.
**Parameters:**
* `p` (`wx.html.HtmlContainerCell `_)
--------
.. method:: SetPos(x, y)
Sets the cell's position within parent container.
**Parameters:**
* `x` (int)
* `y` (int)
--------
Properties
^^^^^^^^^^
.. attribute:: Cursor
See `GetCursor <#GetCursor>`_
.. attribute:: Depth
See `GetDepth <#GetDepth>`_
.. attribute:: Descent
See `GetDescent <#GetDescent>`_
.. attribute:: FirstChild
See `GetFirstChild <#GetFirstChild>`_
.. attribute:: FirstTerminal
See `GetFirstTerminal <#GetFirstTerminal>`_
.. attribute:: Height
See `GetHeight <#GetHeight>`_
.. attribute:: Id
See `GetId <#GetId>`_ and `SetId <#SetId>`_
.. attribute:: LastTerminal
See `GetLastTerminal <#GetLastTerminal>`_
.. attribute:: Link
See `GetLink <#GetLink>`_ and `SetLink <#SetLink>`_
.. attribute:: MaxTotalWidth
See `GetMaxTotalWidth <#GetMaxTotalWidth>`_
.. attribute:: MouseCursor
See `GetMouseCursor <#GetMouseCursor>`_
.. attribute:: Next
See `GetNext <#GetNext>`_ and `SetNext <#SetNext>`_
.. attribute:: Parent
See `GetParent <#GetParent>`_ and `SetParent <#SetParent>`_
.. attribute:: PosX
See `GetPosX <#GetPosX>`_
.. attribute:: PosY
See `GetPosY <#GetPosY>`_
.. attribute:: RootCell
See `GetRootCell <#GetRootCell>`_
.. attribute:: Width
See `GetWidth <#GetWidth>`_