mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 20:40:11 +01:00
A little refactoring to share dialog closing methods
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -16,20 +16,16 @@ class aboutdlg_Tests(wtc.WidgetTestCase):
|
||||
info.SetCopyright('(c) by Goofy Enterprises, Inc.')
|
||||
return info
|
||||
|
||||
def _closeDlg(self):
|
||||
for w in wx.GetTopLevelWindows():
|
||||
if isinstance(w, wx.Dialog):
|
||||
w.EndModal(wx.ID_OK)
|
||||
|
||||
def test_aboutdlgNative(self):
|
||||
if not 'wxMSW' in wx.PlatformInfo():
|
||||
info = self._makeInfo()
|
||||
wx.CallLater(250, self._closeDlg)
|
||||
wx.CallLater(25, self.closeDialogs)
|
||||
wx.adv.AboutBox(info, self.frame)
|
||||
|
||||
def test_aboutdlgGeneric(self):
|
||||
info = self._makeInfo()
|
||||
wx.CallLater(250, self._closeDlg)
|
||||
wx.CallLater(25, self.closeDialogs)
|
||||
wx.adv.GenericAboutBox(info, self.frame)
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class tipdlg_Tests(wtc.WidgetTestCase):
|
||||
|
||||
def test_tipdlg1(self):
|
||||
tp = wx.adv.CreateFileTipProvider(tipFile, 0);
|
||||
wx.CallLater(25, self._closeTipDialog)
|
||||
wx.CallLater(25, self.closeDialogs)
|
||||
wx.adv.ShowTip(self.frame, tp)
|
||||
|
||||
|
||||
@@ -21,16 +21,10 @@ class tipdlg_Tests(wtc.WidgetTestCase):
|
||||
def GetTip(self):
|
||||
return "This is my tip"
|
||||
|
||||
wx.CallLater(25, self._closeTipDialog)
|
||||
wx.CallLater(25, self.closeDialogs)
|
||||
wx.adv.ShowTip(self.frame, MyTipProvider(0))
|
||||
|
||||
|
||||
def _closeTipDialog(self):
|
||||
#self.myYield()
|
||||
for w in wx.GetTopLevelWindows():
|
||||
if isinstance(w, wx.Dialog):
|
||||
w.EndModal(wx.ID_CANCEL)
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -47,7 +47,15 @@ class WidgetTestCase(unittest.TestCase):
|
||||
window.Update()
|
||||
|
||||
|
||||
|
||||
def closeDialogs(self):
|
||||
"""
|
||||
Close dialogs by calling their EndModal
|
||||
"""
|
||||
#self.myYield()
|
||||
for w in wx.GetTopLevelWindows():
|
||||
if isinstance(w, wx.Dialog):
|
||||
w.EndModal(wx.ID_CANCEL)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user