Fixes for AboutDialogInfo.

Most of the properties were missing because the getter methods were not documented so no wrappers were being generated for them.
This commit is contained in:
Robin Dunn
2016-07-14 11:57:00 -07:00
parent eb6d056a85
commit 1a5dbab03c
4 changed files with 38 additions and 6 deletions

View File

@@ -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 "

View File

@@ -32,7 +32,18 @@ def run():
# customizing the generated code and docstrings.
module.addHeaderCode('#include <wx/generic/aboutdlgg.h>')
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)

View File

@@ -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
#---------------------------------------------------------------------------