AddCheckBox takes a bool for initial state, not string

This commit is contained in:
Paul Licameli 2018-02-01 21:37:34 -05:00
parent e01e1072bc
commit 7766d9a192
24 changed files with 40 additions and 40 deletions

View File

@ -202,12 +202,12 @@ void BenchmarkDialog::MakeBenchmarkDialog()
//
item = S.AddCheckBox(_("Show detailed info about each block file"),
wxT("false"));
false);
item->SetValidator(wxGenericValidator(&mBlockDetail));
//
item = S.AddCheckBox(_("Show detailed info about each editing operation"),
wxT("false"));
false);
item->SetValidator(wxGenericValidator(&mEditDetail));
//

View File

@ -586,7 +586,7 @@ to download or locate the FFmpeg libraries."
int dontShowDlg = 0;
gPrefs->Read(wxT("/FFmpeg/NotFoundDontShow"),&dontShowDlg,0);
mDontShow = S.AddCheckBox(_("Do not show this warning again"),dontShowDlg ? wxT("true") : wxT("false"));
mDontShow = S.AddCheckBox(_("Do not show this warning again"),dontShowDlg);
S.AddStandardButtons(eOkButton);
}

View File

@ -417,8 +417,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
mPeakText = S.AddTextBox( {}, wxT(""), 10);
S.AddSpace(5);
mGridOnOff = S.Id(GridOnOffID).AddCheckBox(_("&Grids"), wxT("false"));
mGridOnOff->SetValue(mDrawGrid);
mGridOnOff = S.Id(GridOnOffID).AddCheckBox(_("&Grids"), mDrawGrid);
}
S.EndMultiColumn();
}

View File

@ -369,7 +369,7 @@ void ScreenFrame::PopulateOrExchange(ShuttleGui & S)
{
mDelayCheckBox = S.Id(IdDelayCheckBox).AddCheckBox
(_("Wait 5 seconds and capture frontmost window/dialog"),
_("false"));
false);
}
S.EndHorizontalLay();
}

View File

@ -298,7 +298,7 @@ wxWindow * ShuttleGuiBase::AddWindow(wxWindow * pWindow, int Flags )
return pWindow;
}
wxCheckBox * ShuttleGuiBase::AddCheckBox( const wxString &Prompt, const wxString &Selected)
wxCheckBox * ShuttleGuiBase::AddCheckBox( const wxString &Prompt, bool Selected)
{
HandleOptionality( Prompt );
wxString realPrompt = Prompt;
@ -315,7 +315,7 @@ wxCheckBox * ShuttleGuiBase::AddCheckBox( const wxString &Prompt, const wxString
miProp=0;
mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, realPrompt, wxDefaultPosition, wxDefaultSize,
Style( 0 ));
pCheckBox->SetValue(Selected == wxT("true"));
pCheckBox->SetValue(Selected);
if (realPrompt.empty()) {
// NVDA 2018.3 does not read controls which are buttons, check boxes or radio buttons which have
// an accessibility name which is empty. Bug 1980.
@ -332,7 +332,7 @@ wxCheckBox * ShuttleGuiBase::AddCheckBox( const wxString &Prompt, const wxString
/// For a consistant two-column layout we want labels on the left and
/// controls on the right. CheckBoxes break that rule, so we fake it by
/// placing a static text label and then a tick box with an empty label.
wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight( const wxString &Prompt, const wxString &Selected)
wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight( const wxString &Prompt, bool Selected)
{
HandleOptionality( Prompt );
AddPrompt( Prompt );
@ -343,7 +343,7 @@ wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight( const wxString &Prompt, const w
miProp=0;
mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, wxT(""), wxDefaultPosition, wxDefaultSize,
Style( 0 ));
pCheckBox->SetValue(Selected==wxT("true"));
pCheckBox->SetValue(Selected);
pCheckBox->SetName(wxStripMenuCodes(Prompt));
UpdateSizers();
return pCheckBox;
@ -1111,7 +1111,7 @@ wxCheckBox * ShuttleGuiBase::TieCheckBox(const wxString &Prompt, WrappedType & W
HandleOptionality( Prompt );
// The Add function does a UseUpId(), so don't do it here in that case.
if( mShuttleMode == eIsCreating )
return AddCheckBox( Prompt, WrappedRef.ReadAsString());
return AddCheckBox( Prompt, WrappedRef.ReadAsString() == wxT("true"));
UseUpId();
@ -1153,7 +1153,8 @@ wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight(const wxString &Prompt, WrappedT
HandleOptionality( Prompt );
// The Add function does a UseUpId(), so don't do it here in that case.
if( mShuttleMode == eIsCreating )
return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString());
return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString() == wxT("true"));
UseUpId();
wxWindow * pWnd = wxWindow::FindWindowById( miId, mpDlg);
@ -1505,7 +1506,7 @@ wxCheckBox * ShuttleGuiBase::TieCheckBoxOnRight(const wxString &Prompt, bool &Va
// Only does anything different if it's creating.
WrappedType WrappedRef( Var );
if( mShuttleMode == eIsCreating )
return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString() );
return AddCheckBoxOnRight( Prompt, WrappedRef.ReadAsString() == wxT("true") );
return TieCheckBox( Prompt, WrappedRef );
}

View File

@ -108,8 +108,8 @@ public:
wxListCtrl * AddListControl();
wxListCtrl * AddListControlReportMode();
wxGrid * AddGrid();
wxCheckBox * AddCheckBox( const wxString &Prompt, const wxString &Selected);
wxCheckBox * AddCheckBoxOnRight( const wxString &Prompt, const wxString &Selected);
wxCheckBox * AddCheckBox( const wxString &Prompt, bool Selected);
wxCheckBox * AddCheckBoxOnRight( const wxString &Prompt, bool Selected);
wxComboBox * AddCombo( const wxString &Prompt, const wxString &Selected,const wxArrayStringEx & choices, long style = 0 );
wxChoice * AddChoice( const wxString &Prompt, const wxArrayStringEx &choices, int Selected = -1 );
wxMenuBar * AddMenuBar( );

View File

@ -134,7 +134,7 @@ void SplashDialog::Populate( ShuttleGui & S )
S.SetStretchyCol( 1 );// Column 1 is stretchy...
{
S.SetBorder( 5 );
S.Id( DontShowID).AddCheckBox( _("Don't show this again at start up"), bShow ? wxT("false") : wxT("true") );
S.Id( DontShowID).AddCheckBox( _("Don't show this again at start up"), !bShow );
wxButton *ok = safenew wxButton(S.GetParent(), wxID_OK);
ok->SetDefault();
S.SetBorder( 5 );

View File

@ -891,7 +891,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
{
// If checked, the project will be saved when the recording is completed
m_pTimerAutoSaveCheckBoxCtrl = S.Id(ID_AUTOSAVE_CHECKBOX).AddCheckBox(_("Enable &Automatic Save?"),
(bAutoSave ? "true" : "false"));
bAutoSave);
S.StartMultiColumn(3, wxEXPAND);
{
wxString sInitialValue;
@ -914,7 +914,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
S.StartStatic(_("Automatic Export"), true);
{
m_pTimerAutoExportCheckBoxCtrl = S.Id(ID_AUTOEXPORT_CHECKBOX).AddCheckBox(_("Enable Automatic &Export?"), (bAutoExport ? "true" : "false"));
m_pTimerAutoExportCheckBoxCtrl = S.Id(ID_AUTOEXPORT_CHECKBOX).AddCheckBox(_("Enable Automatic &Export?"), bAutoExport);
S.StartMultiColumn(3, wxEXPAND);
{
S.AddPrompt(_("Export Project As:"));

View File

@ -269,7 +269,7 @@ void EffectAmplify::PopulateOrExchange(ShuttleGui & S)
// Clipping
S.StartHorizontalLay(wxCENTER);
{
mClip = S.Id(ID_Clip).AddCheckBox(_("Allow clipping"), wxT("false"));
mClip = S.Id(ID_Clip).AddCheckBox(_("Allow clipping"), false);
if (IsBatchProcessing())
{
mClip->Enable(false);

View File

@ -272,7 +272,7 @@ void EffectBassTreble::PopulateOrExchange(ShuttleGui & S)
{
// Link checkbox
mLinkCheckBox = S.Id(ID_Link).AddCheckBox(_("&Link Volume control to Tone controls"),
DEF_Link ? wxT("true") : wxT("false"));
DEF_Link);
}
S.EndMultiColumn();
}

View File

@ -347,7 +347,7 @@ void EffectChangePitch::PopulateOrExchange(ShuttleGui & S)
S.StartMultiColumn(2);
{
mUseSBSMSCheckBox = S.AddCheckBox(_("Use high quality stretching (slow)"),
mUseSBSMS? wxT("true") : wxT("false"));
mUseSBSMS);
mUseSBSMSCheckBox->SetValidator(wxGenericValidator(&mUseSBSMS));
}
S.EndMultiColumn();

View File

@ -300,7 +300,7 @@ void EffectChangeTempo::PopulateOrExchange(ShuttleGui & S)
S.StartMultiColumn(2);
{
mUseSBSMSCheckBox = S.AddCheckBox(_("Use high quality stretching (slow)"),
mUseSBSMS? wxT("true") : wxT("false"));
mUseSBSMS);
mUseSBSMSCheckBox->SetValidator(wxGenericValidator(&mUseSBSMS));
}
S.EndMultiColumn();

View File

@ -290,9 +290,9 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S)
{
/* i18n-hint: Make-up, i.e. correct for any reduction, rather than fabricate it.*/
mGainCheckBox = S.AddCheckBox(_("Make-up gain for 0 dB after compressing"),
DEF_Normalize ? wxT("true") : wxT("false"));
DEF_Normalize);
mPeakCheckBox = S.AddCheckBox(_("Compress based on Peaks"),
DEF_UsePeak ? wxT("true") : wxT("false"));
DEF_UsePeak);
}
S.EndHorizontalLay();
}

View File

@ -376,7 +376,7 @@ void EffectDistortion::PopulateOrExchange(ShuttleGui & S)
S.SetSizeHints(-1, -1);
mDCBlockCheckBox = S.Id(ID_DCBlock).AddCheckBox(_("DC blocking filter"),
DEF_DCBlock ? wxT("true") : wxT("false"));
DEF_DCBlock);
}
S.EndMultiColumn();
S.AddSpace(0, 10);

View File

@ -802,7 +802,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
{
szrL = S.GetSizer();
mLinFreq = S.Id(ID_Linear).AddCheckBox(_("Li&near Frequency Scale"), wxT("false"));
mLinFreq = S.Id(ID_Linear).AddCheckBox(_("Li&near Frequency Scale"), false);
mLinFreq->SetName(_("Linear Frequency Scale"));
}
S.EndHorizontalLay();
@ -881,7 +881,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
S.Id(ID_Clear).AddButton(_("Fla&tten"));
S.Id(ID_Invert).AddButton(_("&Invert"));
mGridOnOff = S.Id(ID_Grid).AddCheckBox(_("Show g&rid lines"), wxT("false"));
mGridOnOff = S.Id(ID_Grid).AddCheckBox(_("Show g&rid lines"), false);
mGridOnOff->SetName(_("Show grid lines"));
}
S.EndHorizontalLay();

View File

@ -361,7 +361,7 @@ void EffectNormalize::PopulateOrExchange(ShuttleGui & S)
S.StartVerticalLay(false);
{
mDCCheckBox = S.AddCheckBox(_("Remove DC offset (center on 0.0 vertically)"),
mDC ? wxT("true") : wxT("false"));
mDC);
mDCCheckBox->SetValidator(wxGenericValidator(&mDC));
S.StartHorizontalLay(wxALIGN_LEFT, false);
@ -378,7 +378,7 @@ void EffectNormalize::PopulateOrExchange(ShuttleGui & S)
#endif
// Now make the checkbox.
mGainCheckBox = S.AddCheckBox(longerPrompt,
mGain ? wxT("true") : wxT("false"));
mGain);
mGainCheckBox->SetValidator(wxGenericValidator(&mGain));
mGainCheckBox->SetMinSize( mGainCheckBox->GetSize());
@ -397,11 +397,11 @@ void EffectNormalize::PopulateOrExchange(ShuttleGui & S)
S.EndHorizontalLay();
#ifdef EXPERIMENTAL_R128_NORM
mUseLoudnessCheckBox = S.AddCheckBox(_("Use loudness instead of peak amplitude"),
mUseLoudness ? wxT("true") : wxT("false"));
mUseLoudness);
mUseLoudnessCheckBox->SetValidator(wxGenericValidator(&mGUIUseLoudness));
#endif
mStereoIndCheckBox = S.AddCheckBox(_("Normalize stereo channels independently"),
mStereoInd ? wxT("true") : wxT("false"));
mStereoInd);
mStereoIndCheckBox->SetValidator(wxGenericValidator(&mStereoInd));
}
S.EndVerticalLay();

View File

@ -459,7 +459,7 @@ void EffectReverb::PopulateOrExchange(ShuttleGui & S)
S.StartHorizontalLay(wxCENTER, false);
{
mWetOnlyC = S.Id(ID_WetOnly).
AddCheckBox(_("Wet O&nly"), DEF_WetOnly ? wxT("true") : wxT("false"));
AddCheckBox(_("Wet O&nly"), DEF_WetOnly);
}
S.EndHorizontalLay();

View File

@ -117,11 +117,11 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams &params)
mForceFinalAlignmentCheckBox = S.Id(ID_FORCEFINALALIGNMENT).AddCheckBox(
wxT("Force Final Alignment"),
(p.mForceFinalAlignment ? wxT("true") : wxT("false")));
p.mForceFinalAlignment);
mForceFinalAlignmentCheckBox->SetName(_("Force Final Alignment"));
mIgnoreSilenceCheckBox = S.Id(ID_IGNORESILENCE).AddCheckBox(
wxT("Ignore Silence at Beginnings and Endings"),
(p.mIgnoreSilence ? wxT("true") : wxT("false")));
p.mIgnoreSilence);
mIgnoreSilenceCheckBox->SetName(
_("Ignore Silence at Beginnings and Endings"));
// need a third column after checkboxes:

View File

@ -802,7 +802,7 @@ void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S)
S.StartMultiColumn(2, wxALIGN_CENTER_HORIZONTAL);
{
mIndependent = S.AddCheckBox(_("Truncate tracks independently"),
mbIndependent ? wxT("true") : wxT("false"));
mbIndependent);
}
S.EndMultiColumn();
}

View File

@ -2548,7 +2548,7 @@ void NyquistEffect::BuildPromptWindow(ShuttleGui & S)
S.AddSpace(1, 1);
mVersionCheckBox = S.AddCheckBox(_("&Use legacy (version 3) syntax."),
(mVersion == 3) ? wxT("true") : wxT("false"));
(mVersion == 3));
}
S.EndMultiColumn();

View File

@ -609,7 +609,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S)
{
S.Id(ID_Toggles + p);
mToggles[p] = S.AddCheckBox( {},
value > 0.5 ? wxT("true") : wxT("false"));
value > 0.5);
mToggles[p]->SetName(labelText);
if (!tip.empty())
{

View File

@ -414,7 +414,7 @@ void ExportMP3Options::PopulateOrExchange(ShuttleGui & S)
}
S.EndRadioButtonGroup();
mMono = S.Id(ID_MONO).AddCheckBox(_("Force export to mono"), mono? wxT("true") : wxT("false"));
mMono = S.Id(ID_MONO).AddCheckBox(_("Force export to mono"), mono);
}
S.EndTwoColumn();
}

View File

@ -297,7 +297,7 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S)
// Row 3 (indented)
S.AddVariableText(wxT(" "), false);
mFirst = S.Id(FirstID)
.AddCheckBox(_("Include audio before first label"), wxT("false"));
.AddCheckBox(_("Include audio before first label"), false);
// Row 4
S.AddVariableText( {}, false);

View File

@ -73,7 +73,7 @@ WarningDialog::WarningDialog(wxWindow *parent, const wxString &message,
S.StartVerticalLay(false);
{
S.AddFixedText(message);
mCheckBox = S.AddCheckBox(footer, wxT("false"));
mCheckBox = S.AddCheckBox(footer, false);
}
S.EndVerticalLay();