-
Notifications
You must be signed in to change notification settings - Fork 203
Update Help and About Windows #2141
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
Conversation
* Use native web browser to display Help * Use `wxHtmlWindow` to display version information regardless of platform
sjanzou
left a comment
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.
src/main.cpp
Outdated
| #else | ||
| #include <wx/html/htmlwin.h> // for linux - avoid webkitgtk dependencies | ||
| #endif | ||
| //#if defined(__WXMSW__)||defined(__WXOSX__) |
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.
Go ahead and remove theses since everything functions much better now!
| url += "?" + context + ".html"; | ||
| CreateAboutHtml(); | ||
|
|
||
| #ifdef __WXMSW__ |
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.
Thanks for adding!

Goes with https://github.com/NREL/SAM-private/pull/139
This PR is in preparation for migrating to open source Help generation tools (currently in progress, see https://github.com/NREL/SAM/tree/help-to-sphinx).
In this PR:
HelpWinclass is used to display "About SAM" information only. It uses wxHtmlWindow for all platforms. Note that wxHtmlWindow can only display a subset of HTML, so About SAM text must use only basic HTML. Alternative wxWebView has full-featured HTML display capability, but requires special handling for Windows that we want to avoid: https://docs.wxwidgets.org/3.2/classwx_web_view.html.Help HTML files are displayed using
wxLaunchDefaultBrowseron all platforms. This displays Help on computer's default web browser.Pros and Cons
Pros:
HelpWinin main.cpp instead of different versions in main_add.h for SAM and SAM-private is easier to maintain.Cons:
To Test
I have tested on Windows 11, macOS Tahoe 26.1 on M1 chip, and Linux Mint 21.1 Cinnamon on Intel.