diff --git a/CHANGES.rst b/CHANGES.rst index e5ae806d..d8b58c60 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,11 +20,11 @@ Changes in this release include the following: * Added a deprecated compatibility helper for wx.CustomDataFormat. -* Transfer ownership of the wx.EvtHandler when pushing/popping them, and also - for Set/RemoveEventHandler. (#443) +* Transfer ownership of the wx.EvtHandler object when pushing/popping + them, and also for Set/RemoveEventHandler. (#443) -* Add missing wx.VScrolledWindow methods listed in the docs as deprecated but - still present. (#441) +* Add missing wx.VScrolledWindow methods listed in the docs as deprecated + but still present. (#441) * Fixed copy/paste error in wx.BusyInfo.__exit__ (#449) @@ -39,13 +39,14 @@ Changes in this release include the following: * Fix wx.ListCtrl.SetItemData to check that the data value is not out of the range of a C long. (#467) -* Changed the default port on *nix builds to be GTK3. The new ``--gtk2`` flag - can be used to force a build for GTK2 instead, and the ``--gtk3`` flag still - exists, but defaults to True unless ``--gtk2`` is specified. Please note that - there is currently no auto-detection of whether GTK3 is available or not, so - if you know you need to build for GTK2 then you need to use the build flag, - and there is currently no way to specify that flag for builds performed by - pip. (#431) +* Changed the default port on *nix builds to be GTK3. The new ``--gtk2`` + flag for build.py can be used to force a build for GTK2 instead, and + the ``--gtk3`` flag still exists, but defaults to True unless + ``--gtk2`` is specified. Please note that there is currently no + auto-detection of whether GTK3 is available or not, so if you know + you need to build for GTK2 then you need to use the build flag, and + there is currently no way to specify that flag for builds performed + by pip. (#431) * Fix parameter names in Toolbar.AddTool methods to be consistent. (#475) @@ -64,6 +65,10 @@ Changes in this release include the following: * Fixed improper initial scale factor in wx.lib.agw.speedmeter +* Fix for calls to wx.Notebook.HitTest calling the wrong instance (base class + version) of the method. (#499) + + diff --git a/etg/auibook.py b/etg/auibook.py index b4a35e5b..a68237fa 100644 --- a/etg/auibook.py +++ b/etg/auibook.py @@ -42,6 +42,7 @@ def run(): c = module.find('wxAuiNotebook') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) + tools.fixBookctrlClass(c) c = module.find('wxAuiTabContainer') tools.ignoreConstOverloads(c) diff --git a/etg/notebook.py b/etg/notebook.py index e9b717ed..16d5d21a 100644 --- a/etg/notebook.py +++ b/etg/notebook.py @@ -37,12 +37,7 @@ def run(): c.find('OnSelChange').ignore() tools.fixWindowClass(c) - - - # Let SIP know about other virtual methods that may be implemented here - c.addItem(etgtools.WigCode("""\ - virtual bool DeleteAllPages(); - """)) + tools.fixBookctrlClass(c) module.addGlobalStr('wxNotebookNameStr', c) diff --git a/etg/treebook.py b/etg/treebook.py index 7483ee2f..86a7c17c 100644 --- a/etg/treebook.py +++ b/etg/treebook.py @@ -36,7 +36,7 @@ def run(): c = module.find('wxTreebook') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) - tools.fixBookctrlClass(c, True) + tools.fixBookctrlClass(c) module.addPyCode("""\ EVT_TREEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_TREEBOOK_PAGE_CHANGED, 1 ) diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index dff5a708..a4ef4de6 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -318,24 +318,25 @@ def fixSizerClass(klass): klass.find('RecalcSizes').isPureVirtual = True -def fixBookctrlClass(klass, treeBook=False): +def fixBookctrlClass(klass): """ Add declarations of the pure virtual methods from the base class. """ - klass.addItem(extractors.WigCode("""\ - virtual int GetPageImage(size_t nPage) const; - virtual bool SetPageImage(size_t page, int image); - virtual wxString GetPageText(size_t nPage) const; - virtual bool SetPageText(size_t page, const wxString& text); - virtual int SetSelection(size_t page); - virtual int ChangeSelection(size_t page); - """)) - if not treeBook: - klass.addItem(extractors.WigCode("""\ - virtual int GetSelection() const; - virtual bool InsertPage(size_t index, wxWindow * page, const wxString & text, - bool select = false, int imageId = NO_IMAGE); - """)) + methods = [ + ("GetPageImage", "virtual int GetPageImage(size_t nPage) const;"), + ("SetPageImage", "virtual bool SetPageImage(size_t page, int image);"), + ("GetPageText", "virtual wxString GetPageText(size_t nPage) const;"), + ("SetPageText", "virtual bool SetPageText(size_t page, const wxString& text);"), + ("GetSelection", "virtual int GetSelection() const;"), + ("SetSelection", "virtual int SetSelection(size_t page);"), + ("ChangeSelection", "virtual int ChangeSelection(size_t page);"), + ("HitTest", "virtual int HitTest(const wxPoint& pt, long* flags /Out/ = NULL) const;"), + ("InsertPage", "virtual bool InsertPage(size_t index, wxWindow * page, const wxString & text, bool select = false, int imageId = NO_IMAGE);"), + ] + + for name, decl in methods: + if not klass.findItem(name): + klass.addItem(extractors.WigCode(decl)) def fixHtmlSetFonts(klass):