From 03298a49cc2cd887b761631d793a826c7937d8a0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 11:24:35 -0800 Subject: [PATCH 01/11] Add overview text for DataViewCustomRenderer demo --- demo/DVC_CustomRenderer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demo/DVC_CustomRenderer.py b/demo/DVC_CustomRenderer.py index d1f5307d..76c6cd6d 100644 --- a/demo/DVC_CustomRenderer.py +++ b/demo/DVC_CustomRenderer.py @@ -201,9 +201,10 @@ def runTest(frame, nb, log): overview = """ -

DemoName

+

DataViewCustomRenderer

-Say something nice here +This sample shows how to implement a renderer for drawing the cells in a +DataViewControl in a custom manner. """ From ed035b51b35b12e1c65d26f413004df224b25687 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 11:24:54 -0800 Subject: [PATCH 02/11] Fix typo --- demo/Menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/Menu.py b/demo/Menu.py index c77b012e..96e91a49 100644 --- a/demo/Menu.py +++ b/demo/Menu.py @@ -36,7 +36,7 @@ check the source for this sample to see how to implement them. item.SetFont(wx.Font(wx.FontInfo(10).Bold())) menu1.Append(item) else: - # But we'lkl just do it the normal way for this sample + # But we'll just do it the normal way for this sample menu1.Append(103, "&Earth", "You may select Earth too") menu1.AppendSeparator() menu1.Append(104, "&Close", "Close this frame") From dd88295af4acc3b1d34e43a99509636bcc24dd3a Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 11:25:42 -0800 Subject: [PATCH 03/11] Change initial window size --- demo/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/run.py b/demo/run.py index 1142e9c5..027b4f49 100755 --- a/demo/run.py +++ b/demo/run.py @@ -83,7 +83,7 @@ class RunDemoApp(wx.App, wx.lib.mixins.inspection.InspectionMixin): # its own top-level window if win: # so set the frame to a good size for showing stuff - frame.SetSize((640, 480)) + frame.SetSize((800, 600)) win.SetFocus() self.window = win ns['win'] = win From 93cbfc35a908b783fd8442c4b85fbe57fa0a7d49 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 11:26:15 -0800 Subject: [PATCH 04/11] Add docstring for SetMaskColour --- etg/bitmap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etg/bitmap.py b/etg/bitmap.py index ca822b7a..8936466c 100644 --- a/etg/bitmap.py +++ b/etg/bitmap.py @@ -89,7 +89,9 @@ def run(): c.find('SetMask.mask').transfer = True - c.addCppMethod('void', 'SetMaskColour', '(const wxColour& colour)', """\ + c.addCppMethod('void', 'SetMaskColour', '(const wxColour& colour)', + doc="Create a mask for this bitmap based on the pixels with the given colour.", + body="""\ wxMask* mask = new wxMask(*self, *colour); self->SetMask(mask); """) From fbc014b1894a72b7cc1ef163724a1a5f2bcd6f13 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 11:27:29 -0800 Subject: [PATCH 05/11] Ignore GetEventUserData, because it is used internally by wxPython --- etg/event.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etg/event.py b/etg/event.py index 90ec47bc..3b51cbcc 100644 --- a/etg/event.py +++ b/etg/event.py @@ -354,6 +354,8 @@ def run(): c.abstract = True c.find('Clone').factory = True + c.find('GetEventUserData').ignore() + c.addProperty('EventObject GetEventObject SetEventObject') c.addProperty('EventType GetEventType SetEventType') c.addProperty('Id GetId SetId') From 57df21f2ef5311f9367c7230f0e7a9336446260b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 11:28:39 -0800 Subject: [PATCH 06/11] Avoid crashes in some GetNative* methods --- etg/graphics.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/etg/graphics.py b/etg/graphics.py index e117e0e2..20bf5258 100644 --- a/etg/graphics.py +++ b/etg/graphics.py @@ -201,6 +201,11 @@ def run(): c.find('GetCurrentPoint').findOverload('wxDouble *x, wxDouble *y').ignore() c.mustHaveApp() + c.find('GetNativePath').setCppCode("""\ + if (self->IsNull()) + return (void*)0; + return self->GetNativePath(); + """) #--------------------------------------------- c = module.find('wxGraphicsRenderer') @@ -283,6 +288,12 @@ def run(): c.find('TransformPoint.x').inOut = True c.find('TransformPoint.y').inOut = True + c.find('GetNativeMatrix').setCppCode("""\ + if (self->IsNull()) + return (void*)0; + return self->GetNativeMatrix(); + """) + #--------------------------------------------- c = module.find('wxGraphicsGradientStops') @@ -293,6 +304,16 @@ def run(): factory=True) + + #--------------------------------------------- + c = module.find('wxGraphicsBitmap') + c.find('GetNativeBitmap').setCppCode("""\ + if (self->IsNull()) + return (void*)0; + return self->GetNativeBitmap(); + """) + + #--------------------------------------------- c = module.find('wxGraphicsPenInfo') # Ignore Dashes for now From 733c11fdbc2f641b82ceb642c91669788f3e2330 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 11:31:14 -0800 Subject: [PATCH 07/11] Set setuptools version to <45 for Python2.7 --- .azure/ci-linux-job.yml | 2 +- .azure/ci-macos-job.yml | 2 +- .azure/ci-windows-job.yml | 2 +- requirements/devel.txt | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.azure/ci-linux-job.yml b/.azure/ci-linux-job.yml index 4260ca62..43926cda 100644 --- a/.azure/ci-linux-job.yml +++ b/.azure/ci-linux-job.yml @@ -44,7 +44,7 @@ jobs: $PYTHON --version $MAKE_VENV source venv/bin/activate - python -m pip install -U pip setuptools wheel + python -m pip install -U pip "setuptools<45" wheel python -m pip install -r requirements.txt displayName: 'Install Python dependencies' diff --git a/.azure/ci-macos-job.yml b/.azure/ci-macos-job.yml index 91f4f8f4..b73fb757 100644 --- a/.azure/ci-macos-job.yml +++ b/.azure/ci-macos-job.yml @@ -40,7 +40,7 @@ jobs: - script: | curl -O https://bootstrap.pypa.io/get-pip.py $PYTHON get-pip.py - $PYTHON -m pip install -U setuptools wheel + $PYTHON -m pip install -U "setuptools<45" wheel $PYTHON -m pip install -r requirements.txt displayName: 'Install Python dependencies' diff --git a/.azure/ci-windows-job.yml b/.azure/ci-windows-job.yml index 72053dfd..d01cd6f4 100644 --- a/.azure/ci-windows-job.yml +++ b/.azure/ci-windows-job.yml @@ -53,7 +53,7 @@ jobs: - bash: | curl -O https://bootstrap.pypa.io/get-pip.py python get-pip.py - python -m pip install -U setuptools wheel + python -m pip install -U "setuptools<45" wheel python -m pip install -r requirements.txt displayName: 'Install Python dependencies' diff --git a/requirements/devel.txt b/requirements/devel.txt index 4a0577f3..73a9f9a7 100644 --- a/requirements/devel.txt +++ b/requirements/devel.txt @@ -1,7 +1,9 @@ # Python packages needed for building and testing wxPython Phoenix -r install.txt appdirs -setuptools +setuptools < 45 ; python_version < '3.0' +setuptools ; python_version >= '3.0' + wheel twine requests From e8984e7ac11972212856eea163501da647a446a5 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 10:58:41 -0800 Subject: [PATCH 08/11] Update wxWidgets submodule --- ext/wxWidgets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/wxWidgets b/ext/wxWidgets index ff66848b..767c07c0 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit ff66848b050709c28bcb99e327a5a2ac4900fa2e +Subproject commit 767c07c040fcd5d587b5065cdedcb8414487e3bc From 11e4cf1f82445aa91247744d5e3adbaf27415a66 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 10:52:36 -0800 Subject: [PATCH 09/11] Add wxGridFitMode --- docs/sphinx/itemToModuleMap.json | 1 + etg/grid.py | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index c6d674b6..c53aaeef 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -1446,6 +1446,7 @@ "GridDirection":"wx.grid.", "GridEditorCreatedEvent":"wx.grid.", "GridEvent":"wx.grid.", +"GridFitMode":"wx.grid.", "GridHeaderLabelsRenderer":"wx.grid.", "GridNameStr":"wx.grid.", "GridRangeSelectEvent":"wx.grid.", diff --git a/etg/grid.py b/etg/grid.py index 66298871..3c6b533c 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -39,6 +39,7 @@ ITEMS = [ 'wxGridCellCoords', 'wxGridCellFloatEditor', 'wxGridCellNumberEditor', + 'wxGridFitMode', 'wxGridCellAttr', 'wxGridCornerHeaderRenderer', From daf5aa9ce313996a17b0dd56ec8dc5039d66e9d7 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 15:49:03 -0800 Subject: [PATCH 10/11] No longer any need to explicitly ignore some macros --- etg/event.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/etg/event.py b/etg/event.py index 3b51cbcc..0d6d4636 100644 --- a/etg/event.py +++ b/etg/event.py @@ -99,15 +99,6 @@ def run(): #endif """) - # C macros that need to be ignored - module.find('wx__DECLARE_EVT0').ignore() - module.find('wx__DECLARE_EVT1').ignore() - module.find('wx__DECLARE_EVT2').ignore() - module.find('wxEVENT_HANDLER_CAST').ignore() - module.find('wxDECLARE_EXPORTED_EVENT').ignore() - module.find('wxDECLARE_EVENT').ignore() - module.find('wxDEFINE_EVENT').ignore() - module.addPyClass('PyEventBinder', ['object'], doc="""\ From 9eb9497afcf1c5c26007eb887bf8f10466a92f5c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 22 Jan 2020 20:36:00 -0800 Subject: [PATCH 11/11] The new native wxSearchCtrl on GTK does not include the wxTextCtrl methods, just those from wxTextEntry. --- etg/srchctrl.py | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/etg/srchctrl.py b/etg/srchctrl.py index e46a28ea..1f5964bc 100644 --- a/etg/srchctrl.py +++ b/etg/srchctrl.py @@ -42,21 +42,21 @@ def run(): c.addCppMethod('void', 'SetSearchBitmap', '(const wxBitmap* bmp)', """\ - #ifdef __WXMAC__ + #if wxUSE_NATIVE_SEARCH_CONTROL #else self->SetSearchBitmap(*bmp); #endif """) c.addCppMethod('void', 'SetSearchMenuBitmap', '(const wxBitmap* bmp)', """\ - #ifdef __WXMAC__ + #if wxUSE_NATIVE_SEARCH_CONTROL #else self->SetSearchMenuBitmap(*bmp); #endif """) c.addCppMethod('void', 'SetCancelBitmap', '(const wxBitmap* bmp)', """\ - #ifdef __WXMAC__ + #if wxUSE_NATIVE_SEARCH_CONTROL #else self->SetCancelBitmap(*bmp); #endif @@ -85,25 +85,6 @@ def run(): klass = mod.find('wxTextEntry') searchCtrl.items.extend(klass.items) - # Do the same with wxTextCtrl, but also remove things like the - # Constructors and Create methods first. - import textctrl - mod = textctrl.parseAndTweakModule() - klass = mod.find('wxTextCtrl') - # get just the methods that are not ctors, dtor or Create - items = [item for item in klass.items if isinstance(item, etgtools.MethodDef) and - not item.isCtor and - not item.isDtor and - item.name != 'Create'] - searchCtrl.items.extend(items) - - - searchCtrl.find('LoadFile').ignore() - searchCtrl.find('SaveFile').ignore() - searchCtrl.find('MacCheckSpelling').ignore() - searchCtrl.find('ShowNativeCaret').ignore() - searchCtrl.find('HideNativeCaret').ignore() - # Add some properties that autoProperties would not see because they are # not using 'Get' and 'Set'