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 532 of file HelpSystem.cpp.

535 :
536 HtmlWindow(parent, id, pos, size, style)
537{
538}
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 540 of file HelpSystem.cpp.

541{
542 wxString href = link.GetHref();
543
544 if( href.StartsWith( wxT("innerlink:help:")))
545 {
546 HelpSystem::ShowHelp(this, ManualPageID{ href.Mid( 15 ) }, true );
547 return;
548 }
549 else if( href.StartsWith(wxT("innerlink:")) )
550 {
551 wxString FileName =
552 wxFileName( FileNames::HtmlHelpDir(), href.Mid( 10 ) + wxT(".htm") ).GetFullPath();
553 if( wxFileExists( FileName ) )
554 {
555 HelpSystem::ShowHelp(this, FileName, wxEmptyString, false);
556 return;
557 }
558 else
559 {
560 SetPage( HelpText( href.Mid( 10 )));
561 wxGetTopLevelParent(this)->SetLabel( TitleText( href.Mid( 10 )).Translation() );
562 }
563 }
564 else if( href.StartsWith(wxT("mailto:")) || href.StartsWith(wxT("file:")) )
565 {
566 OpenInDefaultBrowser( link.GetHref() );
567 return;
568 }
569 else if( !href.StartsWith( wxT("http:")) && !href.StartsWith( wxT("https:")) )
570 {
571 HtmlWindow::OnLinkClicked( link );
572 }
573 else
574 {
575 OpenInDefaultBrowser(link.GetHref());
576 return;
577 }
578 wxFrame * pFrame = GetRelatedFrame();
579 if( !pFrame )
580 return;
581 wxWindow * pWnd = pFrame->FindWindow(BrowserDialog::ID);
582 if( !pWnd )
583 return;
584 BrowserDialog * pDlg = wxDynamicCast( pWnd , BrowserDialog );
585 if( !pDlg )
586 return;
587 pDlg->UpdateButtons();
588}
wxT("CloseDown"))
void OpenInDefaultBrowser(const URLString &link)
Definition: HelpSystem.cpp:526
TranslatableString TitleText(const wxString &Key)
Definition: HelpText.cpp:135
wxString HelpText(const wxString &Key)
Definition: HelpText.cpp:315
Adds some event handling to an HtmlWindow.
Definition: HelpSystem.h:140
void UpdateButtons()
Definition: HelpSystem.cpp:513
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:233
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: