From 218cf07fa1c88d630cecb8c16ccef3442f097923 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 22 May 2012 00:17:46 +0000 Subject: [PATCH] Add wx.adv.BannerWindow git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- etg/_adv.py | 2 +- etg/bannerwindow.py | 53 ++++++++++++++++++++++++++++++++++ unittests/test_bannerwindow.py | 26 +++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 etg/bannerwindow.py create mode 100644 unittests/test_bannerwindow.py diff --git a/etg/_adv.py b/etg/_adv.py index 8ef1a42f..3b6d72bb 100644 --- a/etg/_adv.py +++ b/etg/_adv.py @@ -37,12 +37,12 @@ INCLUDES = [ 'sound', 'joystick', 'animate', + 'bannerwindow', # TODOs - # These modules are also in the C++ adv lib and so should be included here: # - #'bannerwindow', #'bmpcbox', #'editlbox', #'laywin', diff --git a/etg/bannerwindow.py b/etg/bannerwindow.py new file mode 100644 index 00000000..c7aa2c26 --- /dev/null +++ b/etg/bannerwindow.py @@ -0,0 +1,53 @@ +#--------------------------------------------------------------------------- +# Name: etg/bannerwindow.py +# Author: Robin Dunn +# +# Created: 21-May-2012 +# Copyright: (c) 2012 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_adv" +NAME = "bannerwindow" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ "wxBannerWindow", + ] + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + c = module.find('wxBannerWindow') + assert isinstance(c, etgtools.ClassDef) + tools.fixWindowClass(c) + module.addHeaderCode('#include ') + module.addGlobalStr('wxBannerWindowNameStr', c) + + # We can already do with keyword args what this ctor does for C++ people, + # so ignore it to avoid signature conflicts. + c.find('wxBannerWindow').findOverload('parent, wxDirection').ignore() + + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/unittests/test_bannerwindow.py b/unittests/test_bannerwindow.py new file mode 100644 index 00000000..bef22524 --- /dev/null +++ b/unittests/test_bannerwindow.py @@ -0,0 +1,26 @@ +import imp_unittest, unittest +import wtc +import wx +import wx.adv +import os + +pngFile = os.path.join(os.path.dirname(__file__), 'toucan.png') + +#--------------------------------------------------------------------------- + +class bannerwindow_Tests(wtc.WidgetTestCase): + + def test_bannerwindow1(self): + banner = wx.adv.BannerWindow(self.frame, dir=wx.LEFT) + banner.SetBitmap(wx.Bitmap(pngFile)) + + def test_bannerwindow2(self): + banner = wx.adv.BannerWindow(self.frame, dir=wx.LEFT) + banner.SetText('Message Title', 'The message itself: blah, blah, blah') + banner.SetGradient('white', 'blue') + + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main()