mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 20:10:08 +01:00
Add PopupWindow and TipWindow
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
7
TODO.txt
7
TODO.txt
@@ -160,11 +160,10 @@ other dev stuff
|
|||||||
|
|
||||||
* Word-wrap the briefDoc strings used for %Docstring directives
|
* Word-wrap the briefDoc strings used for %Docstring directives
|
||||||
|
|
||||||
* For full coverage of what is in Classic core modules ETG files
|
* For full coverage of what was in the Classic core modules we'll need ETG
|
||||||
are needed for:
|
files for the following:
|
||||||
|
|
||||||
* filesys, fs_mem, fs_inet, fs_arch (with wxZipFSHandler typedef)
|
* filesys, fs_mem, fs_inet, fs_arch (with wxZipFSHandler typedef)
|
||||||
* versioninfo
|
|
||||||
* popupwin
|
|
||||||
* tipwin
|
* tipwin
|
||||||
* vscroll
|
* vscroll
|
||||||
* taskbar
|
* taskbar
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ INCLUDES = [ 'defs',
|
|||||||
'frame',
|
'frame',
|
||||||
'msgdlg',
|
'msgdlg',
|
||||||
'progdlg',
|
'progdlg',
|
||||||
|
'popupwin',
|
||||||
|
'tipwin',
|
||||||
|
|
||||||
# controls
|
# controls
|
||||||
'statbmp',
|
'statbmp',
|
||||||
@@ -206,7 +208,7 @@ def run():
|
|||||||
method calls from non-GUI threads. Any extra positional or
|
method calls from non-GUI threads. Any extra positional or
|
||||||
keyword args are passed on to the callable when it is called.
|
keyword args are passed on to the callable when it is called.
|
||||||
|
|
||||||
:see: `wx.CallLater`""",
|
:see: `CallLater`""",
|
||||||
body="""\
|
body="""\
|
||||||
assert callable(callableObj), "callableObj is not callable"
|
assert callable(callableObj), "callableObj is not callable"
|
||||||
app = wx.GetApp()
|
app = wx.GetApp()
|
||||||
@@ -238,7 +240,7 @@ def run():
|
|||||||
the timer completes, automatically cleaning up the wx.CallLater
|
the timer completes, automatically cleaning up the wx.CallLater
|
||||||
object.
|
object.
|
||||||
|
|
||||||
:see: `wx.CallAfter`""",
|
:see: `CallAfter`""",
|
||||||
items = [
|
items = [
|
||||||
PyFunctionDef('__init__', '(self, millis, callableObj, *args, **kwargs)',
|
PyFunctionDef('__init__', '(self, millis, callableObj, *args, **kwargs)',
|
||||||
body="""\
|
body="""\
|
||||||
|
|||||||
58
etg/popupwin.py
Normal file
58
etg/popupwin.py
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Name: etg/popupwin.py
|
||||||
|
# Author: Robin Dunn
|
||||||
|
#
|
||||||
|
# Created: 15-Dec-2011
|
||||||
|
# Copyright: (c) 2011 by Total Control Software
|
||||||
|
# License: wxWindows License
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import etgtools
|
||||||
|
import etgtools.tweaker_tools as tools
|
||||||
|
|
||||||
|
PACKAGE = "wx"
|
||||||
|
MODULE = "_core"
|
||||||
|
NAME = "popupwin" # 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 = [ "wxPopupWindow",
|
||||||
|
"wxPopupTransientWindow",
|
||||||
|
]
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
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('wxPopupWindow')
|
||||||
|
assert isinstance(c, etgtools.ClassDef)
|
||||||
|
tools.fixWindowClass(c)
|
||||||
|
c.find('Position').isVirtual = True
|
||||||
|
|
||||||
|
|
||||||
|
c = module.find('wxPopupTransientWindow')
|
||||||
|
tools.fixWindowClass(c)
|
||||||
|
c.find('Dismiss').isVirtual = True
|
||||||
|
c.find('ProcessLeftDown').isVirtual = True
|
||||||
|
c.find('OnDismiss').ignore(False)
|
||||||
|
c.find('OnDismiss').isVirtual = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------
|
||||||
|
tools.doCommonTweaks(module)
|
||||||
|
tools.runGenerators(module)
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
if __name__ == '__main__':
|
||||||
|
run()
|
||||||
|
|
||||||
56
etg/tipwin.py
Normal file
56
etg/tipwin.py
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Name: etg/tipwin.py
|
||||||
|
# Author: Robin Dunn
|
||||||
|
#
|
||||||
|
# Created: 15-Dec-2011
|
||||||
|
# Copyright: (c) 2011 by Total Control Software
|
||||||
|
# License: wxWindows License
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import etgtools
|
||||||
|
import etgtools.tweaker_tools as tools
|
||||||
|
|
||||||
|
PACKAGE = "wx"
|
||||||
|
MODULE = "_core"
|
||||||
|
NAME = "tipwin" # 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 = [ "wxTipWindow",
|
||||||
|
]
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
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('wxTipWindow')
|
||||||
|
assert isinstance(c, etgtools.ClassDef)
|
||||||
|
tools.fixWindowClass(c)
|
||||||
|
|
||||||
|
# We're not going to allow the use of the windowPtr arg in the ctor
|
||||||
|
c.find('wxTipWindow.windowPtr').ignore()
|
||||||
|
|
||||||
|
# TODO: find a way to include the rectBounds parameter while still ignoring windowPtr
|
||||||
|
c.find('wxTipWindow.rectBounds').ignore()
|
||||||
|
|
||||||
|
# ignore this method too
|
||||||
|
c.find('SetTipWindowPtr').ignore()
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------
|
||||||
|
tools.doCommonTweaks(module)
|
||||||
|
tools.runGenerators(module)
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
if __name__ == '__main__':
|
||||||
|
run()
|
||||||
|
|
||||||
29
unittests/test_popupwin.py
Normal file
29
unittests/test_popupwin.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import imp_unittest, unittest
|
||||||
|
import wtc
|
||||||
|
import wx
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class popupwin_Tests(wtc.WidgetTestCase):
|
||||||
|
|
||||||
|
def test_popupwinCtor(self):
|
||||||
|
p = wx.PopupWindow(self.frame, wx.BORDER_SIMPLE)
|
||||||
|
p.Position(self.frame.GetPosition() + (50,50), (100,100))
|
||||||
|
p.Show()
|
||||||
|
wx.CallAfter(p.Destroy)
|
||||||
|
self.myYield()
|
||||||
|
|
||||||
|
def test_popupwinDefaultCtor(self):
|
||||||
|
p = wx.PopupWindow()
|
||||||
|
p.Create(self.frame)
|
||||||
|
|
||||||
|
def test_popuptranswinCtor(self):
|
||||||
|
p = wx.PopupTransientWindow(self.frame, wx.BORDER_SIMPLE)
|
||||||
|
p.Popup()
|
||||||
|
p.Dismiss()
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
22
unittests/test_tipwin.py
Normal file
22
unittests/test_tipwin.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import imp_unittest, unittest
|
||||||
|
import wtc
|
||||||
|
import wx
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class tipwin_Tests(wtc.WidgetTestCase):
|
||||||
|
|
||||||
|
def test_tipwinCtor(self):
|
||||||
|
w = wx.TipWindow(self.frame, "This is a tip message")
|
||||||
|
w.SetBoundingRect(self.frame.GetRect())
|
||||||
|
w.Show()
|
||||||
|
self.myYield()
|
||||||
|
w.Close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
Reference in New Issue
Block a user