Skip to content

Upgrade to wxPython 4.0.3 (Phoenix)#7104

Merged
michaelDCurran merged 78 commits into
nvaccess:masterfrom
josephsl:wxPy4
Jul 18, 2018
Merged

Upgrade to wxPython 4.0.3 (Phoenix)#7104
michaelDCurran merged 78 commits into
nvaccess:masterfrom
josephsl:wxPy4

Conversation

@josephsl

@josephsl josephsl commented Apr 26, 2017

Copy link
Copy Markdown
Contributor

Closes #7077
Closes #7429

Hi,

From 2012 to 2017, Robin Dunn and others have been working on a complete revamp of wxPython. One of the benefits of the resulting 4.0.0 release is ability to use wx modules via Python versions 2.7 and 3.5+. This will require a longer incubation period, as add-ons will need to be modified, an extensive hunt for issues must be carried out and so on.

at the moment the only major issue is wx.Yield, seen when one repeatedly taps arrow keys or certain keys quickly. For example, from Python Console, press backspace, and you may hear the error tone with a traceback that culminates in wxPython saying wx.Yield was called recursively. As for add-ons, wx.PyDeadObjectError must be changed to RuntimeError, certain wx.Center function arguments/constants have changed and so on.

Also, as part of wxPython, we also get the Six module for free, which eases transition to Python 3.x.

Thanks.

josephsl added 19 commits April 15, 2017 20:37
…vaccess#7077.

One of the biggest benefits of using wxPython 4 is easier route for upgrading to Python 3.x. Due to changes made in wxPython 4, NvDA source code (at least wx routines) must be modified. This provides some foundations, namely wx.adv.TaskbarIcon and replacing wx.SpinCtrlNameStr with a string literal.
…xtCtrl.write. re nvaccess#7077.

wx.TextCtrl.write is no more - wx.TextCtrl.WriteText should be used instead.
…rsor tracking. re nvaccess#7077.

If wx.TextCtrl.WriteText is used and if the cursor is located at the top of the output window for the console, newly typed text will be inserted instead of being appended, thus wx.TextCtrl.AppendText will be used.
…nter instead. re nvaccess#7077.

Somehow, documentation says wx.CENTRE_ON_SCREEN is included but it isn't there at runtime. Instead, wx.Center is used (does not follow variable naming convention though), so using it for now.
…r. re nvaccess#7077.

In wxPython 4, when instantiating wx.GridSizer, horizontal and vertical gaps in pixels must be specified.
…fore the dialog is destroyed. re nvaccess#7077.

Due to changes to how dialog sizes are constructed, keyword arguments cannot be used.
Also, if Window.Destroy is called, somehow text controls and what not are gone, so save speech viewer position before destroying the window.
… sure to check if the treeview is alive. re nvaccess#7077.

Somehow, when Cancel button is licked, treeview is removed first, yet item selection event is run. Make sure to catch this.
…t issues when installing more than one add-on remotely. re nvaccess#7077.

Here 'remotely' refers to letting people install add-ons via Windows Explorer and other means. Without nullifying instance flag when the add-ons manager closes, instance flag will be kept, which causes wxPython to think (and correctly) that the dialog is still active, resulting in runtime error on add-on list control being thrown.
…cess#7077.

Just like add-ons manager, if the instance flag for config profiles dialog isn't nullified, wxWidgets will think that the dialog is active when it is gone. Thus nullify it in two places: when the actual dialog closes and when a new profile is activated right away (for the latter, it is parent.Destroy).
# Conflicts:
#	source/gui/__init__.py
@LeonarddeR

Copy link
Copy Markdown
Collaborator

@josephsl: I belief this is still not a stable version. right?

@josephsl

josephsl commented Oct 12, 2017 via email

Copy link
Copy Markdown
Contributor Author

@LeonarddeR

Copy link
Copy Markdown
Collaborator

IN that case, wouldn't it be better to close this pr for now and throw up a new one as soon as there is a real release we can work with?

@josephsl

josephsl commented Oct 13, 2017 via email

Copy link
Copy Markdown
Contributor Author

@derekriemer derekriemer changed the title Upgrade to wxPython 4.0.0 (Phoenix) Upgrade to wxPython 4.0.0 (Phoenix) WIP Oct 13, 2017
Due to request from a tester, wxPython 4 developer has decided to restore wx.TextCtrl.write. This means the AppendText workaround in place is no longer needed.
…WXK_pAGEUP and wx.WXK_PAGEDOWN, respectively. re nvaccess#7077.

wx.WXK_PRIOR and wx.WXK_NEXT are no more, replaced by direct definition of page up and page down keys. This fixes the problem where sliders couldn't be changed in Voice Settings dialog.
@feerrenrut

Copy link
Copy Markdown
Contributor

Mentioning this here since I have seen a lot of changes explicitly changing to use wx.ID_ANY .
The default value for id is wx.ID_ANY see the window class docs
My preference would be to use named parameters / keyword arguments, and leave it as the default rather than re-specifying the default.

@michaelDCurran

Copy link
Copy Markdown
Member

@josephsl: does the issue with ID_ANY / newID etc affect anything in NVDA core? or just add-ons? If this does not affect NVDA core, I would like to merge this pr.

@josephsl

josephsl commented Jul 17, 2018 via email

Copy link
Copy Markdown
Contributor Author

@michaelDCurran

michaelDCurran commented Jul 17, 2018 via email

Copy link
Copy Markdown
Member

@josephsl

josephsl commented Jul 17, 2018 via email

Copy link
Copy Markdown
Contributor Author

@michaelDCurran michaelDCurran changed the title Upgrade to wxPython 4.0.1 (Phoenix) Upgrade to wxPython 4.0.3 (Phoenix) Jul 18, 2018
josephsl added 2 commits July 17, 2018 21:27
…ion for this checkbox just like others. re nvaccess#7077.

Somehow, for touch interaction/touch typing mode checkbox, wx.NewId function was called, whereas other checkboxes do not do this. Thus make it consistent with other fellows by not calling this function in this particular checkbox.
… panels. Re nvaccess#7077.

Reported by several people and subsequently confirmed: in wxPython 4.0.0 to 4.0.2, there exists a wrap-around bug in wx.NewId function that prevents programs calling this function from working normally after the ID's are exhausted. This is now fixed in wxPython 4.0.3 via wx.NewIdRef function. Thus use this function to keep an eye on panel ID's, used for announcing new categories as they become visible in multi-category NVDA Settings screen.
@josephsl

Copy link
Copy Markdown
Contributor Author

Hi,

Hopefully this should close another chapter in our saga in wxPython 4 migration. Testing shows the wrap-around bug is gone, but a broad validation might be needed once this Phoenix takes flight aboard master branch. Thanks.

@josephsl

Copy link
Copy Markdown
Contributor Author

Hi,

By the way, for @feerrenrut: unit tests and Robot framework tests passes with wxPython 4 - no changes whatsoever on my computer. Thanks.

@michaelDCurran

Copy link
Copy Markdown
Member

Happy for me to merge this now @josephsl?

@josephsl

josephsl commented Jul 18, 2018 via email

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.