Merge branch 'big-catch-up'

This commit is contained in:
Robin Dunn
2019-05-23 21:48:31 -07:00
20 changed files with 200 additions and 22 deletions

View File

@@ -18,10 +18,7 @@ Pip: ``pip install wxPython==4.1.0``
Starting with this release wxPython has switched to tracking the wxWidgets
master branch for the wxWidgets source code which wxPython is built upon, and
which is included in the wxPython source archives. Along with this change a new
``wxPy-4.0.x`` branch has been created in the git repository for continuing
maintenance releases of the 4.0.x series of wxPython, which will still track the
``WX_3_0_BRANCH`` wxWidgets branch.
which is included in the wxPython source archives.
New and improved stuff in this release:
@@ -30,6 +27,10 @@ New and improved stuff in this release:
OSXEnableAutomaticDashSubstitution, and OSXDisableAllSmartSubstitutions
methods in wx.TextCtrl.
* Added wx.ColourDialogEvent, wxDCTextBgColourChanger, wxDCTextBgModeChanger,
wx.grid.GridCellDateRenderer, wx.grid.GridCellDateEditor, wx.SystemAppearance,
etc.
Other changes in this release:

View File

@@ -301,16 +301,16 @@ def main(wxDir, args):
# version present on the build machine.
# TODO: should there be a command line option to set the SDK?
if sys.platform.startswith("darwin"):
wxpy_configure_opts.append("--with-macosx-version-min=10.6")
for xcodePath in getXcodePaths():
sdks = [ xcodePath+"/SDKs/MacOSX10.{}.sdk".format(n)
for n in range(6, 15) ]
# use the lowest available sdk on the build machine
for sdk in sdks:
if os.path.exists(sdk):
wxpy_configure_opts.append(
"--with-macosx-sdk=%s" % sdk)
break
wxpy_configure_opts.append("--with-macosx-version-min=10.9")
# for xcodePath in getXcodePaths():
# sdks = [ xcodePath+"/SDKs/MacOSX10.{}.sdk".format(n)
# for n in range(9, 15) ]
# # use the lowest available sdk on the build machine
# for sdk in sdks:
# if os.path.exists(sdk):
# wxpy_configure_opts.append(
# "--with-macosx-sdk=%s" % sdk)
# break
if not options.mac_framework:
if installDir and not prefixDir:

View File

@@ -1 +1,61 @@
#!/usr/bin/env python
import wx
import wx.adv
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
self.btn = wx.Button(self, -1, "Notify me of something...!", pos=(50,50))
self.btn.Bind(wx.EVT_BUTTON, self.OnButton)
def OnButton(self, event):
notify = wx.adv.NotificationMessage(
title="This is a Notification!",
message="wxPython is awesome. Phoenix is awesomer! Python is awesomest!!\n\n"
"The quick brown fox jumped over the lazy dog.",
parent=None, flags=wx.ICON_INFORMATION)
# Various options can be set after the message is created if desired.
# notify.SetFlags(# wx.ICON_INFORMATION
# wx.ICON_WARNING
# # wx.ICON_ERROR
# )
# notify.SetTitle("Wooot")
# notify.SetMessage("It's a message!")
# notify.SetParent(self)
notify.Show(timeout=5) # 1 for short timeout, 100 for long timeout
# notify.Close() # Hides the notification.
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
#---------------------------------------------------------------------------
overview = """\
This class allows to show the user a message non intrusively.
Currently it is implemented natively for Windows and GTK and
uses (non-modal) dialogs for the display of the notifications
under the other platforms.
The OS X implementation uses Notification Center to display native
notifications. In order to use actions your notifications must use the
alert style. This can be enabled by the user in system settings or by
setting the NSUserNotificationAlertStyle value in Info.plist to alert.
Please note that the user always has the option to change the notification
style.
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])

View File

@@ -699,6 +699,7 @@
"ColourData":"wx.",
"ColourDatabase":"wx.",
"ColourDialog":"wx.",
"ColourDialogEvent":"wx.",
"ColourDisplay":"wx.",
"ColourPickerCtrl":"wx.",
"ColourPickerCtrlNameStr":"wx.",
@@ -750,6 +751,8 @@
"DCFontChanger":"wx.",
"DCOverlay":"wx.",
"DCPenChanger":"wx.",
"DCTextBgColourChanger":"wx.",
"DCTextBgModeChanger":"wx.",
"DCTextColourChanger":"wx.",
"DD_CHANGE_DIR":"wx.",
"DD_DEFAULT_STYLE":"wx.",
@@ -1350,6 +1353,7 @@
"GetBatteryState":"wx.",
"GetClientDisplayRect":"wx.",
"GetColourFromUser":"wx.",
"GetDiskSpace":"wx.",
"GetDisplayName":"wx.",
"GetDisplayPPI":"wx.",
"GetDisplaySize":"wx.",
@@ -1411,6 +1415,8 @@
"GridCellBoolRenderer":"wx.grid.",
"GridCellChoiceEditor":"wx.grid.",
"GridCellCoords":"wx.grid.",
"GridCellDateEditor":"wx.grid.",
"GridCellDateRenderer":"wx.grid.",
"GridCellDateTimeRenderer":"wx.grid.",
"GridCellEditor":"wx.grid.",
"GridCellEnumEditor":"wx.grid.",
@@ -2974,6 +2980,7 @@
"PROPSHEET_SHRINKTOFIT":"wx.adv.",
"PROPSHEET_TOOLBOOK":"wx.adv.",
"PROPSHEET_TREEBOOK":"wx.adv.",
"PU_CONTAINS_CONTROLS":"wx.",
"PageSetupDialog":"wx.",
"PageSetupDialogData":"wx.",
"PaintDC":"wx.",
@@ -6128,6 +6135,7 @@
"SysErrorCode":"wx.",
"SysErrorMsg":"wx.",
"SysErrorMsgStr":"wx.",
"SystemAppearance":"wx.",
"SystemColour":"wx.",
"SystemColourProperty":"wx.propgrid.",
"SystemFeature":"wx.",
@@ -6573,6 +6581,16 @@
"WEBKIT_STATE_START":"wx.webkit.",
"WEBKIT_STATE_STOP":"wx.webkit.",
"WEBKIT_STATE_TRANSFERRING":"wx.webkit.",
"WEBVIEWIE_EMU_DEFAULT":"wx.html2.",
"WEBVIEWIE_EMU_IE10":"wx.html2.",
"WEBVIEWIE_EMU_IE10_FORCE":"wx.html2.",
"WEBVIEWIE_EMU_IE11":"wx.html2.",
"WEBVIEWIE_EMU_IE11_FORCE":"wx.html2.",
"WEBVIEWIE_EMU_IE7":"wx.html2.",
"WEBVIEWIE_EMU_IE8":"wx.html2.",
"WEBVIEWIE_EMU_IE8_FORCE":"wx.html2.",
"WEBVIEWIE_EMU_IE9":"wx.html2.",
"WEBVIEWIE_EMU_IE9_FORCE":"wx.html2.",
"WEBVIEW_FIND_BACKWARDS":"wx.html2.",
"WEBVIEW_FIND_DEFAULT":"wx.html2.",
"WEBVIEW_FIND_ENTIRE_WORD":"wx.html2.",
@@ -6850,6 +6868,7 @@
"WebViewFindFlags":"wx.html2.",
"WebViewHandler":"wx.html2.",
"WebViewHistoryItem":"wx.html2.",
"WebViewIE_EmulationLevel":"wx.html2.",
"WebViewNameStr":"wx.html2.",
"WebViewNavigationActionFlags":"wx.html2.",
"WebViewNavigationError":"wx.html2.",
@@ -7001,6 +7020,9 @@
"wxEVT_CLOSE_WINDOW":"wx.",
"wxEVT_COLLAPSIBLEPANE_CHANGED":"wx.",
"wxEVT_COLOURPICKER_CHANGED":"wx.",
"wxEVT_COLOURPICKER_CURRENT_CHANGED":"wx.",
"wxEVT_COLOURPICKER_DIALOG_CANCELLED":"wx.",
"wxEVT_COLOUR_CHANGED":"wx.",
"wxEVT_COMBOBOX":"wx.",
"wxEVT_COMBOBOX_CLOSEUP":"wx.",
"wxEVT_COMBOBOX_DROPDOWN":"wx.",

View File

@@ -191,6 +191,8 @@ def run():
self->RegisterRGBAImage(type, (unsigned char*)pixels->m_ptr);
""")
c.find('MarkerDefinePixmap').ignore()
c.find('RegisterImage').findOverload('xpmData').ignore()
# TODO: Add the UTF8 PyMethods from classic (see _stc_utf8_methods.py)

View File

@@ -19,6 +19,7 @@ DOCSTRING = ""
# this script.
ITEMS = [ "wxColourData",
"wxColourDialog",
"wxColourDialogEvent" ,
]
#---------------------------------------------------------------------------
@@ -43,6 +44,13 @@ def run():
c.mustHaveApp()
c = module.find('wxColourDialogEvent')
tools.fixEventClass(c)
module.addPyCode("""\
EVT_COLOUR_CHANGED = PyEventBinder(wxEVT_COLOUR_CHANGED, 1)
""")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -28,6 +28,8 @@ ITEMS = [ 'wxFontMetrics',
'wxDCPenChanger',
'wxDCTextColourChanger',
'wxDCFontChanger',
'wxDCTextBgColourChanger',
'wxDCTextBgModeChanger',
]
OTHERDEPS = [ 'src/dc_ex.cpp', ]
@@ -506,6 +508,24 @@ def run():
c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'return False')
#-----------------------------------------------------------------
c = module.find('wxDCTextBgColourChanger')
assert isinstance(c, etgtools.ClassDef)
c.addPrivateCopyCtor()
# context manager methods
c.addPyMethod('__enter__', '(self)', 'return self')
c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'return False')
#-----------------------------------------------------------------
c = module.find('wxDCTextBgModeChanger')
assert isinstance(c, etgtools.ClassDef)
c.addPrivateCopyCtor()
# context manager methods
c.addPyMethod('__enter__', '(self)', 'return self')
c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'return False')
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -42,7 +42,7 @@ def run():
c.find('wxGCDC.printerDC').keepReference = True
c.find('wxGCDC.context').transfer = True
c.find('SetGraphicsContext.ctx').transfer = True
c.find('SetGraphicsContext.context').transfer = True
#-----------------------------------------------------------------

View File

@@ -23,6 +23,7 @@ ITEMS = [ 'wxGridCellCoords',
'wxGridCellStringRenderer',
'wxGridCellAutoWrapStringRenderer',
'wxGridCellBoolRenderer',
'wxGridCellDateRenderer',
'wxGridCellDateTimeRenderer',
'wxGridCellEnumRenderer',
'wxGridCellFloatRenderer',
@@ -30,6 +31,7 @@ ITEMS = [ 'wxGridCellCoords',
'wxGridCellEditor',
'wxGridCellTextEditor',
'wxGridCellDateEditor',
'wxGridCellAutoWrapStringEditor',
'wxGridCellBoolEditor',
'wxGridCellChoiceEditor',
@@ -81,6 +83,7 @@ def run():
GRID_VALUE_NUMBER = "long"
GRID_VALUE_FLOAT = "double"
GRID_VALUE_CHOICE = "choice"
GRID_VALUE_DATE = "date"
GRID_VALUE_TEXT = "string"
GRID_VALUE_LONG = "long"
GRID_VALUE_CHOICEINT = "choiceint"

View File

@@ -22,8 +22,7 @@ DOCSTRING = ""
# The classes and/or the basename of the Doxygen XML files to be processed by
# this script.
ITEMS = [
'wxMessageDialog',
ITEMS = [ 'wxMessageDialog',
]
#---------------------------------------------------------------------------

View File

@@ -53,6 +53,7 @@ def run():
#endif
""")
# TODO: Also add wxGenericNotificationMessage
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -64,6 +64,8 @@ def run():
module.addPyCode("""\
EVT_COLOURPICKER_CHANGED = wx.PyEventBinder( wxEVT_COLOURPICKER_CHANGED, 1 )
EVT_COLOURPICKER_CURRENT_CHANGED = wx.PyEventBinder( wxEVT_COLOURPICKER_CURRENT_CHANGED, 1 )
EVT_COLOURPICKER_DIALOG_CANCELLED = wx.PyEventBinder( wxEVT_COLOURPICKER_DIALOG_CANCELLED, 1 )
# deprecated wxEVT alias
wxEVT_COMMAND_COLOURPICKER_CHANGED = wxEVT_COLOURPICKER_CHANGED

View File

@@ -32,6 +32,8 @@ def run():
# Tweak the parsed meta objects in the module object as needed for
# customizing the generated code and docstrings.
module.addCppCode("#include <wx/popupwin.h>")
c = module.find('wxPopupWindow')
assert isinstance(c, etgtools.ClassDef)
c.mustHaveApp()

View File

@@ -18,6 +18,7 @@ DOCSTRING = ""
# The classes and/or the basename of the Doxygen XML files to be processed by
# this script.
ITEMS = [ "wxSystemSettings",
"wxSystemAppearance",
]
#---------------------------------------------------------------------------
@@ -41,6 +42,10 @@ def run():
c.find('GetScreenType').mustHaveApp()
c = module.find('wxSystemAppearance')
assert isinstance(c, etgtools.ClassDef)
c.addPrivateDefaultCtor()
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.runGenerators(module)

View File

@@ -12,6 +12,8 @@
import etgtools
import etgtools.tweaker_tools as tools
from textwrap import dedent
PACKAGE = "wx"
MODULE = "_core"
NAME = "sizer" # Base name of the file to generate to for this script
@@ -161,6 +163,19 @@ def run():
c.addPyCode('Sizer.__bool__ = Sizer.__nonzero__') # For Python 3
m = etgtools.MethodDef(type='void', name='RecalcSizes', argsString='()', isVirtual=True,
briefDoc="This is a deprecated version of RepositionChildren()",
detailedDoc=[dedent("""\
This is a deprecated version of RepositionChildren() which doesn't take
the minimal size parameter which is not needed for very simple sizers
but typically is for anything more complicated, so prefer to override
RepositionChildren() in new code.
If RepositionChildren() is not overridden, this method must be
overridden, calling the base class version results in an assertion
failure.
""")],
)
#---------------------------------------------
c = module.find('wxBoxSizer')

View File

@@ -63,6 +63,9 @@ def run():
module.find('wxSetDisplayName').ignore()
module.find('wxPostDelete').ignore()
# TODO: Can this be added back? It was removed because of compiler errors.
module.find('wxGetDiskSpace').ignore()
# deprecated and removed
module.find('wxUsleep').ignore()

View File

@@ -51,6 +51,24 @@ def run():
module.addGlobalStr('wxWebViewNameStr', 0)
module.addGlobalStr('wxWebViewDefaultURLStr', 0)
module.addHeaderCode("""\
#ifndef wxWebViewIE_H
enum wxWebViewIE_EmulationLevel
{
wxWEBVIEWIE_EMU_DEFAULT = 0,
wxWEBVIEWIE_EMU_IE7 = 7000,
wxWEBVIEWIE_EMU_IE8 = 8000,
wxWEBVIEWIE_EMU_IE8_FORCE = 8888,
wxWEBVIEWIE_EMU_IE9 = 9000,
wxWEBVIEWIE_EMU_IE9_FORCE = 9999,
wxWEBVIEWIE_EMU_IE10 = 10000,
wxWEBVIEWIE_EMU_IE10_FORCE = 10001,
wxWEBVIEWIE_EMU_IE11 = 11000,
wxWEBVIEWIE_EMU_IE11_FORCE = 11001
};
#endif
""")
# This tweak is needed only for the stub code
module.find('wxWebViewHandler.wxWebViewHandler').argsString = '(const wxString& scheme="")'
@@ -125,6 +143,14 @@ def run():
""")
c.find('MSWSetEmulationLevel').setCppCode("""\
#if wxUSE_WEBVIEW_IE && defined(__WXMSW__)
return wxWebViewIE::MSWSetEmulationLevel(level);
#else
return false;
#endif
""")
c = module.find('wxWebViewEvent')
tools.fixEventClass(c)

View File

@@ -1081,6 +1081,13 @@ class ClassDef(BaseDef):
self.addItem(WigCode(text))
def addDefaultCtor(self, prot='protected'):
# add declaration of a copy constructor to this class
wig = WigCode("""\
{PROT}:
{CLASS}();""".format(CLASS=self.name, PROT=prot))
self.addItem(wig)
def addCopyCtor(self, prot='protected'):
# add declaration of a copy constructor to this class
wig = WigCode("""\
@@ -1091,6 +1098,9 @@ class ClassDef(BaseDef):
def addPrivateCopyCtor(self):
self.addCopyCtor('private')
def addPrivateDefaultCtor(self):
self.addDefaultCtor('private')
def addPrivateAssignOp(self):
# add declaration of an assignment opperator to this class
wig = WigCode("""\

View File

@@ -328,12 +328,11 @@ def fixSizerClass(klass):
"""
removeVirtuals(klass)
klass.find('CalcMin').isVirtual = True
klass.find('RecalcSizes').isVirtual = True
klass.find('RepositionChildren').isVirtual = True
# in the wxSizer class they are pure-virtual
# in the wxSizer class it is pure-virtual
if klass.name == 'wxSizer':
klass.find('CalcMin').isPureVirtual = True
klass.find('RecalcSizes').isPureVirtual = True
def fixBookctrlClass(klass):