Allow passing already parsed HTML to wxHtmlDCRenderer

This is more efficient when the same HTML is reused multiple times, e.g.
for measuring it first and then rendering it.

The new function also makes it simpler to parse HTML and manipulate it
in some way before measuring and rendering it.
This commit is contained in:
Vadim Zeitlin
2018-08-25 02:35:20 +02:00
parent de5ba70203
commit 9db0234abc
3 changed files with 47 additions and 4 deletions

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() !