Audacity 3.2.0
Public Member Functions | List of all members
LinkingHtmlWindow Class Referencefinal

An HtmlWindow that handles linked clicked - usually the link will go to our own local copy of the manual, but it could launch a new browser window. More...

#include <HelpSystem.h>

Inheritance diagram for LinkingHtmlWindow:
[legend]
Collaboration diagram for LinkingHtmlWindow:
[legend]

Public Member Functions

 LinkingHtmlWindow (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHW_SCROLLBAR_AUTO)
 
void OnLinkClicked (const wxHtmlLinkInfo &link) override
 
- Public Member Functions inherited from HtmlWindow
 HtmlWindow (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHW_DEFAULT_STYLE, const wxString &name=wxT("htmlWindow"))
 Methods for HtmlWindow. More...
 
virtual ~HtmlWindow ()
 

Detailed Description

An HtmlWindow that handles linked clicked - usually the link will go to our own local copy of the manual, but it could launch a new browser window.

Definition at line 125 of file HelpSystem.h.

Constructor & Destructor Documentation

◆ LinkingHtmlWindow()

LinkingHtmlWindow::LinkingHtmlWindow ( wxWindow *  parent,
wxWindowID  id = -1,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxHW_SCROLLBAR_AUTO 
)

Definition at line 516 of file HelpSystem.cpp.

519 :
520 HtmlWindow(parent, id, pos, size, style)
521{
522}
HtmlWindow(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHW_DEFAULT_STYLE, const wxString &name=wxT("htmlWindow"))
Methods for HtmlWindow.
Definition: HtmlWindow.cpp:107

Member Function Documentation

◆ OnLinkClicked()

void LinkingHtmlWindow::OnLinkClicked ( const wxHtmlLinkInfo &  link)
override

Definition at line 524 of file HelpSystem.cpp.

525{
526 wxString href = link.GetHref();
527
528 if( href.StartsWith( wxT("innerlink:help:")))
529 {
530 HelpSystem::ShowHelp(this, ManualPageID{ href.Mid( 15 ) }, true );
531 return;
532 }
533 else if( href.StartsWith(wxT("innerlink:")) )
534 {
535 wxString FileName =
536 wxFileName( FileNames::HtmlHelpDir(), href.Mid( 10 ) + wxT(".htm") ).GetFullPath();
537 if( wxFileExists( FileName ) )
538 {
539 HelpSystem::ShowHelp(this, FileName, wxEmptyString, false);
540 return;
541 }
542 else
543 {
544 SetPage( HelpText( href.Mid( 10 )));
545 wxGetTopLevelParent(this)->SetLabel( TitleText( href.Mid( 10 )).Translation() );
546 }
547 }
548 else if( href.StartsWith(wxT("mailto:")) || href.StartsWith(wxT("file:")) )
549 {
550 OpenInDefaultBrowser( link.GetHref() );
551 return;
552 }
553 else if( !href.StartsWith( wxT("http:")) && !href.StartsWith( wxT("https:")) )
554 {
555 HtmlWindow::OnLinkClicked( link );
556 }
557 else
558 {
559 OpenInDefaultBrowser(link.GetHref());
560 return;
561 }
562 wxFrame * pFrame = GetRelatedFrame();
563 if( !pFrame )
564 return;
565 wxWindow * pWnd = pFrame->FindWindow(BrowserDialog::ID);
566 if( !pWnd )
567 return;
568 BrowserDialog * pDlg = wxDynamicCast( pWnd , BrowserDialog );
569 if( !pDlg )
570 return;
571 pDlg->UpdateButtons();
572}
wxT("CloseDown"))
void OpenInDefaultBrowser(const URLString &link)
Definition: HelpSystem.cpp:510
TranslatableString TitleText(const wxString &Key)
Definition: HelpText.cpp:127
wxString HelpText(const wxString &Key)
Definition: HelpText.cpp:238
Adds some event handling to an HtmlWindow.
Definition: HelpSystem.h:140
void UpdateButtons()
Definition: HelpSystem.cpp:497
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:231
wxString Translation() const
FILES_API FilePath HtmlHelpDir()

References HelpText(), FileNames::HtmlHelpDir(), BrowserDialog::ID, OpenInDefaultBrowser(), HelpSystem::ShowHelp(), TitleText(), TranslatableString::Translation(), BrowserDialog::UpdateButtons(), and wxT().

Here is the call graph for this function:

The documentation for this class was generated from the following files: