From 1a5dbab03cdc7d8cd46ff5ddaf44b14a06519dc9 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 14 Jul 2016 11:57:00 -0700 Subject: [PATCH] Fixes for AboutDialogInfo. Most of the properties were missing because the getter methods were not documented so no wrappers were being generated for them. --- demo/AboutBox.py | 2 +- etg/aboutdlg.py | 13 ++++++++++++- ext/wxWidgets | 2 +- unittests/test_aboutdlg.py | 27 ++++++++++++++++++++++++--- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/demo/AboutBox.py b/demo/AboutBox.py index f2f29dcd..3efaf6bd 100644 --- a/demo/AboutBox.py +++ b/demo/AboutBox.py @@ -20,7 +20,7 @@ class TestPanel(wx.Panel): info = wx.adv.AboutDialogInfo() info.Name = "Hello World" info.Version = "1.2.3" - info.Copyright = "(C) 2006 Programmers and Coders Everywhere" + info.Copyright = "(c) 2016 Programmers and Coders Everywhere" info.Description = wordwrap( "A \"hello world\" program is a software program that prints out " "\"Hello world!\" on a display device. It is used in many introductory " diff --git a/etg/aboutdlg.py b/etg/aboutdlg.py index f7bd770f..dfcec0ac 100644 --- a/etg/aboutdlg.py +++ b/etg/aboutdlg.py @@ -32,7 +32,18 @@ def run(): # customizing the generated code and docstrings. module.addHeaderCode('#include ') - + + c = module.find('wxAboutDialogInfo') + assert isinstance(c, etgtools.ClassDef) + + # Add some aliases for the non-UK spelling + c.addPyCode("""\ + AboutDialogInfo.HasLicense = AboutDialogInfo.HasLicence + AboutDialogInfo.GetLicense = AboutDialogInfo.GetLicence + AboutDialogInfo.License = AboutDialogInfo.Licence + """) + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/ext/wxWidgets b/ext/wxWidgets index 22f98525..5f86a4d8 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit 22f9852519b008ecf658f8736787151537bf1a09 +Subproject commit 5f86a4d86d53e989fa8d020bfd3bb82a8453cd7b diff --git a/unittests/test_aboutdlg.py b/unittests/test_aboutdlg.py index b33973ac..32c7458d 100644 --- a/unittests/test_aboutdlg.py +++ b/unittests/test_aboutdlg.py @@ -14,6 +14,7 @@ class aboutdlg_Tests(wtc.WidgetTestCase): info.SetDevelopers(['Goofy', 'Mickey', 'Donald']) info.SetDescription('This is a very goofy application') info.SetCopyright('(c) by Goofy Enterprises, Inc.') + info.SetLicence('free-for-all') return info @@ -22,13 +23,33 @@ class aboutdlg_Tests(wtc.WidgetTestCase): info = self._makeInfo() wx.CallLater(25, self.closeDialogs) wx.adv.AboutBox(info, self.frame) - + + def test_aboutdlgGeneric(self): info = self._makeInfo() wx.CallLater(25, self.closeDialogs) wx.adv.GenericAboutBox(info, self.frame) - - + + + def test_aboutdlgProperties(self): + info = self._makeInfo() + assert info.Name == 'My Goofy AboutBox Test' + assert info.Version == '1.2.3' + assert info.LongVersion == 'Version 1.2.3' + assert info.Description.startswith('This is a') + assert info.Copyright.startswith('(c)') + assert info.Licence == 'free-for-all' + assert info.License == 'free-for-all' + assert isinstance(info.Icon, wx.Icon) + assert info.WebSiteURL == '' + assert len(info.Developers) == 3 + assert 'Mickey' in info.Developers + assert len(info.DocWriters) == 0 + assert len(info.Artists) == 0 + assert len(info.Translators) == 0 + + + #---------------------------------------------------------------------------