Skip to content

Conversation

osinjoku
Copy link
Contributor

@osinjoku osinjoku commented Sep 19, 2025

Description

This adds a convenience class for displaying message and input boxes.

Fixes #13

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document
  • My code follows the style guidelines of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly
  • I have added a note to CHANGELOG.md describing my changes
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

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.

@osinjoku osinjoku requested a review from Copilot September 19, 2025 06:56
Copy link

@Copilot Copilot AI left a 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.

@osinjoku osinjoku requested a review from Copilot September 19, 2025 07:13
Copy link

@Copilot Copilot AI left a 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.

@osinjoku osinjoku changed the title Feature/message box Add convenience message boxes and input dialogs via Win32 Sep 19, 2025
Comment on lines +5 to +7
omit =
src/moldflow/message_box.py
*/site-packages/moldflow/message_box.py
Copy link
Collaborator

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?

Copy link
Contributor Author

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>
Comment on lines +1 to +4
MessageBox
==========

Convenience wrapper to display message boxes and a simple
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

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.

[FEATURE] Add ability to show Win32 Message Boxes conveniently
3 participants