1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 08:38:39 +02:00

Bug 1654 - Enh: Analyze Contrast and Plot Spectrum don't have the new "Help" button

This commit is contained in:
James Crook 2017-08-14 23:10:06 +01:00
parent fab1a2778b
commit 61e321fd43
3 changed files with 31 additions and 15 deletions

View File

@ -82,6 +82,9 @@ and in the spectrogram spectral selection.
#include "Experimental.h"
#include "./widgets/LinkingHtmlWindow.h"
#include "./widgets/HelpSystem.h"
DEFINE_EVENT_TYPE(EVT_FREQWINDOW_RECALC);
enum {
@ -169,6 +172,7 @@ BEGIN_EVENT_TABLE(FreqWindow, wxDialogWrapper)
EVT_BUTTON(FreqExportButtonID, FreqWindow::OnExport)
EVT_BUTTON(ReplotButtonID, FreqWindow::OnReplot)
EVT_BUTTON(wxID_CANCEL, FreqWindow::OnCloseButton)
EVT_BUTTON(wxID_HELP, FreqWindow::OnGetURL)
EVT_CHECKBOX(GridOnOffID, FreqWindow::OnGridOnOff)
EVT_COMMAND(wxID_ANY, EVT_FREQWINDOW_RECALC, FreqWindow::OnRecalc)
END_EVENT_TABLE()
@ -384,7 +388,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.SetSizerProportion(1);
S.StartMultiColumn(4);
S.SetStretchyCol(1);
S.SetStretchyCol(3);
S.SetStretchyCol(5);
{
S.AddPrompt(wxT("Cursor:"));
@ -395,6 +399,10 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.SetStyle(wxTE_READONLY);
mPeakText = S.AddTextBox(wxT(""), wxT(""), 10);
S.AddSpace(5);
mGridOnOff = S.Id(GridOnOffID).AddCheckBox(_("&Grids"), wxT("false"));
mGridOnOff->SetValue(mDrawGrid);
}
S.EndMultiColumn();
}
@ -412,7 +420,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.SetBorder(2);
S.SetSizerProportion(0);
S.StartMultiColumn(11, wxALIGN_CENTER);
S.StartMultiColumn(9, wxALIGN_CENTER);
{
// ----------------------------------------------------------------
// ROW 6: Algorithm, Size, Export, Replot
@ -436,9 +444,6 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.AddSpace(5);
mReplotButton = S.Id(ReplotButtonID).AddButton(_("&Replot..."));
S.AddSpace(5);
// ----------------------------------------------------------------
// ROW 7: Function, Axix, Grids, Close
@ -460,16 +465,16 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.AddSpace(5);
mGridOnOff = S.Id(GridOnOffID).AddCheckBox(_("&Grids"), wxT("false"));
mGridOnOff->SetValue(mDrawGrid);
mReplotButton = S.Id(ReplotButtonID).AddButton(_("&Replot..."));
S.AddSpace(5);
mCloseButton = S.Id(wxID_CANCEL).AddButton(_("&Close"));
//mCloseButton = S.Id(wxID_CANCEL).AddButton(_("&Close"));
S.AddSpace(5);
//S.AddSpace(5);
}
S.EndMultiColumn();
S.AddStandardButtons( eHelpButton | eCloseButton );
// -------------------------------------------------------------------
// ROW 8: Spacer
@ -488,8 +493,8 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
}
mLogAxis = mAxis != 0;
mCloseButton->SetDefault();
mCloseButton->SetFocus();
//mCloseButton->SetDefault();
//mCloseButton->SetFocus();
Layout();
Fit();
@ -520,6 +525,13 @@ FreqWindow::~FreqWindow()
{
}
void FreqWindow::OnGetURL(wxCommandEvent & WXUNUSED(event))
{
// Original help page is back on-line (March 2016), but the manual should be more reliable.
// http://www.eramp.com/WCAG_2_audio_contrast_tool_help.htm
HelpSystem::ShowHelpDialog(this, wxT("Plot Spectrum"));
}
bool FreqWindow::Show(bool show)
{
if (!show)

View File

@ -139,6 +139,7 @@ private:
void OnCloseWindow(wxCloseEvent & event);
void OnCloseButton(wxCommandEvent & event);
void OnGetURL(wxCommandEvent & event);
void OnSize(wxSizeEvent & event);
void OnPanScroller(wxScrollEvent & event);
void OnZoomSlider(wxCommandEvent & event);

View File

@ -122,10 +122,10 @@ void ContrastDialog::SetStartAndEndTime()
enum {
ID_BUTTON_USECURRENTF = 10001,
ID_BUTTON_USECURRENTB,
ID_BUTTON_GETURL,
//ID_BUTTON_GETURL,
ID_BUTTON_EXPORT,
ID_BUTTON_RESET,
ID_BUTTON_CLOSE,
//ID_BUTTON_CLOSE,
ID_FOREGROUNDSTART_T,
ID_FOREGROUNDEND_T,
ID_BACKGROUNDSTART_T,
@ -139,10 +139,10 @@ enum {
BEGIN_EVENT_TABLE(ContrastDialog,wxDialogWrapper)
EVT_BUTTON(ID_BUTTON_USECURRENTF, ContrastDialog::OnGetForeground)
EVT_BUTTON(ID_BUTTON_USECURRENTB, ContrastDialog::OnGetBackground)
EVT_BUTTON(ID_BUTTON_GETURL, ContrastDialog::OnGetURL)
EVT_BUTTON(wxID_HELP, ContrastDialog::OnGetURL)
EVT_BUTTON(ID_BUTTON_EXPORT, ContrastDialog::OnExport)
EVT_BUTTON(ID_BUTTON_RESET, ContrastDialog::OnReset)
EVT_BUTTON(ID_BUTTON_CLOSE, ContrastDialog::OnClose)
EVT_BUTTON(wxID_CANCEL, ContrastDialog::OnClose)
END_EVENT_TABLE()
/* i18n-hint: WCAG2 is the 'Web Content Accessibility Guidelines (WCAG) 2.0', see http://www.w3.org/TR/WCAG20/ */
@ -294,6 +294,8 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
S.EndMultiColumn();
}
S.EndStatic();
S.AddStandardButtons(eCloseButton |eHelpButton);
#if 0
S.StartMultiColumn(3, wxEXPAND);
{
S.SetStretchyCol(1);
@ -302,6 +304,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
m_pButton_Close = S.Id(ID_BUTTON_CLOSE).AddButton(_("&Close"));
}
S.EndMultiColumn();
#endif
Layout();
Fit();
SetMinSize(GetSize());