本文整理匯總了C++中ShuttleGui::AddTextBox方法的典型用法代碼示例。如果您正苦於以下問題:C++ ShuttleGui::AddTextBox方法的具體用法?C++ ShuttleGui::AddTextBox怎麽用?C++ ShuttleGui::AddTextBox使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ShuttleGui
的用法示例。
在下文中一共展示了ShuttleGui::AddTextBox方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: PopulateOrExchange
void EchoDialog::PopulateOrExchange(ShuttleGui & S)
{
S.StartHorizontalLay(wxCENTER, false);
{
/* i18n-hint: && in here is an escape character to get a single & on
* screen, so keep it as is */
S.AddTitle(_("by Dominic Mazzoni && Vaughan Johnson"));
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxCENTER, false);
{
// Add a little space
}
S.EndHorizontalLay();
S.StartMultiColumn(2, wxALIGN_CENTER);
{
m_pTextCtrl_Delay = S.AddTextBox(_("Delay time (seconds):"),
wxT("1.0"),
10);
m_pTextCtrl_Delay->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
m_pTextCtrl_Decay = S.AddTextBox(_("Decay factor:"),
wxT("0.5"),
10);
m_pTextCtrl_Decay->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
}
S.EndMultiColumn();
}
示例2: PopulateOrExchange
void PaulstretchDialog::PopulateOrExchange(ShuttleGui & S){
S.StartHorizontalLay(wxCENTER, false);
{
S.AddTitle(_("by Nasca Octavian Paul"));
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxCENTER, false);
S.EndHorizontalLay();
S.StartMultiColumn(2, wxALIGN_CENTER);
{
/* i18n-hint: This is how many times longer the sound will be, e.g. applying
* the effect to a 1-second sample, with the default Stretch Factor of 10.0
* will give an (approximately) 10 second sound
*/
m_pTextCtrl_Amount = S.AddTextBox(_("Stretch Factor:"),wxT("10.0"),10);
m_pTextCtrl_Amount->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
m_pTextCtrl_TimeResolution= S.AddTextBox(_("Time Resolution (seconds):"), wxT("0.25"),10);
m_pTextCtrl_TimeResolution->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
}
S.EndMultiColumn();
};
示例3: PopulateOrExchange
void MacroCommandDialog::PopulateOrExchange(ShuttleGui &S)
{
S.StartVerticalLay(true);
{
S.StartMultiColumn(4, wxEXPAND);
{
S.SetStretchyCol(1);
mCommand = S.AddTextBox(_("&Command"), wxT(""), 20);
mCommand->SetEditable(false);
mEditParams = S.Id(EditParamsButtonID).AddButton(_("&Edit Parameters"));
mEditParams->Enable(false); // disable button as box is empty
mUsePreset = S.Id(UsePresetButtonID).AddButton(_("&Use Preset"));
mUsePreset->Enable(false); // disable button as box is empty
}
S.EndMultiColumn();
S.StartMultiColumn(2, wxEXPAND);
{
S.SetStretchyCol(1);
mParameters = S.AddTextBox(_("&Parameters"), wxT(""), 0);
mParameters->SetEditable(false);
wxString prompt{_("&Details")};
S.Prop(0).AddPrompt(prompt);
mDetails = S.AddTextWindow( wxT(""));
mDetails->SetEditable(false);
mDetails->SetName(wxStripMenuCodes(prompt));
}
S.EndMultiColumn();
S.Prop(10).StartStatic(_("Choose command"), true);
{
S.SetStyle(wxSUNKEN_BORDER | wxLC_LIST | wxLC_SINGLE_SEL);
mChoices = S.Id(CommandsListID).AddListControl();
}
S.EndStatic();
}
S.EndVerticalLay();
S.AddStandardButtons( eOkButton | eCancelButton | eHelpButton);
PopulateCommandList();
if (mChoices->GetItemCount() > 0) {
// set first item to be selected (and the focus when the
// list first becomes the focus)
mChoices->SetItemState(0, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED,
wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED);
}
SetMinSize(wxSize(780, 560));
Fit();
Center();
}
示例4: PopulateOrExchange
void EffectEcho::PopulateOrExchange(ShuttleGui & S)
{
S.AddSpace(0, 5);
S.StartMultiColumn(2, wxALIGN_CENTER);
{
FloatingPointValidator<double> vldDelay(3, &delay, NUM_VAL_NO_TRAILING_ZEROES);
vldDelay.SetRange(MIN_Delay, MAX_Delay);
S.AddTextBox(_("Delay time (seconds):"), wxT(""), 10)->SetValidator(vldDelay);
FloatingPointValidator<double> vldDecay(3, &decay, NUM_VAL_NO_TRAILING_ZEROES);
vldDecay.SetRange(MIN_Decay, MAX_Decay);
S.AddTextBox(_("Decay factor:"), wxT(""), 10)->SetValidator(vldDecay);
}
S.EndMultiColumn();
}
示例5: PopulateOrExchange
void EffectNoise::PopulateOrExchange(ShuttleGui & S)
{
wxASSERT(nTypes == WXSIZEOF(kTypeStrings));
S.StartMultiColumn(2, wxCENTER);
{
auto typeChoices = LocalizedStrings(kTypeStrings, nTypes);
S.AddChoice(_("Noise type:"), wxT(""), &typeChoices)->SetValidator(wxGenericValidator(&mType));
FloatingPointValidator<double> vldAmp(6, &mAmp, NumValidatorStyle::NO_TRAILING_ZEROES);
vldAmp.SetRange(MIN_Amp, MAX_Amp);
S.AddTextBox(_("Amplitude (0-1):"), wxT(""), 12)->SetValidator(vldAmp);
S.AddPrompt(_("Duration:"));
mNoiseDurationT = safenew
NumericTextCtrl(S.GetParent(), wxID_ANY,
NumericConverter::TIME,
GetDurationFormat(),
GetDuration(),
mProjectRate,
NumericTextCtrl::Options{}
.AutoPos(true));
mNoiseDurationT->SetName(_("Duration"));
S.AddWindow(mNoiseDurationT, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL);
}
S.EndMultiColumn();
}
示例6: PopulateOrExchange
void EffectNoise::PopulateOrExchange(ShuttleGui & S)
{
wxASSERT(kNumTypes == WXSIZEOF(kTypeStrings));
wxArrayString typeChoices;
for (int i = 0; i < kNumTypes; i++)
{
typeChoices.Add(wxGetTranslation(kTypeStrings[i]));
}
S.StartMultiColumn(2, wxCENTER);
{
S.AddChoice(_("Noise type:"), wxT(""), &typeChoices)->SetValidator(wxGenericValidator(&mType));
FloatingPointValidator<double> vldAmp(6, &mAmp, NUM_VAL_NO_TRAILING_ZEROES);
vldAmp.SetRange(MIN_Amp, MAX_Amp);
S.AddTextBox(_("Amplitude (0-1):"), wxT(""), 12)->SetValidator(vldAmp);
S.AddPrompt(_("Duration:"));
mNoiseDurationT = new
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
wxID_ANY,
GetDurationFormat(),
GetDuration(),
mProjectRate,
wxDefaultPosition,
wxDefaultSize,
true);
mNoiseDurationT->SetName(_("Duration"));
mNoiseDurationT->EnableMenu();
S.AddWindow(mNoiseDurationT, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL);
}
S.EndMultiColumn();
}
示例7: PopulateOrExchange
void PopulateOrExchange(ShuttleGui & S)
{
wxString text;
S.SetBorder(10);
S.StartVerticalLay(true);
{
text.Printf(_("Audacity needs the file '%s' to import and export audio via FFmpeg."), mName.c_str());
S.AddTitle(text);
S.SetBorder(3);
S.StartHorizontalLay(wxALIGN_LEFT, true);
{
text.Printf(_("Location of '%s':"), mName.c_str());
S.AddTitle(text);
}
S.EndHorizontalLay();
S.StartMultiColumn(2, wxEXPAND);
S.SetStretchyCol(0);
{
if (mLibPath.GetFullPath().IsEmpty()) {
text.Printf(_("To find '%s', click here -->"), mName.c_str());
mPathText = S.AddTextBox(wxT(""), text, 0);
}
else {
mPathText = S.AddTextBox(wxT(""), mLibPath.GetFullPath(), 0);
}
S.Id(ID_FFMPEG_BROWSE).AddButton(_("Browse..."), wxALIGN_RIGHT);
S.AddVariableText(_("To get a free copy of FFmpeg, click here -->"), true);
S.Id(ID_FFMPEG_DLOAD).AddButton(_("Download"), wxALIGN_RIGHT);
}
S.EndMultiColumn();
S.AddStandardButtons();
}
S.EndVerticalLay();
Layout();
Fit();
SetMinSize(GetSize());
Center();
return;
}
示例8: PopulateOrExchange
void EchoDialog::PopulateOrExchange(ShuttleGui & S)
{
S.AddSpace(0, 5);
S.StartMultiColumn(2, wxALIGN_CENTER);
{
m_pTextCtrl_Delay = S.AddTextBox(_("Delay time (seconds):"),
wxT("1.0"),
10);
m_pTextCtrl_Delay->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
m_pTextCtrl_Decay = S.AddTextBox(_("Decay factor:"),
wxT("0.5"),
10);
m_pTextCtrl_Decay->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
}
S.EndMultiColumn();
}
示例9: PopulateOrExchange
void EffectPaulstretch::PopulateOrExchange(ShuttleGui & S)
{
S.StartMultiColumn(2, wxALIGN_CENTER);
{
FloatingPointValidator<float> vldAmount(1, &mAmount);
vldAmount.SetMin(MIN_Amount);
/* i18n-hint: This is how many times longer the sound will be, e.g. applying
* the effect to a 1-second sample, with the default Stretch Factor of 10.0
* will give an (approximately) 10 second sound
*/
S.AddTextBox(_("Stretch Factor:"), wxT(""), 10)->SetValidator(vldAmount);
FloatingPointValidator<float> vldTime(3, &mTime_resolution, NumValidatorStyle::ONE_TRAILING_ZERO);
vldTime.SetMin(MIN_Time);
S.AddTextBox(_("Time Resolution (seconds):"), wxT(""), 10)->SetValidator(vldTime);
}
S.EndMultiColumn();
};
示例10: PopulateOrExchange
void BatchCommandDialog::PopulateOrExchange(ShuttleGui &S)
{
S.StartVerticalLay(true);
{
S.StartMultiColumn(3, wxEXPAND);
{
S.SetStretchyCol(1);
mCommand = S.AddTextBox(_("&Command"), wxT(""), 20);
mCommand->SetEditable(false);
mEditParams = S.Id(EditParamsButtonID).AddButton(_("&Edit Parameters"));
mEditParams->Enable( false ); // disable button as box is empty
}
S.EndMultiColumn();
S.StartMultiColumn(2, wxEXPAND);
{
S.SetStretchyCol(1);
mParameters = S.AddTextBox(_("&Parameters"), wxT(""), 0);
mParameters->SetEditable(false);
}
S.EndMultiColumn();
S.StartStatic(_("C&hoose command"), true);
{
S.SetStyle(wxSUNKEN_BORDER | wxLC_LIST | wxLC_SINGLE_SEL);
mChoices = S.Id(CommandsListID).AddListControl();
}
S.EndStatic();
}
S.EndVerticalLay();
S.AddStandardButtons();
for(int i=0;i<99;i++)
{
mChoices->InsertItem( i, wxString::Format(wxT("Item%02i"),i));
}
PopulateCommandList();
SetSize(350, 400);
SetSizeHints(GetSize());
Center();
}
示例11: PopulateOrExchange
void EffectRepeat::PopulateOrExchange(ShuttleGui & S)
{
S.StartHorizontalLay(wxCENTER, false);
{
IntegerValidator<int> vldRepeatCount(&repeatCount);
vldRepeatCount.SetRange(MIN_Count, 2147483647 / mProjectRate);
mRepeatCount = S.AddTextBox(_("Number of repeats to add:"), wxT(""), 12);
mRepeatCount->SetValidator(vldRepeatCount);
}
S.EndHorizontalLay();
S.StartMultiColumn(1, wxCENTER);
{
mCurrentTime = S.AddVariableText(_("Current selection length: dd:hh:mm:ss"));
mTotalTime = S.AddVariableText(_("New selection length: dd:hh:mm:ss"));
}
S.EndMultiColumn();
}
示例12: PopulateOrExchange
void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S)
{
wxASSERT(kNumActions == WXSIZEOF(kActionStrings));
wxArrayString actionChoices;
for (int i = 0; i < kNumActions; i++)
{
actionChoices.Add(wxGetTranslation(kActionStrings[i]));
}
S.AddSpace(0, 5);
S.StartStatic(_("Detect Silence"));
{
S.StartMultiColumn(3, wxALIGN_CENTER_HORIZONTAL);
{
// Threshold
mTruncDbChoice = S.AddChoice(_("Level:"), wxT(""), &mDbChoices);
mTruncDbChoice->SetValidator(wxGenericValidator(&mTruncDbChoiceIndex));
S.SetSizeHints(-1, -1);
S.AddSpace(0); // 'choices' already includes units.
// Ignored silence
FloatingPointValidator<double> vldDur(3, &mInitialAllowedSilence, NUM_VAL_NO_TRAILING_ZEROES);
vldDur.SetRange(MIN_Minimum, MAX_Minimum);
mInitialAllowedSilenceT = S.AddTextBox(_("Duration:"), wxT(""), 12);
mInitialAllowedSilenceT->SetValidator(vldDur);
S.AddUnits(wxT("seconds"));
}
S.EndMultiColumn();
}
S.EndStatic();
S.StartStatic(_("Action"));
{
S.StartHorizontalLay();
{
// Action choices
mActionChoice = S.AddChoice(wxT(""), wxT(""), &actionChoices);
mActionChoice->SetValidator(wxGenericValidator(&mActionIndex));
S.SetSizeHints(-1, -1);
}
S.EndHorizontalLay();
S.StartMultiColumn(3, wxALIGN_CENTER_HORIZONTAL);
{
// Truncation / Compression factor
FloatingPointValidator<double> vldTrunc(3, &mTruncLongestAllowedSilence, NUM_VAL_NO_TRAILING_ZEROES);
vldTrunc.SetRange(MIN_Truncate, MAX_Truncate);
mTruncLongestAllowedSilenceT = S.AddTextBox(_("Truncate to:"), wxT(""), 12);
mTruncLongestAllowedSilenceT->SetValidator(vldTrunc);
S.AddUnits(wxT("seconds"));
FloatingPointValidator<double> vldComp(3, &mSilenceCompressPercent, NUM_VAL_NO_TRAILING_ZEROES);
vldComp.SetRange(MIN_Compress, MAX_Compress);
mSilenceCompressPercentT = S.AddTextBox(_("Compress to:"), wxT(""), 12);
mSilenceCompressPercentT->SetValidator(vldComp);
S.AddUnits(wxT("percent"));
}
S.EndMultiColumn();
S.StartMultiColumn(2, wxALIGN_CENTER_HORIZONTAL);
{
mIndependent = S.AddCheckBox(_("Truncate tracks independently"),
mbIndependent ? wxT("true") : wxT("false"));
}
S.EndMultiColumn();
}
S.EndStatic();
UpdateUI();
}
示例13: PopulateOrExchange
void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S)
{
S.SetBorder(5);
S.StartVerticalLay(true);
{
S.AddSpace(0, 5);
mPanel = safenew EffectAutoDuckPanel(S.GetParent(), this);
S.AddWindow(mPanel);
S.AddSpace(0, 5);
S.StartMultiColumn(6, wxCENTER);
{
FloatingPointValidator<double> vldDuckAmountDb(1, &mDuckAmountDb, NUM_VAL_NO_TRAILING_ZEROES);
vldDuckAmountDb.SetRange(MIN_DuckAmountDb, MAX_DuckAmountDb);
mDuckAmountDbBox = S.AddTextBox(_("Duck amount:"), wxT(""), 10);
mDuckAmountDbBox->SetValidator(vldDuckAmountDb);
S.AddUnits(_("dB"));
FloatingPointValidator<double> vldMaximumPause(2, &mMaximumPause, NUM_VAL_NO_TRAILING_ZEROES);
vldMaximumPause.SetRange(MIN_MaximumPause, MAX_MaximumPause);
mMaximumPauseBox = S.AddTextBox(_("Maximum pause:"), wxT(""), 10);
mMaximumPauseBox->SetValidator(vldMaximumPause);
S.AddUnits(_("seconds"));
FloatingPointValidator<double> vldOuterFadeDownLen(2, &mOuterFadeDownLen, NUM_VAL_NO_TRAILING_ZEROES);
vldOuterFadeDownLen.SetRange(MIN_OuterFadeDownLen, MAX_OuterFadeDownLen);
mOuterFadeDownLenBox = S.AddTextBox(_("Outer fade down length:"), wxT(""), 10);
mOuterFadeDownLenBox->SetValidator(vldOuterFadeDownLen);
S.AddUnits(_("seconds"));
FloatingPointValidator<double> vldOuterFadeUpLen(2, &mOuterFadeUpLen, NUM_VAL_NO_TRAILING_ZEROES);
vldOuterFadeUpLen.SetRange(MIN_OuterFadeUpLen, MAX_OuterFadeUpLen);
mOuterFadeUpLenBox = S.AddTextBox(_("Outer fade up length:"), wxT(""), 10);
mOuterFadeUpLenBox->SetValidator(vldOuterFadeUpLen);
S.AddUnits(_("seconds"));
FloatingPointValidator<double> vldInnerFadeDownLen(2, &mInnerFadeDownLen, NUM_VAL_NO_TRAILING_ZEROES);
vldInnerFadeDownLen.SetRange(MIN_InnerFadeDownLen, MAX_InnerFadeDownLen);
mInnerFadeDownLenBox = S.AddTextBox(_("Inner fade down length:"), wxT(""), 10);
mInnerFadeDownLenBox->SetValidator(vldInnerFadeDownLen);
S.AddUnits(_("seconds"));
FloatingPointValidator<double> vldInnerFadeUpLen(2, &mInnerFadeUpLen, NUM_VAL_NO_TRAILING_ZEROES);
vldInnerFadeUpLen.SetRange(MIN_InnerFadeUpLen, MAX_InnerFadeUpLen);
mInnerFadeUpLenBox = S.AddTextBox(_("Inner fade up length:"), wxT(""), 10);
mInnerFadeUpLenBox->SetValidator(vldInnerFadeUpLen);
S.AddUnits(_("seconds"));
}
S.EndMultiColumn();
S.StartMultiColumn(3, wxCENTER);
{
FloatingPointValidator<double> vldThresholdDb(2, &mThresholdDb, NUM_VAL_NO_TRAILING_ZEROES);
vldThresholdDb.SetRange(MIN_ThresholdDb, MAX_ThresholdDb);
mThresholdDbBox = S.AddTextBox(_("Threshold:"), wxT(""), 10);
mThresholdDbBox->SetValidator(vldThresholdDb);
S.AddUnits(_("dB"));
}
S.EndMultiColumn();
}
S.EndVerticalLay();
return;
}
示例14: PopulateOrExchange
void EffectToneGen::PopulateOrExchange(ShuttleGui & S)
{
wxTextCtrl *t;
S.StartMultiColumn(2, wxCENTER);
{
wxChoice *c = S.AddChoice(_("Waveform:"), wxT(""), &mWaveforms);
c->SetValidator(wxGenericValidator(&mWaveform));
if (mChirp)
{
S.AddFixedText(wxT(""));
S.StartHorizontalLay(wxEXPAND);
{
S.StartHorizontalLay(wxLEFT, 50);
{
S.AddTitle(_("Start"));
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxLEFT, 50);
{
S.AddTitle(_("End"));
}
S.EndHorizontalLay();
}
S.EndHorizontalLay();
S.AddPrompt(_("Frequency (Hz):"));
S.StartHorizontalLay(wxEXPAND);
{
S.StartHorizontalLay(wxLEFT, 50);
{
FloatingPointValidator<double> vldStartFreq(6, &mFrequency[0], NUM_VAL_NO_TRAILING_ZEROES);
vldStartFreq.SetRange(MIN_StartFreq, GetActiveProject()->GetRate() / 2.0);
t = S.AddTextBox(wxT(""), wxT(""), 12);
t->SetName(_("Frequency Hertz Start"));
t->SetValidator(vldStartFreq);
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxLEFT, 50);
{
FloatingPointValidator<double> vldEndFreq(6, &mFrequency[1], NUM_VAL_NO_TRAILING_ZEROES);
vldEndFreq.SetRange(MIN_EndFreq, GetActiveProject()->GetRate() / 2.0);
t = S.AddTextBox(wxT(""), wxT(""), 12);
t->SetName(_("Frequency Hertz End"));
t->SetValidator(vldEndFreq);
}
S.EndHorizontalLay();
}
S.EndHorizontalLay();
S.AddPrompt(_("Amplitude (Hz):"));
S.StartHorizontalLay(wxEXPAND);
{
S.StartHorizontalLay(wxLEFT, 50);
{
FloatingPointValidator<double> vldStartAmp(6, &mAmplitude[0], NUM_VAL_NO_TRAILING_ZEROES);
vldStartAmp.SetRange(MIN_StartAmp, MAX_StartAmp);
t = S.AddTextBox(wxT(""), wxT(""), 12);
t->SetName(_("Amplitude Start"));
t->SetValidator(vldStartAmp);
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxLEFT, 50);
{
FloatingPointValidator<double> vldEndAmp(6, &mAmplitude[1], NUM_VAL_NO_TRAILING_ZEROES);
vldEndAmp.SetRange(MIN_EndAmp, MAX_EndAmp);
t = S.AddTextBox(wxT(""), wxT(""), 12);
t->SetName(_("Amplitude End"));
t->SetValidator(vldEndAmp);
}
S.EndHorizontalLay();
}
S.EndHorizontalLay();
c = S.AddChoice(_("Interpolation:"), wxT(""), &mInterpolations);
c->SetValidator(wxGenericValidator(&mInterpolation));
}
else
{
FloatingPointValidator<double> vldFrequency(6, &mFrequency[0], NUM_VAL_NO_TRAILING_ZEROES);
vldFrequency.SetRange(MIN_Frequency, GetActiveProject()->GetRate() / 2.0);
t = S.AddTextBox(_("Frequency (Hz):"), wxT(""), 12);
t->SetValidator(vldFrequency);
FloatingPointValidator<double> vldAmplitude(6, &mAmplitude[0], NUM_VAL_NO_TRAILING_ZEROES);
vldAmplitude.SetRange(MIN_Amplitude, MAX_Amplitude);
t = S.AddTextBox(_("Amplitude (0-1):"), wxT(""), 12);
t->SetValidator(vldAmplitude);
}
bool isSelection;
double duration = GetDuration(&isSelection);
S.AddPrompt(_("Duration:"));
mToneDurationT = new
NumericTextCtrl(NumericConverter::TIME,
//.........這裏部分代碼省略.........
示例15: PopulateOrExchange
//.........這裏部分代碼省略.........
{
S.Id(ID_Toggles + p);
mToggles[p] = S.AddCheckBox( {},
value > 0.5);
mToggles[p]->SetName(labelText);
if (!tip.empty())
{
mToggles[p]->SetToolTip(tip);
}
wxSizer *s = mToggles[p]->GetContainingSizer();
s->GetItem(mToggles[p])->SetFlag(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL);
S.AddSpace(1, 1);
S.AddSpace(1, 1);
S.AddSpace(1, 1);
}
else if (mParameters[p].isQuantized &&
mParameters[p].quantizeStep == 1.0 &&
!mParameters[p].valueNames.empty())
{
wxArrayStringEx choices;
int selected = -1;
for (size_t i = 0, cnt = mParameters[p].valueNames.size(); i < cnt; i++)
{
wxString choice = wxString::FromUTF8(mParameters[p].valueNames[i].c_str());
if (size_t(value - mParameters[p].minValue + 0.5) == i)
{
selected = i;
}
choices.push_back(choice);
}
S.Id(ID_Choices + p);
mChoices[p] = S.AddChoice( {}, choices, selected );
mChoices[p]->SetName(labelText);
mChoices[p]->SetSizeHints(-1, -1);
if (!tip.empty())
{
mChoices[p]->SetToolTip(tip);
}
wxSizer *s = mChoices[p]->GetContainingSizer();
s->GetItem(mChoices[p])->SetFlag(wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL);
S.AddSpace(1, 1);
S.AddSpace(1, 1);
S.AddSpace(1, 1);
}
else
{
mValues[p] = value;
FloatingPointValidator<float> vld(6, &mValues[p]);
vld.SetRange(mParameters[p].minValue, mParameters[p].maxValue);
float range = mParameters[p].maxValue - mParameters[p].minValue;
auto style = range < 10 ? NumValidatorStyle::THREE_TRAILING_ZEROES :
range < 100 ? NumValidatorStyle::TWO_TRAILING_ZEROES :
NumValidatorStyle::ONE_TRAILING_ZERO;
vld.SetStyle(style);
S.Id(ID_Texts + p);
mFields[p] = S.AddTextBox( {}, wxT(""), 12);
mFields[p]->SetName(labelText);
mFields[p]->SetValidator(vld);
if (!tip.empty())
{
mFields[p]->SetToolTip(tip);
}
wxSizer *s = mFields[p]->GetContainingSizer();
s->GetItem(mFields[p])->SetFlag(wxALIGN_CENTER_VERTICAL | wxALL);
wxString str = Internat::ToDisplayString(mParameters[p].minValue);
S.AddPrompt(str);
S.SetStyle(wxSL_HORIZONTAL);
S.Id(ID_Sliders + p);
mSliders[p] = S.AddSlider( {}, 0, 1000, 0);
mSliders[p]->SetName(labelText);
mSliders[p]->SetSizeHints(150, -1);
if (!tip.empty())
{
mSliders[p]->SetToolTip(tip);
}
str = Internat::ToDisplayString(mParameters[p].maxValue);
S.AddUnits(str);
}
}
}
S.EndMultiColumn();
}
S.EndStatic();
}
S.EndScroller();
scroller->SetScrollRate(0, 20);
return;
}