From f7ff075f45ef4fe85ad46a465b9944795dc52d30 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 31 Jul 2019 12:20:00 -0700 Subject: [PATCH] Various fixes and tweaks to go with the wxWidgets update --- docs/sphinx/itemToModuleMap.json | 13 +++++++++++++ etg/bitmap.py | 6 +++--- etg/grid.py | 4 ++++ etg/log.py | 1 + etg/propgridproperty.py | 4 ++++ etg/propgridprops.py | 16 +++++++++++----- etg/scrolwin.py | 2 ++ etg/textctrl.py | 2 ++ ext/wxWidgets | 2 +- wx/lib/wxcairo/__init__.py | 4 +++- 10 files changed, 44 insertions(+), 10 deletions(-) diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index b2d402e4..499cd436 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -967,6 +967,7 @@ "EditableListBox":"wx.adv.", "EditableListBoxNameStr":"wx.adv.", "EditableStateFlags":"wx.propgrid.PropertyGridInterface.", +"EditorDialogProperty":"wx.propgrid.", "EllipsizeFlags":"wx.", "EllipsizeMode":"wx.", "EmptyBitmap":"wx.", @@ -1008,6 +1009,7 @@ "FD_OVERWRITE_PROMPT":"wx.", "FD_PREVIEW":"wx.", "FD_SAVE":"wx.", +"FD_SHOW_HIDDEN":"wx.", "FFont":"wx.", "FIXED_LENGTH":"wx.", "FIXED_MINSIZE":"wx.", @@ -1451,6 +1453,7 @@ "GridTableMessage":"wx.grid.", "GridTableRequest":"wx.grid.", "GridUpdateLocker":"wx.grid.", +"GridWindow":"wx.grid.", "HDR_SORT_ICON_DOWN":"wx.", "HDR_SORT_ICON_NONE":"wx.", "HDR_SORT_ICON_UP":"wx.", @@ -2517,6 +2520,7 @@ "NullPen":"wx.", "NullRegion":"wx.", "NumberEntryDialog":"wx.", +"NumericProperty":"wx.propgrid.", "NumericPropertyValidator":"wx.propgrid.", "NumericType":"wx.propgrid.NumericPropertyValidator.", "OBJID_ALERT":"wx.", @@ -2856,6 +2860,7 @@ "PG_PROPERTY_VALIDATION_ERROR_MESSAGE":"wx.propgrid.", "PG_PROPERTY_VALIDATION_SATURATE":"wx.propgrid.", "PG_PROPERTY_VALIDATION_WRAP":"wx.propgrid.", +"PG_PROP_ACTIVE_BTN":"wx.propgrid.", "PG_PROP_AGGREGATE":"wx.propgrid.", "PG_PROP_AUTO_UNSPECIFIED":"wx.propgrid.", "PG_PROP_BEING_DELETED":"wx.propgrid.", @@ -6128,6 +6133,8 @@ "StripMenuCodes":"wx.", "Strip_Accel":"wx.", "Strip_All":"wx.", +"Strip_CJKMnemonics":"wx.", +"Strip_Menu":"wx.", "Strip_Mnemonics":"wx.", "StyledTextCtrl":"wx.stc.", "StyledTextEvent":"wx.stc.", @@ -6253,6 +6260,10 @@ "TEXT_ATTR_RIGHT_INDENT":"wx.", "TEXT_ATTR_TABS":"wx.", "TEXT_ATTR_TEXT_COLOUR":"wx.", +"TEXT_ATTR_UNDERLINE_DOUBLE":"wx.", +"TEXT_ATTR_UNDERLINE_NONE":"wx.", +"TEXT_ATTR_UNDERLINE_SOLID":"wx.", +"TEXT_ATTR_UNDERLINE_SPECIAL":"wx.", "TEXT_ATTR_UNITS_HUNDREDTHS_POINT":"wx.richtext.", "TEXT_ATTR_UNITS_MASK":"wx.richtext.", "TEXT_ATTR_UNITS_PERCENTAGE":"wx.richtext.", @@ -6422,6 +6433,7 @@ "TextAttrLineSpacing":"wx.", "TextAttrShadow":"wx.richtext.", "TextAttrSize":"wx.richtext.", +"TextAttrUnderlineType":"wx.", "TextAttrUnits":"wx.richtext.", "TextAttrValueFlags":"wx.richtext.", "TextBoxAttr":"wx.richtext.", @@ -7301,6 +7313,7 @@ "wxEVT_STC_AUTOCOMP_CHAR_DELETED":"wx.stc.", "wxEVT_STC_AUTOCOMP_COMPLETED":"wx.stc.", "wxEVT_STC_AUTOCOMP_SELECTION":"wx.stc.", +"wxEVT_STC_AUTOCOMP_SELECTION_CHANGE":"wx.stc.", "wxEVT_STC_CALLTIP_CLICK":"wx.stc.", "wxEVT_STC_CHANGE":"wx.stc.", "wxEVT_STC_CHARADDED":"wx.stc.", diff --git a/etg/bitmap.py b/etg/bitmap.py index 113562a2..ca822b7a 100644 --- a/etg/bitmap.py +++ b/etg/bitmap.py @@ -200,7 +200,7 @@ def run(): parameters must be a Python object that implements the buffer interface, such as a string, bytearray, etc. The data object is expected to contain a series of RGB bytes and be at least - width*height*3 bytes long, while the alpha object is expected + (width * height * 3) bytes long, while the alpha object is expected to be width*height bytes long and represents the image's alpha channel. On Windows and Mac the RGB values will be 'premultiplied' by the alpha values. (The other platforms do @@ -251,7 +251,7 @@ def run(): Creates a :class:`wx.Bitmap` from in-memory data. The data parameter must be a Python object that implements the buffer interface, such as a string, bytearray, etc. The data object is expected to contain - a series of RGB bytes and be at least width*height*3 bytes long. + a series of RGB bytes and be at least (width * height * 3) bytes long. Unlike :func:`wx.ImageFromBuffer` the bitmap created with this function does not share the memory block with the buffer object. This is @@ -291,7 +291,7 @@ def run(): Creates a :class:`wx.Bitmap` from in-memory data. The data parameter must be a Python object that implements the buffer interface, such as a string, bytearray, etc. The data object is expected to contain - a series of RGBA bytes and be at least width*height*4 bytes long. + a series of RGBA bytes and be at least (width * height * 4) bytes long. On Windows and Mac the RGB values will be 'premultiplied' by the alpha values. (The other platforms do the multiplication themselves.) diff --git a/etg/grid.py b/etg/grid.py index f9bcfb92..be63979f 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -90,6 +90,8 @@ def run(): GRID_VALUE_DATETIME = "datetime" """) + module.insertItem(0, etgtools.TypedefDef(type='wxWindow', name='wxGridWindow')) + #----------------------------------------------------------------- c = module.find('wxGridCellCoords') assert isinstance(c, etgtools.ClassDef) @@ -480,6 +482,8 @@ def run(): c.find('SetCellAlignment').findOverload('align').ignore() c.find('SetCellTextColour').overloads = [] + c.find('GetGridWindowOffset').findOverload('int &x').ignore() + #----------------------------------------------------------------- c = module.find('wxGridUpdateLocker') c.addPrivateCopyCtor() diff --git a/etg/log.py b/etg/log.py index 86a9cc15..fe9388e9 100644 --- a/etg/log.py +++ b/etg/log.py @@ -74,6 +74,7 @@ def run(): c = module.find('wxLog') assert isinstance(c, etgtools.ClassDef) + c.addPrivateCopyCtor() c.find('SetActiveTarget').transferBack = True c.find('SetActiveTarget.logtarget').transfer = True diff --git a/etg/propgridproperty.py b/etg/propgridproperty.py index c9ed55cd..51fb90dc 100644 --- a/etg/propgridproperty.py +++ b/etg/propgridproperty.py @@ -69,6 +69,10 @@ def run(): c = module.find('wxPGProperty') tools.ignoreConstOverloads(c) + # The ctors are protected, so unignore them + for ctor in c.find('wxPGProperty').all(): + ctor.ignore(False) + c.find('StringToValue.variant').out = True c.find('IntToValue.variant').out = True diff --git a/etg/propgridprops.py b/etg/propgridprops.py index 0382d91f..8575d44c 100644 --- a/etg/propgridprops.py +++ b/etg/propgridprops.py @@ -19,6 +19,7 @@ DOCSTRING = "" # this script. ITEMS = [ 'wxPGInDialogValidator', 'wxStringProperty', + 'wxNumericProperty', 'wxNumericPropertyValidator', 'wxIntProperty', 'wxUIntProperty', @@ -27,9 +28,8 @@ ITEMS = [ 'wxPGInDialogValidator', 'wxEnumProperty', 'wxEditEnumProperty', 'wxFlagsProperty', - 'wxPGFileDialogAdapter', + 'wxEditorDialogProperty', 'wxFileProperty', - 'wxPGLongStringDialogAdapter', 'wxLongStringProperty', 'wxDirProperty', 'wxArrayStringProperty', @@ -53,6 +53,14 @@ def run(): assert isinstance(c, etgtools.ClassDef) c.bases = ['wxValidator'] + c = module.find('wxNumericProperty') + c.find('wxNumericProperty').ignore(False) + c.addPrivateDefaultCtor() + + c = module.find('wxEditorDialogProperty') + c.find('wxEditorDialogProperty').ignore(False) + c.find('DisplayEditorDialog').ignore(False) + c.addPrivateDefaultCtor() for name in ['wxEnumProperty', 'wxEditEnumProperty']: c = module.find(name) @@ -78,11 +86,9 @@ def run(): c.detailedDoc = [] c = module.find('wxLongStringProperty') - c.find('OnButtonClick.value').inOut = True c.find('DisplayEditorDialog.value').inOut = True c = module.find('wxDirProperty') - c.find('OnButtonClick.value').inOut = True c = module.find('wxArrayStringProperty') c.find('GenerateValueAsString').ignore(False) @@ -106,7 +112,7 @@ def run(): for item in module.allItems(): if (item.name in ['StringToValue', 'IntToValue'] and item.findItem('variant')): item.find('variant').out = True - + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/scrolwin.py b/etg/scrolwin.py index 5000cf14..cec8d6b1 100644 --- a/etg/scrolwin.py +++ b/etg/scrolwin.py @@ -63,6 +63,8 @@ def parseAndTweakModule(): scrolled.find('GetSizeAvailableForScrollTarget').isVirtual = True scrolled.find('GetSizeAvailableForScrollTarget').ignore(False) scrolled.find('SendAutoScrollEvents').isVirtual = True + scrolled.find('ShouldScrollToChildOnFocus').ignore(False) + scrolled.find('ShouldScrollToChildOnFocus').isVirtual = True # The wxScrolledCanvas typedef will be output normally and SIP will treat # it like a class that has a wxScrolled mix-in as one of the base classes. diff --git a/etg/textctrl.py b/etg/textctrl.py index 31c7e85e..bb9bd14f 100644 --- a/etg/textctrl.py +++ b/etg/textctrl.py @@ -39,6 +39,8 @@ def parseAndTweakModule(): assert isinstance(c, etgtools.ClassDef) c.find('operator=').ignore() c.find('SetFont').pyArgsString = '(font, flags=TEXT_ATTR_FONT & ~TEXT_ATTR_FONT_PIXEL_SIZE)' + c.find('SetFontUnderlined').renameOverload('wxTextAttrUnderlineType', + 'SetFontUnderlineType') c = module.find('wxTextCtrl') diff --git a/ext/wxWidgets b/ext/wxWidgets index a6b92cb3..cd2e3dd2 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit a6b92cb313624f1d2ffe62a4eb270a4340851bb8 +Subproject commit cd2e3dd2cf2df4df386f843fee60b933736c2e47 diff --git a/wx/lib/wxcairo/__init__.py b/wx/lib/wxcairo/__init__.py index 041db7b2..2b1ef6c2 100644 --- a/wx/lib/wxcairo/__init__.py +++ b/wx/lib/wxcairo/__init__.py @@ -33,7 +33,9 @@ check if libcairo and either cairocffi or pycairo packages are installed. On Mac you can get Cairo from MacPorts or similar tools. Make sure that the quartz option is turned on so those Mac-specific APIs will be included in the Cairo library when it is built. You can then use ``pip install cairocffi`` -to get the Python wrappers. +to get the Python wrappers. If your cairo shared library is in a non-standard +location, then you can help it be found by setting DYLD_FALLBACK_LIBRARY_PATH +in the environment. On Windows a copy of the Cairo and related DLLs are included with wxPython inside the wx package folder. These files were extracted from the GTK runtime