diff --git a/CHANGES.rst b/CHANGES.rst index babac8d3..528a70fb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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: diff --git a/demo/NotificationMessage.py b/demo/NotificationMessage.py index c7dfe990..ab6043bd 100644 --- a/demo/NotificationMessage.py +++ b/demo/NotificationMessage.py @@ -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. """ if __name__ == '__main__': import sys,os import run run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) \ No newline at end of file +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:]) + + diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index 159f051a..bece8434 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -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.", diff --git a/etg/_stc.py b/etg/_stc.py index 990093fe..c7913a93 100644 --- a/etg/_stc.py +++ b/etg/_stc.py @@ -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) diff --git a/etg/colordlg.py b/etg/colordlg.py index b3915475..27fd9042 100644 --- a/etg/colordlg.py +++ b/etg/colordlg.py @@ -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) diff --git a/etg/dc.py b/etg/dc.py index 91be3656..c6754b8f 100644 --- a/etg/dc.py +++ b/etg/dc.py @@ -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) diff --git a/etg/dcgraph.py b/etg/dcgraph.py index e6aafebd..436b9b98 100644 --- a/etg/dcgraph.py +++ b/etg/dcgraph.py @@ -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 #----------------------------------------------------------------- diff --git a/etg/grid.py b/etg/grid.py index 7d0ae5d9..f9bcfb92 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -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" diff --git a/etg/msgdlg.py b/etg/msgdlg.py index b7a57b87..e505d3d7 100644 --- a/etg/msgdlg.py +++ b/etg/msgdlg.py @@ -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', ] #--------------------------------------------------------------------------- diff --git a/etg/notifmsg.py b/etg/notifmsg.py index d4b10bd5..e3947d99 100644 --- a/etg/notifmsg.py +++ b/etg/notifmsg.py @@ -53,6 +53,7 @@ def run(): #endif """) + # TODO: Also add wxGenericNotificationMessage #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/pickers.py b/etg/pickers.py index db77c9a8..f5fa6409 100644 --- a/etg/pickers.py +++ b/etg/pickers.py @@ -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 diff --git a/etg/popupwin.py b/etg/popupwin.py index 2cc16db5..420c24ac 100644 --- a/etg/popupwin.py +++ b/etg/popupwin.py @@ -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 ") + c = module.find('wxPopupWindow') assert isinstance(c, etgtools.ClassDef) c.mustHaveApp() diff --git a/etg/settings.py b/etg/settings.py index 727d3f5e..bd1c9147 100644 --- a/etg/settings.py +++ b/etg/settings.py @@ -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) diff --git a/etg/sizer.py b/etg/sizer.py index a49d1128..66293a87 100644 --- a/etg/sizer.py +++ b/etg/sizer.py @@ -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') diff --git a/etg/utils.py b/etg/utils.py index 0c186a2c..6d7e9c71 100644 --- a/etg/utils.py +++ b/etg/utils.py @@ -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() diff --git a/etg/webview.py b/etg/webview.py index ee741958..1820187f 100644 --- a/etg/webview.py +++ b/etg/webview.py @@ -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) diff --git a/etgtools/extractors.py b/etgtools/extractors.py index 7581b9dc..ab2645a6 100644 --- a/etgtools/extractors.py +++ b/etgtools/extractors.py @@ -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("""\ diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index da0d2e9f..8c713b41 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -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):