From 8f04fee7be02ba090f7692839338fa6a2fb742e4 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 24 May 2012 23:27:12 +0000 Subject: [PATCH] Add wx.adv.NotificationMessage git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71550 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- etg/_adv.py | 2 +- etg/notifmsg.py | 46 ++++++++++++++++++++++++++++++++++++++ unittests/test_notifmsg.py | 20 +++++++++++++++++ unittests/test_timer.py | 10 --------- unittests/wtc.py | 10 +++++++++ 5 files changed, 77 insertions(+), 11 deletions(-) create mode 100644 etg/notifmsg.py create mode 100644 unittests/test_notifmsg.py diff --git a/etg/_adv.py b/etg/_adv.py index f44a9a88..42678f4b 100644 --- a/etg/_adv.py +++ b/etg/_adv.py @@ -39,6 +39,7 @@ INCLUDES = [ 'animate', 'bannerwindow', 'editlbox', + 'notifmsg', # TODOs - @@ -46,7 +47,6 @@ INCLUDES = [ # #'bmpcbox', #'laywin', - #'notifmsg', #'odcombo', #'richtooltip', #'sashwin', diff --git a/etg/notifmsg.py b/etg/notifmsg.py new file mode 100644 index 00000000..9994a9b5 --- /dev/null +++ b/etg/notifmsg.py @@ -0,0 +1,46 @@ +#--------------------------------------------------------------------------- +# Name: etg/notifmsg.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 = "notifmsg" # 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 = [ "wxNotificationMessage", + ] + +#--------------------------------------------------------------------------- + +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('wxNotificationMessage') + assert isinstance(c, etgtools.ClassDef) + + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/unittests/test_notifmsg.py b/unittests/test_notifmsg.py new file mode 100644 index 00000000..b0d9e3fb --- /dev/null +++ b/unittests/test_notifmsg.py @@ -0,0 +1,20 @@ +import imp_unittest, unittest +import wtc +import wx +import wx.adv + +#--------------------------------------------------------------------------- + +class notifmsg_Tests(wtc.WidgetTestCase): + + def test_notifmsg1(self): + nf = wx.adv.NotificationMessage("The Title", "This is the message") + nf.Show() + self.waitFor(300) + nf.Close() + + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main() diff --git a/unittests/test_timer.py b/unittests/test_timer.py index ab642f5d..300823d1 100644 --- a/unittests/test_timer.py +++ b/unittests/test_timer.py @@ -5,16 +5,6 @@ import wx #--------------------------------------------------------------------------- class timer_Tests(wtc.WidgetTestCase): - - def waitFor(self, milliseconds): - intervals = milliseconds/100 - while intervals > 0: - wx.MilliSleep(100) - self.myYield() - if hasattr(self, 'flag') and self.flag: - break - intervals -= 1 - def onTimerEvt(self, *evt): self.flag = True diff --git a/unittests/wtc.py b/unittests/wtc.py index 66b54ba3..65688ebd 100644 --- a/unittests/wtc.py +++ b/unittests/wtc.py @@ -55,6 +55,16 @@ class WidgetTestCase(unittest.TestCase): for w in wx.GetTopLevelWindows(): if isinstance(w, wx.Dialog): w.EndModal(wx.ID_CANCEL) + + + def waitFor(self, milliseconds): + intervals = milliseconds/100 + while intervals > 0: + wx.MilliSleep(100) + self.myYield() + if hasattr(self, 'flag') and self.flag: + break + intervals -= 1 #---------------------------------------------------------------------------