-
Notifications
You must be signed in to change notification settings - Fork 1
Add convenience message boxes and input dialogs via Win32 #15
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a comprehensive MessageBox convenience class for displaying message and input boxes in Moldflow scripts. The implementation provides standard Windows message boxes using Win32 APIs and includes a custom input dialog with validation capabilities.
Key changes:
- New MessageBox class with support for standard dialogs (info, warning, error, confirmation) and text input
- Comprehensive Win32 API integration with proper error handling and modal dialog management
- Internationalization support for button labels across multiple locales
- Extensive integration tests using UI automation to validate all message box permutations
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/moldflow/message_box.py |
Core MessageBox implementation with Win32 integration and custom input dialog |
tests/api/integration_tests/test_message_box_permutations.py |
Integration tests with automated UI interaction for comprehensive coverage |
src/moldflow/__init__.py |
Exports MessageBox classes and types for public API |
docs/source/components/wrapper/message_box.rst |
User documentation with examples and API reference |
Multiple locale files | Translations for "OK", "Cancel", and "Submit" button labels |
scripts/check_localization.py |
Updates to handle locale-invariant strings like "OK" |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
omit = | ||
src/moldflow/message_box.py | ||
*/site-packages/moldflow/message_box.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we don't have unit tests for the message_box module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not worth it with the heavy use of the Win32 API. The integration cover the cases quite well.
Co-authored-by: Sankalp Shrivastava <sankalp.adsk.github@gmail.com>
MessageBox | ||
========== | ||
|
||
Convenience wrapper to display message boxes and a simple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use the automodule like the other files or is there some custom content added to this page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
automodule is there in the API section. I have added extra docs to help the user.
Description
This adds a convenience class for displaying message and input boxes.
Fixes #13
Type of change
Please delete options that are not relevant.
Checklist
Please delete options that are not relevant.
Testing
Manual run of new integration tests.
Additional Notes
For the input box, the integration tests show access violations but these do not show when running outside the test environment.