New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the gui.messageBox API #13007
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I think this is unrelated as these controls don't use |
This comment was marked as duplicate.
This comment was marked as duplicate.
…essageBoxActive (#13376) Relates to #13007, as the new design should be backwards compatible, we can implement the API changes as-is for 2022.1. Follow up to the API proposed in #12984 Summary of the issue: The API for gui.message had not yet been determined for 2022.1, as per #13007. As the future API is intended to be backwards compatible, this PR commits to the API proposed in #12984. Description of how this pull request fixes the issue: gui.IsInMessageBox was a boolean, this has been replaced by a function gui.message.isModalMessageBoxActive, which tracks if a messageBox is open in a safer manner. Changes logic gui/message.py to be safer with locking and handling errors.
We have similar functions in NVDA that should be assimilated into a final design:
|
Ensure that the test It was tagged with I've added this to the description. |
See also: #12344, #12353, #10799, #8709, #13579
Current problems:
wx.OK or wx.CANCEL
as an option cannot be closed withAlt+F4/Escape
Quits from keyboard with about dialog open
is re-enabled and works. Tagged with# Excluded to be fixed still (#12976)
, however that issue is closed.Requirements for the API
A developer should be able to:
wx.CANCEL
is provided, make the dialog close-able with alt+F4 and escapewx.CANCEL
is provided, perform this action when dialogs are forced to close.Constraints from wxPython
Support across
wx.MessageBox
,wx.MessageDialog
andwx.Dialog
for the following:wx.CANCEL
is an option for thewx.MessageBox/wx.MessageDialog
. If Yes/No is required, we should not accept alt+F4 and escapewx.CANCEL
should replacewx.NO
and the buttons should be renamed appropriatelywx.Dialog
orwx.MessageDialog
is required to add the following:wx.MessageBox
is a function that doesn't support this.Using
wx.MessageDialog
directly also can implement this.wx.Dialog
with.Show
is required to add the following :wx.Dialog.ShowModal
is blocking, so.Show
must be used.wx.MessageBox
andwx.MessageDialog
doesn't support.Show()
, butwx.Dialog
does.Suggestions moving forward:
In 2022.1:
gui.IsInMessageBox
was a boolean, this has been replaced by a functiongui.message.isModalMessageBoxActive
, which tracks if a messageBox is open in a safer manner. Done in Replace boolean gui.IsInMessageBox with function gui.message.isModalMessageBoxActive #13376 .In a future release
gui.MessageDialog
class, encourage migration to using it instead ofgui.messageBox
.gui.messageDialog
should not subclasswx.MessageDialog
, and instead be a customwx.Dialog
subclassShow
andShowModal
to track instances to track inIsInMessageBox
wx.CANCEL
should be replaced withwx.NO
to enable esc/alt+f4, with the buttons renamedReference documentation
Additional context
Fix up #12984
#12976
Draft Sample API
The text was updated successfully, but these errors were encountered: