| 442 | } |
| 443 | |
| 444 | void NyquistEffect::BuildEffectWindow(ShuttleGui & S) |
| 445 | { |
| 446 | wxScrolledWindow *scroller = S.Style(wxVSCROLL | wxTAB_TRAVERSAL) |
| 447 | .StartScroller(2); |
| 448 | { |
| 449 | S.StartMultiColumn(4); |
| 450 | { |
| 451 | for (size_t i = 0; i < mControls.size(); i++) |
| 452 | { |
| 453 | NyqControl & ctrl = mControls[i]; |
| 454 | |
| 455 | if (ctrl.type == NYQ_CTRL_TEXT) |
| 456 | { |
| 457 | S.EndMultiColumn(); |
| 458 | S.StartHorizontalLay(wxALIGN_LEFT, 0); |
| 459 | { |
| 460 | S.AddSpace(0, 10); |
| 461 | S.AddFixedText( Verbatim( ctrl.label ), false ); |
| 462 | } |
| 463 | S.EndHorizontalLay(); |
| 464 | S.StartMultiColumn(4); |
| 465 | } |
| 466 | else |
| 467 | { |
| 468 | auto prompt = XXO("%s:").Format( ctrl.name ); |
| 469 | S.AddPrompt( prompt ); |
| 470 | |
| 471 | if (ctrl.type == NYQ_CTRL_STRING) |
| 472 | { |
| 473 | S.AddSpace(10, 10); |
| 474 | |
| 475 | auto item = S.Id(ID_Text + i) |
| 476 | .Validator<wxGenericValidator>(&ctrl.valStr) |
| 477 | .Name( prompt ) |
| 478 | .AddTextBox( {}, wxT(""), 50); |
| 479 | } |
| 480 | else if (ctrl.type == NYQ_CTRL_CHOICE) |
| 481 | { |
| 482 | S.AddSpace(10, 10); |
| 483 | |
| 484 | S.Id(ID_Choice + i).AddChoice( {}, |
| 485 | Msgids( ctrl.choices.data(), ctrl.choices.size() ) ); |
| 486 | } |
| 487 | else if (ctrl.type == NYQ_CTRL_TIME) |
| 488 | { |
| 489 | S.AddSpace(10, 10); |
| 490 | |
| 491 | const auto options = NumericTextCtrl::Options{} |
| 492 | .AutoPos(true) |
| 493 | .MenuEnabled(true) |
| 494 | .ReadOnly(false); |
| 495 | |
| 496 | NumericTextCtrl *time = safenew |
| 497 | NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate), |
| 498 | S.GetParent(), (ID_Time + i), |
| 499 | NumericConverterType_TIME(), |
| 500 | GetSelectionFormat(), |
| 501 | ctrl.val, |
nothing calls this directly
no test coverage detected