Page 1 of 1
Help button for dialogs
Posted: Tue May 14, 2013 6:19 am
by Edgar
Over the years we have discussed adding an "Help" button to some of the dialogues - most recently the Effects dialogs. At first I lobbied for a Windows-centric "round blue button with a white question mark" in the top right-hand corner of the window. I even floated a proof of concept patch which referenced the local hard drive-based manual if available and otherwise use the online manual. Having gotten no traction with that lead balloon I thought I would explore Martyn's suggestion on – devel. To try this at home change one line in srceffectsEffect.cpp at (or near) line number 569:
becomes:
Code: Select all
long buttons = eHelpButton | eOkButton;
Recompile, start Audacity, exercise any Effect with a dialog (e.g. the Noise generator).

- help.png (23.94 KiB) Viewed 2576 times
Obviously, there is no handler for the Help button but it should not be too hard to write and I would be glad to help out.
Re: Help button for dialogs
Posted: Tue May 14, 2013 1:42 pm
by steve
Edgar wrote:Obviously, there is no handler for the Help button but it should not be too hard to write and I would be glad to help out.
I'll take you up on that offer Edgar
Yesterday I added a Help button to the Nyquist Prompt effect. I think this would be a good place to start as it does not interfere with other effects. If/when it is agreed that it is working correctly, the same method could be rolled out for other built-in effects.
If we don't want a help button for all built-in effects (but perhaps we do), a help button can be added to individual effects like this:
Code: Select all
Index: src/effects/BassTreble.cpp
===================================================================
--- src/effects/BassTreble.cpp (revision 12324)
+++ src/effects/BassTreble.cpp (working copy)
@@ -281,7 +281,7 @@
BassTrebleDialog::BassTrebleDialog(EffectBassTreble *effect,
wxWindow * parent):
- EffectDialog(parent, _("Bass and Treble"), PROCESS_EFFECT),
+ EffectDialog(parent, _("Bass and Treble"), PROCESS_EFFECT, wxDEFAULT_DIALOG_STYLE, eHelpButton), // stf
mEffect(effect)
{
Init();
Here is where I've got to so far with adding a help button to the Nyquist Prompt:
Re: Help button for dialogs
Posted: Tue May 14, 2013 3:37 pm
by steve
OK, got a bit further.
Does this work on Windows?
Re: Help button for dialogs
Posted: Tue May 14, 2013 4:31 pm
by steve
And a bit more:
Code: Select all
void BassTrebleDialog::OnHelp(wxCommandEvent & /* event */)
{
AudacityProject * pProj = GetActiveProject();
wxString HelpMode = pProj->mHelpPref;
wxString page = FileNames::HtmlHelpDir() + wxT("man/bass_and_treble.html");
if ((wxFileExists(page)) && (HelpMode == wxT("Local"))) {
page = wxT("file://") + page;
} else {
page = wxT("http://manual.audacityteam.org/o/man/bass_and_treble.html");
}
OpenInDefaultBrowser(page);
}
Would it be better to move this to ErrorDialog.cpp along with void ShowHelpDialog ?
Re: Help button for dialogs
Posted: Tue May 14, 2013 4:39 pm
by steve
And a patch for adding Help buttons to "Nyquist Prompt" and "Bass & Treble".
Re: Help button for dialogs
Posted: Tue May 14, 2013 7:59 pm
by Edgar
I skipped right to 02a; grabbed a fresh copy of SVN HEAD, before patching compiled both Release and Unicode Release (to ensure no recent commit broke the compile); applied the patch and compiled both Release and Unicode Release successfully.
steve wrote:
Would it be better to move this to ErrorDialog.cpp along with void ShowHelpDialog ?
I don't think so. Each help button (dialog) will require a custom (non-translated) HTML string.
I am going to switch to private email for the fiddly bits…
Re: Help button for dialogs
Posted: Wed May 15, 2013 2:39 pm
by Edgar
Steve,
We had a major storm here and the power was out for a long time. I still have no internet at home and only an iPad with a poor cell contection for the web but no e-mail access. I'm not ignoring y'all <grin>!