From f84ae3f5a246c810ac81b048d4b8dd1c5d7d2fd3 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Jan 2019 14:02:25 -0800 Subject: [PATCH] Added missing HtmlWindow.ScrollToAnchor method, and also a couple methods in HtmlCell too. --- CHANGES.rst | 2 ++ etg/htmlcell.py | 14 ++++++++++++++ etg/htmlwin.py | 9 +++++++++ 3 files changed, 25 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 4b2c35d9..80c1557a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -19,6 +19,8 @@ Pip: ``pip install wxPython==4.0.5`` Changes in this release include the following: +* Added missing HtmlWindow.ScrollToAnchor method, and also a couple methods + in HtmlCell too. (#1141) diff --git a/etg/htmlcell.py b/etg/htmlcell.py index 4978300c..976b51b3 100644 --- a/etg/htmlcell.py +++ b/etg/htmlcell.py @@ -9,6 +9,7 @@ import etgtools import etgtools.tweaker_tools as tools +from etgtools import MethodDef, ParamDef PACKAGE = "wx" MODULE = "_html" @@ -63,6 +64,19 @@ def run(): m.find('param').type = 'const char*' m.cppSignature = 'const wxHtmlCell* (int condition, const void* param)' + m = MethodDef(name='GetAbsPos', type='wxPoint', isConst=True, + items=[ParamDef(type='wxHtmlCell*', name='rootCell', default='NULL')], + doc="""\ + Returns absolute position of the cell on HTML canvas.\n + If rootCell is provided, then it's considered to be the root of the + hierarchy and the returned value is relative to it. + """) + c.addItem(m) + + m = MethodDef(name='GetRootCell', type='wxHtmlCell*', isConst=True, + doc="Returns the root cell of the hierarchy.") + c.addItem(m) + c = module.find('wxHtmlContainerCell') c.find('InsertCell.cell').transfer = True diff --git a/etg/htmlwin.py b/etg/htmlwin.py index 59ca5ec1..2894999f 100644 --- a/etg/htmlwin.py +++ b/etg/htmlwin.py @@ -9,6 +9,7 @@ import etgtools import etgtools.tweaker_tools as tools +from etgtools import MethodDef, ParamDef PACKAGE = "wx" MODULE = "_html" @@ -75,6 +76,14 @@ def run(): virtual wxCursor GetHTMLCursor(wxHtmlWindowInterface::HTMLCursor type) const; """)) + m = MethodDef(name='ScrollToAnchor', type='bool', protection='protected', + items=[ParamDef(type='const wxString&', name='anchor')], + doc="""\ + Scrolls to anchor of this name. + Returns True is anchor exists, False otherwise. + """) + c.addItem(m) + c = module.find('wxHtmlLinkEvent') tools.fixEventClass(c)