mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 12:00:13 +01:00
Lots of updates to get caught up with wxWidgets master (3.1.3+)
This commit is contained in:
@@ -18,10 +18,7 @@ Pip: ``pip install wxPython==4.1.0``
|
|||||||
|
|
||||||
Starting with this release wxPython has switched to tracking the wxWidgets
|
Starting with this release wxPython has switched to tracking the wxWidgets
|
||||||
master branch for the wxWidgets source code which wxPython is built upon, and
|
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
|
which is included in the wxPython source archives.
|
||||||
``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.
|
|
||||||
|
|
||||||
|
|
||||||
New and improved stuff in this release:
|
New and improved stuff in this release:
|
||||||
@@ -30,6 +27,10 @@ New and improved stuff in this release:
|
|||||||
OSXEnableAutomaticDashSubstitution, and OSXDisableAllSmartSubstitutions
|
OSXEnableAutomaticDashSubstitution, and OSXDisableAllSmartSubstitutions
|
||||||
methods in wx.TextCtrl.
|
methods in wx.TextCtrl.
|
||||||
|
|
||||||
|
* Added wx.ColourDialogEvent, wxDCTextBgColourChanger, wxDCTextBgModeChanger,
|
||||||
|
wx.grid.GridCellDateRenderer, wx.grid.GridCellDateEditor, wx.SystemAppearance,
|
||||||
|
etc.
|
||||||
|
|
||||||
|
|
||||||
Other changes in this release:
|
Other changes in this release:
|
||||||
|
|
||||||
|
|||||||
@@ -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:])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -699,6 +699,7 @@
|
|||||||
"ColourData":"wx.",
|
"ColourData":"wx.",
|
||||||
"ColourDatabase":"wx.",
|
"ColourDatabase":"wx.",
|
||||||
"ColourDialog":"wx.",
|
"ColourDialog":"wx.",
|
||||||
|
"ColourDialogEvent":"wx.",
|
||||||
"ColourDisplay":"wx.",
|
"ColourDisplay":"wx.",
|
||||||
"ColourPickerCtrl":"wx.",
|
"ColourPickerCtrl":"wx.",
|
||||||
"ColourPickerCtrlNameStr":"wx.",
|
"ColourPickerCtrlNameStr":"wx.",
|
||||||
@@ -750,6 +751,8 @@
|
|||||||
"DCFontChanger":"wx.",
|
"DCFontChanger":"wx.",
|
||||||
"DCOverlay":"wx.",
|
"DCOverlay":"wx.",
|
||||||
"DCPenChanger":"wx.",
|
"DCPenChanger":"wx.",
|
||||||
|
"DCTextBgColourChanger":"wx.",
|
||||||
|
"DCTextBgModeChanger":"wx.",
|
||||||
"DCTextColourChanger":"wx.",
|
"DCTextColourChanger":"wx.",
|
||||||
"DD_CHANGE_DIR":"wx.",
|
"DD_CHANGE_DIR":"wx.",
|
||||||
"DD_DEFAULT_STYLE":"wx.",
|
"DD_DEFAULT_STYLE":"wx.",
|
||||||
@@ -1350,6 +1353,7 @@
|
|||||||
"GetBatteryState":"wx.",
|
"GetBatteryState":"wx.",
|
||||||
"GetClientDisplayRect":"wx.",
|
"GetClientDisplayRect":"wx.",
|
||||||
"GetColourFromUser":"wx.",
|
"GetColourFromUser":"wx.",
|
||||||
|
"GetDiskSpace":"wx.",
|
||||||
"GetDisplayName":"wx.",
|
"GetDisplayName":"wx.",
|
||||||
"GetDisplayPPI":"wx.",
|
"GetDisplayPPI":"wx.",
|
||||||
"GetDisplaySize":"wx.",
|
"GetDisplaySize":"wx.",
|
||||||
@@ -1411,6 +1415,8 @@
|
|||||||
"GridCellBoolRenderer":"wx.grid.",
|
"GridCellBoolRenderer":"wx.grid.",
|
||||||
"GridCellChoiceEditor":"wx.grid.",
|
"GridCellChoiceEditor":"wx.grid.",
|
||||||
"GridCellCoords":"wx.grid.",
|
"GridCellCoords":"wx.grid.",
|
||||||
|
"GridCellDateEditor":"wx.grid.",
|
||||||
|
"GridCellDateRenderer":"wx.grid.",
|
||||||
"GridCellDateTimeRenderer":"wx.grid.",
|
"GridCellDateTimeRenderer":"wx.grid.",
|
||||||
"GridCellEditor":"wx.grid.",
|
"GridCellEditor":"wx.grid.",
|
||||||
"GridCellEnumEditor":"wx.grid.",
|
"GridCellEnumEditor":"wx.grid.",
|
||||||
@@ -2974,6 +2980,7 @@
|
|||||||
"PROPSHEET_SHRINKTOFIT":"wx.adv.",
|
"PROPSHEET_SHRINKTOFIT":"wx.adv.",
|
||||||
"PROPSHEET_TOOLBOOK":"wx.adv.",
|
"PROPSHEET_TOOLBOOK":"wx.adv.",
|
||||||
"PROPSHEET_TREEBOOK":"wx.adv.",
|
"PROPSHEET_TREEBOOK":"wx.adv.",
|
||||||
|
"PU_CONTAINS_CONTROLS":"wx.",
|
||||||
"PageSetupDialog":"wx.",
|
"PageSetupDialog":"wx.",
|
||||||
"PageSetupDialogData":"wx.",
|
"PageSetupDialogData":"wx.",
|
||||||
"PaintDC":"wx.",
|
"PaintDC":"wx.",
|
||||||
@@ -6128,6 +6135,7 @@
|
|||||||
"SysErrorCode":"wx.",
|
"SysErrorCode":"wx.",
|
||||||
"SysErrorMsg":"wx.",
|
"SysErrorMsg":"wx.",
|
||||||
"SysErrorMsgStr":"wx.",
|
"SysErrorMsgStr":"wx.",
|
||||||
|
"SystemAppearance":"wx.",
|
||||||
"SystemColour":"wx.",
|
"SystemColour":"wx.",
|
||||||
"SystemColourProperty":"wx.propgrid.",
|
"SystemColourProperty":"wx.propgrid.",
|
||||||
"SystemFeature":"wx.",
|
"SystemFeature":"wx.",
|
||||||
@@ -6573,6 +6581,16 @@
|
|||||||
"WEBKIT_STATE_START":"wx.webkit.",
|
"WEBKIT_STATE_START":"wx.webkit.",
|
||||||
"WEBKIT_STATE_STOP":"wx.webkit.",
|
"WEBKIT_STATE_STOP":"wx.webkit.",
|
||||||
"WEBKIT_STATE_TRANSFERRING":"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_BACKWARDS":"wx.html2.",
|
||||||
"WEBVIEW_FIND_DEFAULT":"wx.html2.",
|
"WEBVIEW_FIND_DEFAULT":"wx.html2.",
|
||||||
"WEBVIEW_FIND_ENTIRE_WORD":"wx.html2.",
|
"WEBVIEW_FIND_ENTIRE_WORD":"wx.html2.",
|
||||||
@@ -6850,6 +6868,7 @@
|
|||||||
"WebViewFindFlags":"wx.html2.",
|
"WebViewFindFlags":"wx.html2.",
|
||||||
"WebViewHandler":"wx.html2.",
|
"WebViewHandler":"wx.html2.",
|
||||||
"WebViewHistoryItem":"wx.html2.",
|
"WebViewHistoryItem":"wx.html2.",
|
||||||
|
"WebViewIE_EmulationLevel":"wx.html2.",
|
||||||
"WebViewNameStr":"wx.html2.",
|
"WebViewNameStr":"wx.html2.",
|
||||||
"WebViewNavigationActionFlags":"wx.html2.",
|
"WebViewNavigationActionFlags":"wx.html2.",
|
||||||
"WebViewNavigationError":"wx.html2.",
|
"WebViewNavigationError":"wx.html2.",
|
||||||
@@ -7001,6 +7020,9 @@
|
|||||||
"wxEVT_CLOSE_WINDOW":"wx.",
|
"wxEVT_CLOSE_WINDOW":"wx.",
|
||||||
"wxEVT_COLLAPSIBLEPANE_CHANGED":"wx.",
|
"wxEVT_COLLAPSIBLEPANE_CHANGED":"wx.",
|
||||||
"wxEVT_COLOURPICKER_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":"wx.",
|
||||||
"wxEVT_COMBOBOX_CLOSEUP":"wx.",
|
"wxEVT_COMBOBOX_CLOSEUP":"wx.",
|
||||||
"wxEVT_COMBOBOX_DROPDOWN":"wx.",
|
"wxEVT_COMBOBOX_DROPDOWN":"wx.",
|
||||||
|
|||||||
@@ -191,6 +191,8 @@ def run():
|
|||||||
self->RegisterRGBAImage(type, (unsigned char*)pixels->m_ptr);
|
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)
|
# TODO: Add the UTF8 PyMethods from classic (see _stc_utf8_methods.py)
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ DOCSTRING = ""
|
|||||||
# this script.
|
# this script.
|
||||||
ITEMS = [ "wxColourData",
|
ITEMS = [ "wxColourData",
|
||||||
"wxColourDialog",
|
"wxColourDialog",
|
||||||
|
"wxColourDialogEvent" ,
|
||||||
]
|
]
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@@ -43,6 +44,13 @@ def run():
|
|||||||
c.mustHaveApp()
|
c.mustHaveApp()
|
||||||
|
|
||||||
|
|
||||||
|
c = module.find('wxColourDialogEvent')
|
||||||
|
tools.fixEventClass(c)
|
||||||
|
|
||||||
|
module.addPyCode("""\
|
||||||
|
EVT_COLOUR_CHANGED = PyEventBinder(wxEVT_COLOUR_CHANGED, 1)
|
||||||
|
""")
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------
|
#-----------------------------------------------------------------
|
||||||
tools.doCommonTweaks(module)
|
tools.doCommonTweaks(module)
|
||||||
|
|||||||
20
etg/dc.py
20
etg/dc.py
@@ -28,6 +28,8 @@ ITEMS = [ 'wxFontMetrics',
|
|||||||
'wxDCPenChanger',
|
'wxDCPenChanger',
|
||||||
'wxDCTextColourChanger',
|
'wxDCTextColourChanger',
|
||||||
'wxDCFontChanger',
|
'wxDCFontChanger',
|
||||||
|
'wxDCTextBgColourChanger',
|
||||||
|
'wxDCTextBgModeChanger',
|
||||||
]
|
]
|
||||||
|
|
||||||
OTHERDEPS = [ 'src/dc_ex.cpp', ]
|
OTHERDEPS = [ 'src/dc_ex.cpp', ]
|
||||||
@@ -506,6 +508,24 @@ def run():
|
|||||||
c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'return False')
|
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.doCommonTweaks(module)
|
||||||
tools.runGenerators(module)
|
tools.runGenerators(module)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ def run():
|
|||||||
c.find('wxGCDC.printerDC').keepReference = True
|
c.find('wxGCDC.printerDC').keepReference = True
|
||||||
|
|
||||||
c.find('wxGCDC.context').transfer = True
|
c.find('wxGCDC.context').transfer = True
|
||||||
c.find('SetGraphicsContext.ctx').transfer = True
|
c.find('SetGraphicsContext.context').transfer = True
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------
|
#-----------------------------------------------------------------
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ ITEMS = [ 'wxGridCellCoords',
|
|||||||
'wxGridCellStringRenderer',
|
'wxGridCellStringRenderer',
|
||||||
'wxGridCellAutoWrapStringRenderer',
|
'wxGridCellAutoWrapStringRenderer',
|
||||||
'wxGridCellBoolRenderer',
|
'wxGridCellBoolRenderer',
|
||||||
|
'wxGridCellDateRenderer',
|
||||||
'wxGridCellDateTimeRenderer',
|
'wxGridCellDateTimeRenderer',
|
||||||
'wxGridCellEnumRenderer',
|
'wxGridCellEnumRenderer',
|
||||||
'wxGridCellFloatRenderer',
|
'wxGridCellFloatRenderer',
|
||||||
@@ -30,6 +31,7 @@ ITEMS = [ 'wxGridCellCoords',
|
|||||||
|
|
||||||
'wxGridCellEditor',
|
'wxGridCellEditor',
|
||||||
'wxGridCellTextEditor',
|
'wxGridCellTextEditor',
|
||||||
|
'wxGridCellDateEditor',
|
||||||
'wxGridCellAutoWrapStringEditor',
|
'wxGridCellAutoWrapStringEditor',
|
||||||
'wxGridCellBoolEditor',
|
'wxGridCellBoolEditor',
|
||||||
'wxGridCellChoiceEditor',
|
'wxGridCellChoiceEditor',
|
||||||
@@ -81,6 +83,7 @@ def run():
|
|||||||
GRID_VALUE_NUMBER = "long"
|
GRID_VALUE_NUMBER = "long"
|
||||||
GRID_VALUE_FLOAT = "double"
|
GRID_VALUE_FLOAT = "double"
|
||||||
GRID_VALUE_CHOICE = "choice"
|
GRID_VALUE_CHOICE = "choice"
|
||||||
|
GRID_VALUE_DATE = "date"
|
||||||
GRID_VALUE_TEXT = "string"
|
GRID_VALUE_TEXT = "string"
|
||||||
GRID_VALUE_LONG = "long"
|
GRID_VALUE_LONG = "long"
|
||||||
GRID_VALUE_CHOICEINT = "choiceint"
|
GRID_VALUE_CHOICEINT = "choiceint"
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ DOCSTRING = ""
|
|||||||
|
|
||||||
# The classes and/or the basename of the Doxygen XML files to be processed by
|
# The classes and/or the basename of the Doxygen XML files to be processed by
|
||||||
# this script.
|
# this script.
|
||||||
ITEMS = [
|
ITEMS = [ 'wxMessageDialog',
|
||||||
'wxMessageDialog',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ def run():
|
|||||||
#endif
|
#endif
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
# TODO: Also add wxGenericNotificationMessage
|
||||||
|
|
||||||
#-----------------------------------------------------------------
|
#-----------------------------------------------------------------
|
||||||
tools.doCommonTweaks(module)
|
tools.doCommonTweaks(module)
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ def run():
|
|||||||
|
|
||||||
module.addPyCode("""\
|
module.addPyCode("""\
|
||||||
EVT_COLOURPICKER_CHANGED = wx.PyEventBinder( wxEVT_COLOURPICKER_CHANGED, 1 )
|
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
|
# deprecated wxEVT alias
|
||||||
wxEVT_COMMAND_COLOURPICKER_CHANGED = wxEVT_COLOURPICKER_CHANGED
|
wxEVT_COMMAND_COLOURPICKER_CHANGED = wxEVT_COLOURPICKER_CHANGED
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ def run():
|
|||||||
# Tweak the parsed meta objects in the module object as needed for
|
# Tweak the parsed meta objects in the module object as needed for
|
||||||
# customizing the generated code and docstrings.
|
# customizing the generated code and docstrings.
|
||||||
|
|
||||||
|
module.addCppCode("#include <wx/popupwin.h>")
|
||||||
|
|
||||||
c = module.find('wxPopupWindow')
|
c = module.find('wxPopupWindow')
|
||||||
assert isinstance(c, etgtools.ClassDef)
|
assert isinstance(c, etgtools.ClassDef)
|
||||||
c.mustHaveApp()
|
c.mustHaveApp()
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ DOCSTRING = ""
|
|||||||
# The classes and/or the basename of the Doxygen XML files to be processed by
|
# The classes and/or the basename of the Doxygen XML files to be processed by
|
||||||
# this script.
|
# this script.
|
||||||
ITEMS = [ "wxSystemSettings",
|
ITEMS = [ "wxSystemSettings",
|
||||||
|
"wxSystemAppearance",
|
||||||
]
|
]
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@@ -41,6 +42,10 @@ def run():
|
|||||||
c.find('GetScreenType').mustHaveApp()
|
c.find('GetScreenType').mustHaveApp()
|
||||||
|
|
||||||
|
|
||||||
|
c = module.find('wxSystemAppearance')
|
||||||
|
assert isinstance(c, etgtools.ClassDef)
|
||||||
|
c.addPrivateDefaultCtor()
|
||||||
|
|
||||||
#-----------------------------------------------------------------
|
#-----------------------------------------------------------------
|
||||||
tools.doCommonTweaks(module)
|
tools.doCommonTweaks(module)
|
||||||
tools.runGenerators(module)
|
tools.runGenerators(module)
|
||||||
|
|||||||
15
etg/sizer.py
15
etg/sizer.py
@@ -12,6 +12,8 @@
|
|||||||
import etgtools
|
import etgtools
|
||||||
import etgtools.tweaker_tools as tools
|
import etgtools.tweaker_tools as tools
|
||||||
|
|
||||||
|
from textwrap import dedent
|
||||||
|
|
||||||
PACKAGE = "wx"
|
PACKAGE = "wx"
|
||||||
MODULE = "_core"
|
MODULE = "_core"
|
||||||
NAME = "sizer" # Base name of the file to generate to for this script
|
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
|
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')
|
c = module.find('wxBoxSizer')
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ def run():
|
|||||||
module.find('wxSetDisplayName').ignore()
|
module.find('wxSetDisplayName').ignore()
|
||||||
module.find('wxPostDelete').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
|
# deprecated and removed
|
||||||
module.find('wxUsleep').ignore()
|
module.find('wxUsleep').ignore()
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,24 @@ def run():
|
|||||||
module.addGlobalStr('wxWebViewNameStr', 0)
|
module.addGlobalStr('wxWebViewNameStr', 0)
|
||||||
module.addGlobalStr('wxWebViewDefaultURLStr', 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
|
# This tweak is needed only for the stub code
|
||||||
module.find('wxWebViewHandler.wxWebViewHandler').argsString = '(const wxString& scheme="")'
|
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')
|
c = module.find('wxWebViewEvent')
|
||||||
tools.fixEventClass(c)
|
tools.fixEventClass(c)
|
||||||
|
|||||||
@@ -1081,6 +1081,13 @@ class ClassDef(BaseDef):
|
|||||||
self.addItem(WigCode(text))
|
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'):
|
def addCopyCtor(self, prot='protected'):
|
||||||
# add declaration of a copy constructor to this class
|
# add declaration of a copy constructor to this class
|
||||||
wig = WigCode("""\
|
wig = WigCode("""\
|
||||||
@@ -1091,6 +1098,9 @@ class ClassDef(BaseDef):
|
|||||||
def addPrivateCopyCtor(self):
|
def addPrivateCopyCtor(self):
|
||||||
self.addCopyCtor('private')
|
self.addCopyCtor('private')
|
||||||
|
|
||||||
|
def addPrivateDefaultCtor(self):
|
||||||
|
self.addDefaultCtor('private')
|
||||||
|
|
||||||
def addPrivateAssignOp(self):
|
def addPrivateAssignOp(self):
|
||||||
# add declaration of an assignment opperator to this class
|
# add declaration of an assignment opperator to this class
|
||||||
wig = WigCode("""\
|
wig = WigCode("""\
|
||||||
|
|||||||
@@ -328,12 +328,11 @@ def fixSizerClass(klass):
|
|||||||
"""
|
"""
|
||||||
removeVirtuals(klass)
|
removeVirtuals(klass)
|
||||||
klass.find('CalcMin').isVirtual = True
|
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':
|
if klass.name == 'wxSizer':
|
||||||
klass.find('CalcMin').isPureVirtual = True
|
klass.find('CalcMin').isPureVirtual = True
|
||||||
klass.find('RecalcSizes').isPureVirtual = True
|
|
||||||
|
|
||||||
|
|
||||||
def fixBookctrlClass(klass):
|
def fixBookctrlClass(klass):
|
||||||
|
|||||||
Reference in New Issue
Block a user