Skip to content

Conversation

@cpaulgilman
Copy link
Collaborator

@cpaulgilman cpaulgilman commented Dec 12, 2025

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:

  • HelpWin class 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 wxLaunchDefaultBrowser on all platforms. This displays Help on computer's default web browser.

Pros and Cons

Pros:

  • Implementation and behavior is consistent across Windows, Mac, Linux and for official and open source builds of SAM.
  • Single implementation of HelpWin in main.cpp instead of different versions in main_add.h for SAM and SAM-private is easier to maintain.
  • No platform-specific code to display Help.
  • New Sphinx-generated Help should be displayed correctly on all platforms, assuming SAM is installed on computer with modern browser set as default.

Cons:

  • Help opens HTML in new web browser tab/window each time user clicks Help button/F1 instead of displaying it in same window.
  • Help display depends on computer's default browser setting that we can't control.

To Test

I have tested on Windows 11, macOS Tahoe 26.1 on M1 chip, and Linux Mint 21.1 Cinnamon on Intel.

  1. Start SAM.
  2. On Welcome page, click Help contents. Help should open in web browser.
  3. Click About. About SAM window should open displaying either official or open source information.
  4. In About SAM window, click Open NLR release notes.... Web browser should open with SAM release notes.
  5. Create a case and go to any input page.
  6. Click Help or press F1 key. Help topic should display in Web browser. Note that for Mac, context help no longer works so Help displays Introduction topic. This will be fixed in separate PR with new Help implementation.
  7. Click About. About SAM window should open.
  8. In About SAM window, click Open NLR release notes.... Web browser should open with SAM release notes.

@cpaulgilman cpaulgilman added the UI User interface issue that applies across performance and financial models label Dec 12, 2025
@cpaulgilman cpaulgilman added this to the SAM Fall 2025 Release milestone Dec 12, 2025
@cpaulgilman cpaulgilman self-assigned this Dec 12, 2025
Copy link
Collaborator

@sjanzou sjanzou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything functions well and looks great...

Not sure where name changes go (URLs seem beyond SAM) but some to the disclaimer text and the copyright notices will need to be updated somewhere and sometime

Image

src/main.cpp Outdated
#else
#include <wx/html/htmlwin.h> // for linux - avoid webkitgtk dependencies
#endif
//#if defined(__WXMSW__)||defined(__WXOSX__)
Copy link
Collaborator

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__
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding!

@cpaulgilman cpaulgilman merged commit 099b283 into develop Dec 15, 2025
8 checks passed
@cpaulgilman cpaulgilman deleted the help-about branch December 15, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI User interface issue that applies across performance and financial models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants