Audacity  3.0.3
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 528 of file HelpSystem.cpp.

531  :
532  HtmlWindow(parent, id, pos, size, style)
533 {
534 }

Member Function Documentation

◆ OnLinkClicked()

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

Definition at line 536 of file HelpSystem.cpp.

537 {
538  wxString href = link.GetHref();
539 
540  if( href.StartsWith( wxT("innerlink:help:")))
541  {
542  HelpSystem::ShowHelp(this, ManualPageID{ href.Mid( 15 ) }, true );
543  return;
544  }
545  else if( href.StartsWith(wxT("innerlink:")) )
546  {
547  wxString FileName =
548  wxFileName( FileNames::HtmlHelpDir(), href.Mid( 10 ) + wxT(".htm") ).GetFullPath();
549  if( wxFileExists( FileName ) )
550  {
551  HelpSystem::ShowHelp(this, FileName, wxEmptyString, false);
552  return;
553  }
554  else
555  {
556  SetPage( HelpText( href.Mid( 10 )));
557  wxGetTopLevelParent(this)->SetLabel( TitleText( href.Mid( 10 )).Translation() );
558  }
559  }
560  else if( href.StartsWith(wxT("mailto:")) || href.StartsWith(wxT("file:")) )
561  {
562  OpenInDefaultBrowser( link.GetHref() );
563  return;
564  }
565  else if( !href.StartsWith( wxT("http:")) && !href.StartsWith( wxT("https:")) )
566  {
567  HtmlWindow::OnLinkClicked( link );
568  }
569  else
570  {
571  OpenInDefaultBrowser(link.GetHref());
572  return;
573  }
574  wxFrame * pFrame = GetRelatedFrame();
575  if( !pFrame )
576  return;
577  wxWindow * pWnd = pFrame->FindWindow(BrowserDialog::ID);
578  if( !pWnd )
579  return;
580  BrowserDialog * pDlg = wxDynamicCast( pWnd , BrowserDialog );
581  if( !pDlg )
582  return;
583  pDlg->UpdateButtons();
584 }

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

Here is the call graph for this function:

The documentation for this class was generated from the following files:
size
size_t size
Definition: ffmpeg-2.3.6-single-header.h:412
BrowserDialog::UpdateButtons
void UpdateButtons()
Definition: HelpSystem.cpp:509
BrowserDialog::ID
@ ID
Definition: HelpSystem.h:142
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:237
HtmlWindow::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.
Definition: HtmlWindow.cpp:107
OpenInDefaultBrowser
void OpenInDefaultBrowser(const URLString &link)
Definition: HelpSystem.cpp:522
TaggedIdentifier< ManualPageIDTag >
FileNames::HtmlHelpDir
FILES_API FilePath HtmlHelpDir()
BrowserDialog
Adds some event handling to an HtmlWindow.
Definition: HelpSystem.h:140
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
HelpText
AUDACITY_DLL_API wxString HelpText(const wxString &Key)
TitleText
AUDACITY_DLL_API TranslatableString TitleText(const wxString &Key)