MCPcopy Create free account
hub / github.com/audacity/audacity / OnLinkClicked

Method OnLinkClicked

libraries/lib-wx-init/HelpSystem.cpp:531–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

HelpTextFunction · 0.85
TitleTextFunction · 0.85
TranslationMethod · 0.80
OpenInDefaultBrowserFunction · 0.70
wxFileNameClass · 0.50
SetLabelMethod · 0.45
UpdateButtonsMethod · 0.45

Tested by

no test coverage detected