MCPcopy Create free account
hub / github.com/audacity/audacity / ShowComboDialog

Method ShowComboDialog

src/toolbars/DeviceToolBar.cpp:715–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713}
714
715void DeviceToolBar::ShowComboDialog(wxChoice *combo, const TranslatableString &title)
716{
717 if (!combo || combo->GetCount() == 0) {
718 AudacityMessageBox( XO("Device information is not available.") );
719 return;
720 }
721
722#if USE_PORTMIXER
723 wxArrayStringEx inputSources = combo->GetStrings();
724
725 wxDialogWrapper dlg(nullptr, wxID_ANY, title);
726 dlg.SetName();
727 ShuttleGui S(&dlg, eIsCreating);
728 wxChoice *c;
729
730 S.StartVerticalLay(true);
731 {
732 S.StartHorizontalLay(wxCENTER, false);
733 {
734 c = S.AddChoice( Verbatim( combo->GetName() ),
735 transform_container<TranslatableStrings>( inputSources, Verbatim ),
736 combo->GetSelection());
737 c->SetMinSize(c->GetBestSize());
738 }
739 S.EndHorizontalLay();
740 }
741 S.EndVerticalLay();
742 S.AddStandardButtons();
743
744 dlg.GetSizer()->SetSizeHints(&dlg);
745 dlg.Center();
746
747 if (dlg.ShowModal() == wxID_OK)
748 {
749 wxCommandEvent dummyEvent;
750 dummyEvent.SetEventObject(combo);
751 // SetSelection() doesn't send an event, so we call OnChoice explicitly
752 combo->SetSelection(c->GetSelection());
753 OnChoice(dummyEvent);
754 }
755#endif
756}
757
758static RegisteredToolbarFactory factory{
759 []( AudacityProject &project ){

Callers

nothing calls this directly

Calls 11

AudacityMessageBoxFunction · 0.85
VerbatimFunction · 0.85
AddChoiceMethod · 0.80
GetBestSizeMethod · 0.80
GetSizerMethod · 0.80
GetCountMethod · 0.45
SetNameMethod · 0.45
GetNameMethod · 0.45
GetSelectionMethod · 0.45
ShowModalMethod · 0.45
SetSelectionMethod · 0.45

Tested by

no test coverage detected