Merge branch 'html-set-cell'

Make wxHTML API more flexible by allowing to operate on individual
wxHtmlContainerCell instead of only the entire HTML document text.

See https://github.com/wxWidgets/wxWidgets/pull/899
This commit is contained in:
Vadim Zeitlin
2018-08-27 02:17:10 +02:00
7 changed files with 174 additions and 46 deletions

View File

@@ -471,7 +471,21 @@ public:
/**
Constructor. @a parent is pointer to parent container or @NULL.
*/
wxHtmlContainerCell(wxHtmlContainerCell* parent);
explicit wxHtmlContainerCell(wxHtmlContainerCell* parent);
/**
Detach a child cell.
Detaching a cell removes it from this container and allows to reattach
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.
@param cell Must be non-null and an immediate child of this cell.
@since 3.1.2
*/
void Detach(wxHtmlCell* cell);
/**
Returns container's horizontal alignment.
@@ -506,6 +520,9 @@ public:
/**
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.
*/
void InsertCell(wxHtmlCell* cell);

View File

@@ -168,6 +168,19 @@ public:
const wxString& basepath = wxEmptyString,
bool isdir = true);
/**
Associate the given HTML contents to the renderer.
This is similar to SetHtmlText(), but is more efficient as the text can
be parsed only once, using wxHtmlParser::Parse(), and then passed to
wxHtmlDCRenderer multiple times or already reused for other purposes.
Note that @a cell will be modified (e.g. laid out) by this function.
@since 3.1.2
*/
void SetHtmlCell(wxHtmlContainerCell& cell);
/**
Set size of output rectangle, in pixels. Note that you @b can't change
width of the rectangle between calls to Render() !