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

Method ShowHtmlText

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

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 15

TranslationMethod · 0.80
StartPanelMethod · 0.80
DisableMethod · 0.80
LoadFileMethod · 0.80
AddWindowMethod · 0.80
PositionMethod · 0.80
EndPanelMethod · 0.80
SetIconMethod · 0.80
SetBackgroundColourMethod · 0.80
wxSizeClass · 0.50
AddButtonMethod · 0.45
GetParentMethod · 0.45

Tested by

no test coverage detected