Audacity 3.2.0
HelpSystem.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 HelpSystem.cpp
6
7 Jimmy Johnson
8 Leland Lucius
9 Richard Ash
10
11 was merged with LinkingHtmlWindow.h
12
13 Vaughan Johnson
14 Dominic Mazzoni
15
16 utility fn and
17 descendant of HtmlWindow that opens links in the user's
18 default browser
19
20*//********************************************************************/
21
22
23#include "HelpSystem.h"
24
25#include <wx/setup.h> // for wxUSE_* macros
26#include <wx/frame.h>
27#include <wx/icon.h>
28#include <wx/log.h>
29#include <wx/stattext.h>
30#include <wx/textctrl.h>
31#include <wx/html/htmlwin.h>
32#include <wx/settings.h>
33#include <wx/statusbr.h>
34#include <wx/regex.h>
35
36#include "FileNames.h"
37#include "AllThemeResources.h"
38#include "ShuttleGui.h"
39#include "Theme.h"
40#include "HelpText.h"
41#include "Prefs.h"
42#include "wxFileNameWrapper.h"
43
44#include "BasicUI.h"
45
46#ifdef USE_ALPHA_MANUAL
47const wxString HelpSystem::HelpHostname = wxT("alphamanual.audacityteam.org");
48const wxString HelpSystem::HelpServerHomeDir = wxT("/man/");
49const wxString HelpSystem::HelpServerManDir = wxT("/man/");
50#else
51const wxString HelpSystem::HelpHostname = wxT("manual.audacityteam.org");
52const wxString HelpSystem::HelpServerHomeDir = wxT("/");
53const wxString HelpSystem::HelpServerManDir = wxT("/man/");
54#endif
55const wxString HelpSystem::LocalHelpManDir = wxT("/man/");
56
57namespace {
58
59// Helper class to make browser "simulate" a modal dialog
61{
62public:
63 HtmlTextHelpDialog(wxWindow *pParent, const TranslatableString &title)
64 : BrowserDialog{ pParent, title }
65 {
66#if !wxCHECK_VERSION(3, 0, 0)
67 MakeModal( true );
68#endif
69 }
71 {
72#if !wxCHECK_VERSION(3, 0, 0)
73 MakeModal( false );
74#endif
75 // On Windows, for some odd reason, the Audacity window will be sent to
76 // the back. So, make sure that doesn't happen.
77 GetParent()->Raise();
78 }
79};
80
81}
82
86void HelpSystem::ShowInfoDialog( wxWindow *parent,
87 const TranslatableString &dlogTitle,
88 const TranslatableString &shortMsg,
89 const wxString &message,
90 const int xSize, const int ySize)
91{
92 wxDialogWrapper dlog(parent, wxID_ANY,
93 dlogTitle,
94 wxDefaultPosition, wxDefaultSize,
95 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX /*| wxDEFAULT_FRAME_STYLE */);
96
97 dlog.SetName();
98 ShuttleGui S(&dlog, eIsCreating);
99
100 S.StartVerticalLay(1);
101 {
102 S.AddTitle( shortMsg );
103 S.Style( wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 |
104 wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL )
105 .AddTextWindow(message);
106
107 S.SetBorder( 0 );
108 S.StartHorizontalLay(wxALIGN_CENTER_HORIZONTAL, 0);
109 S.AddStandardButtons(eOkButton);
110 S.EndHorizontalLay();
111 }
112 S.EndVerticalLay();
113
114 // Smallest size is half default size. Seems reasonable.
115 dlog.SetMinSize( wxSize(xSize/2, ySize/2) );
116 dlog.SetSize( wxSize(xSize, ySize) );
117 dlog.Center();
118 dlog.ShowModal();
119}
120
121void HelpSystem::ShowHtmlText(wxWindow *pParent,
122 const TranslatableString &Title,
123 const wxString &HtmlText,
124 bool bIsFile,
125 bool bModal)
126{
127 LinkingHtmlWindow *html;
128
129 wxASSERT(pParent); // to justify safenew
130 // JKC: ANSWER-ME: Why do we create a fake 'frame' and then put a BrowserDialog
131 // inside it, rather than have a variant of the BrowserDialog that is a
132 // frame??
133 // Bug 1412 seems to be related to the extra frame.
134 auto pFrame = safenew wxFrame {
135 pParent, wxID_ANY, Title.Translation(), wxDefaultPosition, wxDefaultSize,
136#if defined(__WXMAC__)
137 // On OSX, the html frame can go behind the help dialog and if the help
138 // html frame is modal, you can't get back to it. Pressing escape gets
139 // you out of this, but it's just easier to add the wxSTAY_ON_TOP flag
140 // to prevent it from falling behind the dialog. Not the perfect solution
141 // but acceptable in this case.
142 wxSTAY_ON_TOP |
143#endif
144 wxDEFAULT_FRAME_STYLE
145 };
146
147 BrowserDialog * pWnd;
148 if( bModal )
149 pWnd = safenew HtmlTextHelpDialog{ pFrame, Title };
150 else
151 pWnd = safenew BrowserDialog{ pFrame, Title };
152
153 // Bug 1412 workaround for 'extra window'. Hide the 'fake' window.
154 pFrame->SetTransparent(0);
155 ShuttleGui S( pWnd, eIsCreating );
156
157 S.Style( wxNO_BORDER | wxTAB_TRAVERSAL )
158 .Prop(true)
159 .StartPanel();
160 {
161 S.StartHorizontalLay( wxEXPAND, false );
162 {
163 S.Id( wxID_BACKWARD )
164 .Disable()
165#if wxUSE_TOOLTIPS
166 .ToolTip( XO("Backwards" ) )
167#endif
168 /* i18n-hint arrowhead meaning backward movement */
169 .AddButton( XXO("<") );
170 S.Id( wxID_FORWARD )
171 .Disable()
172#if wxUSE_TOOLTIPS
173 .ToolTip( XO("Forwards" ) )
174#endif
175 /* i18n-hint arrowhead meaning forward movement */
176 .AddButton( XXO(">") );
177 }
178 S.EndHorizontalLay();
179
180 html = safenew LinkingHtmlWindow(S.GetParent(), wxID_ANY,
181 wxDefaultPosition,
182 bIsFile ? wxSize(500, 400) : wxSize(480, 240),
183 wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER);
184
185 html->SetRelatedFrame( pFrame, wxT("Help: %s") );
186 if( bIsFile )
187 html->LoadFile( HtmlText );
188 else
189 html->SetPage( HtmlText);
190
191 S.Prop(1).Focus().Position( wxEXPAND )
192 .AddWindow( html );
193
194 S.Id( wxID_CANCEL ).AddButton( XXO("Close"), wxALIGN_CENTER, true );
195 }
196 S.EndPanel();
197
198 // -- START of ICON stuff -----
199 // If this section (providing an icon) causes compilation errors on linux, comment it out for now.
200 // it will just mean that the icon is missing. Works OK on Windows.
201 #ifdef __WXMSW__
202 wxIcon ic{ wxICON(AudacityLogo) };
203 #else
204 wxIcon ic{};
205 ic.CopyFromBitmap(theTheme.Bitmap(bmpAudacityLogo48x48));
206 #endif
207 pFrame->SetIcon( ic );
208 // -- END of ICON stuff -----
209
210
211 pWnd->mpHtml = html;
212 pWnd->SetBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
213
214 pFrame->CreateStatusBar();
215 pFrame->Centre();
216 pFrame->Layout();
217 pFrame->SetSizeHints(pWnd->GetSize());
218
219 pFrame->SetName(Title.Translation());
220 if (bModal)
221 pWnd->ShowModal();
222 else {
223 pWnd->Show(true);
224 pFrame->Show(true);
225 }
226
227 html->SetRelatedStatusBar( 0 );
228
229 return;
230}
231
232// Shows help in browser, or possibly in own dialog.
233void HelpSystem::ShowHelp(wxWindow *parent,
234 const FilePath &localFileName,
235 const URLString &remoteURL,
236 bool bModal,
237 bool alwaysDefaultBrowser)
238{
239 wxASSERT(parent); // to justify safenew
240 wxString HelpMode = wxT("Local");
241
242// DA: Default for DA is manual from internet.
243#ifdef EXPERIMENTAL_DA
244 gPrefs->Read(wxT("/GUI/Help"), &HelpMode, {"FromInternet"} );
245#else
246 gPrefs->Read(wxT("/GUI/Help"), &HelpMode, {"Local"} );
247#endif
248
249 {
250 // these next lines are for legacy cfg files (pre 2.0) where we had different modes
251 if( (HelpMode == wxT("Standard")) || (HelpMode == wxT("InBrowser")) )
252 {
253 HelpMode = GUIManualLocation.Default().Internal();
254 GUIManualLocation.Write(HelpMode);
255 gPrefs->Flush();
256 }
257 }
258
259 // Anchors (URLs with a '#' in them) are not supported by many OSs for local file names
260 // See, for example, https://groups.google.com/forum/#!topic/wx-users/pC0uOZJalRQ
261 // Problems have been reported on Win, Mac and some versions of Linux.
262 // So we set HelpMode to use the internet if an anchor is found.
263 if (localFileName.Find('#', true) != wxNOT_FOUND)
264 HelpMode = wxT("FromInternet");
265 // Until a solution is found for this, the next few lines are irrelevant.
266
267 // Obtain the local file system file name, without the anchor if present.
268 wxString localfile;
269 if (localFileName.Find('#', true) != wxNOT_FOUND)
270 localfile = localFileName.BeforeLast('#');
271 else
272 localfile = localFileName;
273
274 if( (HelpMode == wxT("FromInternet")) && !remoteURL.empty() )
275 {
276 // Always go to remote URL. Use External browser.
277 OpenInDefaultBrowser( remoteURL );
278 }
279 else if( localfile.empty() || !wxFileExists( localfile ))
280 {
281 if (remoteURL.empty())
282 {
283 // If you give an empty remote URL, you should have already ensured
284 // that the file exists!
285 wxASSERT(!remoteURL.empty());
286 // I can't find it'.
287 // Use Built-in browser to suggest you use the remote url.
288 wxString Text = HelpText(wxT("remotehelp"));
289 Text.Replace(wxT("*URL*"), remoteURL.GET());
290 // Always make the 'help on the internet' dialog modal.
291 // Fixes Bug 1411.
292 ShowHtmlText(parent, XO("Help on the Internet"), Text, false, true);
293 }
294 else
295 {
296 // Use External browser to go to remote URL.
297 OpenInDefaultBrowser(remoteURL);
298 }
299 }
300 else if( HelpMode == wxT("Local") || alwaysDefaultBrowser)
301 {
302 // Local file, External browser
303 OpenInDefaultBrowser( L"file:" + localFileName );
304 }
305 else
306 {
307 // Local file, Built-in browser
308 ShowHtmlText( parent, {}, localFileName, true, bModal );
309 }
310}
311
312void HelpSystem::ShowHelp(wxWindow *parent,
313 const ManualPageID &PageName,
314 bool bModal)
315{
318 const wxString ReleaseSuffix = L".html";
319
320 FilePath localHelpPage;
321 wxString webHelpPath;
322 wxString webHelpPage;
323 wxString releasePageName;
324 wxString anchor; // optional part of URL after (and including) the '#'
325 const auto &PageNameStr = PageName.GET();
326 if (PageNameStr.Find('#', true) != wxNOT_FOUND)
327 { // need to split anchor off into separate variable
328 releasePageName = PageNameStr.BeforeLast('#');
329 anchor = wxT("#") + PageNameStr.AfterLast('#');
330 }
331 else
332 {
333 releasePageName = PageName.GET();
334 anchor = wxT("");
335 }
336 // The wiki pages are transformed to static HTML by
337 // scripts/mw2html_audacity/mw2html.py
338 // The name is first transformed to lower case, then all
339 // 'special characters' are replaced by underscores. Spaces are
340 // transformed to "+".
341 //
342 // The transformations are handled in mw2html by first applying
343 // 'urllib.parse.quote_plus' (escape chars that are not in "always safe" list)
344 // then replacing escape characters (%xx) with underscores,
345 // and finally removing duplicate / redundant underscores.
346 //
347 // The front page and 'quick_help' are treated as special cases and placed in
348 // the root of the help directory rather than the "/man/" sub-directory.
349 if (releasePageName == L"Main_Page")
350 {
351 releasePageName = L"index" + ReleaseSuffix + anchor;
352 localHelpPage = wxFileName(FileNames::HtmlHelpDir(), releasePageName).GetFullPath();
353 webHelpPath = L"https://" + HelpSystem::HelpHostname + HelpSystem::HelpServerHomeDir;
354 }
355 else if (releasePageName == L"Quick_Help")
356 {
357// DA: No bundled help, by default, and different quick-help URL.
358#ifdef EXPERIMENTAL_DA
359 releasePageName = L"video" + ReleaseSuffix + anchor;
360 localHelpPage = wxFileName(FileNames::HtmlHelpDir(), releasePageName).GetFullPath();
361 webHelpPath = L"http://www.darkaudacity.com/";
362#else
363 releasePageName = L"quick_help" + ReleaseSuffix + anchor;
364 localHelpPage = wxFileName(FileNames::HtmlHelpDir(), releasePageName).GetFullPath();
365 webHelpPath = L"https://" + HelpSystem::HelpHostname + HelpSystem::HelpServerHomeDir;
366#endif
367 }
368 // not a page name, but rather a full path (e.g. to wiki)
369 // in which case do not do any substitutions.
370 else if (releasePageName.StartsWith( "http" ) )
371 {
372 localHelpPage = "";
373 releasePageName += anchor;
374 // webHelpPath remains empty
375 }
376 else
377 {
378 // Handle all other pages.
379 // Change to lower case.
380 releasePageName = releasePageName.Lower();
381 wxRegEx re;
382 // replace 'special characters' with underscores.
383 // RFC 2396 defines the characters a-z, A-Z, 0-9 and ".-_" as "always safe"
384 // mw2html also replaces "-" with "_" so replace that too.
385
386 // If PageName contains a %xx code, mw2html will transform it:
387 // '%xx' => '%25xx' => '_'
388 re.Compile(wxT("%.."));
389 re.ReplaceAll(&releasePageName, (wxT("_")));
390 // Now replace all other 'not-safe' characters.
391 re.Compile(wxT("[^[:alnum:] . [:space:]]"));
392 re.ReplaceAll(&releasePageName, (wxT("_")));
393 // Replace spaces with "+"
394 releasePageName.Replace(wxT(" "), wxT("+"), true);
395 // Reduce multiple underscores to single underscores
396 re.Compile(wxT("__+"));
397 re.ReplaceAll(&releasePageName, (wxT("_")));
398 // Replace "_." with "."
399 releasePageName.Replace(wxT("_."), wxT("."), true);
400 // Concatenate file name with file extension and anchor.
401 releasePageName = releasePageName + ReleaseSuffix + anchor;
402 // Other than index and quick_help, all local pages are in subdirectory 'LocalHelpManDir'.
403 localHelpPage = wxFileName(FileNames::HtmlHelpDir() + LocalHelpManDir, releasePageName).GetFullPath();
404 // Other than index and quick_help, all on-line pages are in subdirectory 'HelpServerManDir'.
405 webHelpPath = L"https://" + HelpSystem::HelpHostname + HelpSystem::HelpServerManDir;
406 }
407
408#ifdef USE_ALPHA_MANUAL
409 webHelpPage = webHelpPath + PageName.GET();
410#else
411 webHelpPage = webHelpPath + releasePageName;
412#endif
413
414 wxLogMessage(wxT("Help button pressed: PageName %s, releasePageName %s"),
415 PageName.GET(), releasePageName);
416 wxLogMessage(wxT("webHelpPage %s, localHelpPage %s"),
417 webHelpPage, localHelpPage);
418
419 wxASSERT(parent); // to justify safenew
420
422 parent,
423 localHelpPage,
424 webHelpPage,
425 bModal
426 );
427}
428
429// For compilers that support precompilation, includes "wx/wx.h".
430#include <wx/wxprec.h>
431
432#include <wx/mimetype.h>
433#include <wx/filename.h>
434#include <wx/uri.h>
435
436BEGIN_EVENT_TABLE(BrowserDialog, wxDialogWrapper)
440 EVT_KEY_DOWN(BrowserDialog::OnKeyDown)
442
443
445 : wxDialogWrapper{ pParent, ID, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER /*| wxMAXIMIZE_BOX */ }
446{
447 int width, height;
448 const int minWidth = 400;
449 const int minHeight = 250;
450
451 gPrefs->Read(wxT("/GUI/BrowserWidth"), &width, minWidth);
452 gPrefs->Read(wxT("/GUI/BrowserHeight"), &height, minHeight);
453
454 if (width < minWidth || width > wxSystemSettings::GetMetric(wxSYS_SCREEN_X))
455 width = minWidth;
456 if (height < minHeight || height > wxSystemSettings::GetMetric(wxSYS_SCREEN_Y))
457 height = minHeight;
458
459 SetMinSize(wxSize(minWidth, minHeight));
460 SetSize(wxDefaultPosition.x, wxDefaultPosition.y, width, height, wxSIZE_AUTO);
461}
462
463void BrowserDialog::OnForward(wxCommandEvent & WXUNUSED(event))
464{
465 mpHtml->HistoryForward();
467}
468
469void BrowserDialog::OnBackward(wxCommandEvent & WXUNUSED(event))
470{
471 mpHtml->HistoryBack();
473}
474
475void BrowserDialog::OnClose(wxCommandEvent & WXUNUSED(event))
476{
477 if (IsModal() && !mDismissed)
478 {
479 mDismissed = true;
480 EndModal(wxID_CANCEL);
481 }
482 auto parent = GetParent();
483
484 gPrefs->Write(wxT("/GUI/BrowserWidth"), GetSize().GetX());
485 gPrefs->Write(wxT("/GUI/BrowserHeight"), GetSize().GetY());
486 gPrefs->Flush();
487
488#ifdef __WXMAC__
489 auto grandparent = GetParent()->GetParent();
490#endif
491
492 parent->Destroy();
493
494#ifdef __WXMAC__
495 if(grandparent && grandparent->IsShown()) {
496 grandparent->Raise();
497 }
498#endif
499}
500
501void BrowserDialog::OnKeyDown(wxKeyEvent & event)
502{
503 bool bSkip = true;
504 if (event.GetKeyCode() == WXK_ESCAPE)
505 {
506 bSkip = false;
507 Close(false);
508 }
509 event.Skip(bSkip);
510}
511
512
514{
515 wxWindow * pWnd;
516 if( (pWnd = FindWindowById( wxID_BACKWARD, this )) != NULL )
517 {
518 pWnd->Enable(mpHtml->HistoryCanBack());
519 }
520 if( (pWnd = FindWindowById( wxID_FORWARD, this )) != NULL )
521 {
522 pWnd->Enable(mpHtml->HistoryCanForward());
523 }
524}
525
527{
528 wxURI uri(link.GET());
529 BasicUI::OpenInDefaultBrowser(uri.BuildURI());
530}
531
532LinkingHtmlWindow::LinkingHtmlWindow(wxWindow *parent, wxWindowID id /*= -1*/,
533 const wxPoint& pos /*= wxDefaultPosition*/,
534 const wxSize& size /*= wxDefaultSize*/,
535 long style /*= wxHW_SCROLLBAR_AUTO*/) :
536 HtmlWindow(parent, id, pos, size, style)
537{
538}
539
540void LinkingHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
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}
589
591 wxT("/GUI/Help"),
592 {
593 ByColumns,
594 { XO("Local") , XO("From Internet") , },
595 { wxT("Local") , wxT("FromInternet") , }
596 },
597 1 // "FromInternet"
598};
599
wxT("CloseDown"))
Toolkit-neutral facade for basic user interface services.
END_EVENT_TABLE()
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
void OpenInDefaultBrowser(const URLString &link)
Definition: HelpSystem.cpp:526
ChoiceSetting GUIManualLocation
Definition: HelpSystem.cpp:590
TranslatableString TitleText(const wxString &Key)
Definition: HelpText.cpp:135
wxString HelpText(const wxString &Key)
Definition: HelpText.cpp:315
#define safenew
Definition: MemoryX.h:10
static const auto title
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
ByColumns_t ByColumns
Definition: Prefs.cpp:489
wxString FilePath
Definition: Project.h:21
@ eIsCreating
Definition: ShuttleGui.h:37
@ eOkButton
Definition: ShuttleGui.h:599
THEME_API Theme theTheme
Definition: Theme.cpp:82
#define S(N)
Definition: ToChars.cpp:64
int id
Adds some event handling to an HtmlWindow.
Definition: HelpSystem.h:140
void UpdateButtons()
Definition: HelpSystem.cpp:513
void OnClose(wxCommandEvent &event)
Definition: HelpSystem.cpp:475
void OnKeyDown(wxKeyEvent &event)
Definition: HelpSystem.cpp:501
void OnBackward(wxCommandEvent &event)
Definition: HelpSystem.cpp:469
HtmlWindow * mpHtml
Definition: HelpSystem.h:154
void OnForward(wxCommandEvent &event)
Definition: HelpSystem.cpp:463
bool Write(const wxString &value)
Definition: Prefs.cpp:405
const EnumValueSymbol & Default() const
Definition: Prefs.cpp:361
const wxString & Internal() const
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:233
static const wxString LocalHelpManDir
Definition: HelpSystem.h:111
static void ShowInfoDialog(wxWindow *parent, const TranslatableString &dlogTitle, const TranslatableString &shortMsg, const wxString &message, const int xSize, const int ySize)
Displays cuttable information in a text ctrl, with an OK button.
Definition: HelpSystem.cpp:86
static const wxString HelpHostname
Definition: HelpSystem.h:96
static const wxString HelpServerHomeDir
Definition: HelpSystem.h:101
static const wxString HelpServerManDir
Definition: HelpSystem.h:106
static void ShowHtmlText(wxWindow *pParent, const TranslatableString &Title, const wxString &HtmlText, bool bIsFile=false, bool bModal=false)
Definition: HelpSystem.cpp:121
HtmlWindow Class.
Definition: HtmlWindow.h:37
bool empty() const
Definition: Identifier.h:61
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
An HtmlWindow that handles linked clicked - usually the link will go to our own local copy of the man...
Definition: HelpSystem.h:126
LinkingHtmlWindow(wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHW_SCROLLBAR_AUTO)
Definition: HelpSystem.cpp:532
void OnLinkClicked(const wxHtmlLinkInfo &link) override
Definition: HelpSystem.cpp:540
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:630
Template generates different TaggedIdentifier classes that don't interconvert implicitly.
Definition: Identifier.h:113
wxBitmap & Bitmap(int iIndex)
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
HtmlTextHelpDialog(wxWindow *pParent, const TranslatableString &title)
Definition: HelpSystem.cpp:63
virtual bool Flush() noexcept=0
virtual bool Write(const wxString &key, bool value)=0
virtual bool Read(const wxString &key, bool *value) const =0
void SetName(const TranslatableString &title)
bool OpenInDefaultBrowser(const wxString &url)
Open an URL in default browser.
Definition: BasicUI.cpp:240
FILES_API FilePath HtmlHelpDir()