Add wx.adv.BannerWindow

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-05-22 00:17:46 +00:00
parent fffbf482ea
commit 218cf07fa1
3 changed files with 80 additions and 1 deletions

View File

@@ -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',

53
etg/bannerwindow.py Normal file
View File

@@ -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 <wx/bannerwindow.h>')
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()

View File

@@ -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()