1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-24 08:10:05 +02:00

ExportMixerDialog uses ShuttleGui

This commit is contained in:
Paul Licameli 2017-10-27 10:05:30 -04:00
parent ab2e50102d
commit bed7b41af9

View File

@ -1411,42 +1411,45 @@ ExportMixerDialog::ExportMixerDialog( const TrackList *tracks, bool selectedOnly
mMixerSpec = std::make_unique<MixerSpec>(numTracks, maxNumChannels); mMixerSpec = std::make_unique<MixerSpec>(numTracks, maxNumChannels);
wxBoxSizer *vertSizer; auto label = XO("Output Channels: %2d")
.Format( mMixerSpec->GetNumChannels() );
ShuttleGui S{ this, eIsCreating };
{ {
auto uVertSizer = std::make_unique<wxBoxSizer>(wxVERTICAL); S.SetBorder( 5 );
vertSizer = uVertSizer.get();
wxWindow *mixerPanel = safenew ExportMixerPanel(this, ID_MIXERPANEL, auto mixerPanel = safenew ExportMixerPanel(
mMixerSpec.get(), mTrackNames, S.GetParent(), ID_MIXERPANEL, mMixerSpec.get(),
wxDefaultPosition, wxSize(400, -1)); mTrackNames, wxDefaultPosition, wxSize(400, -1));
mixerPanel->SetName(_("Mixer Panel")); S.Prop(1)
vertSizer->Add(mixerPanel, 1, wxEXPAND | wxALL, 5); .Name(XO("Mixer Panel"))
.Position(wxEXPAND | wxALL)
.AddWindow(mixerPanel);
S.StartHorizontalLay(wxALIGN_CENTRE | wxALL, 0);
{ {
auto horSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL); mChannelsText = S.AddVariableText(
label.Translation(),
false, wxALIGN_LEFT | wxALL );
wxString label; S
label.Printf(_("Output Channels: %2d"), mMixerSpec->GetNumChannels()); .Id(ID_SLIDER_CHANNEL)
mChannelsText = safenew wxStaticText(this, -1, label); .Name(label)
horSizer->Add(mChannelsText, 0, wxALIGN_LEFT | wxALL, 5); .Size({300, -1})
.Style(wxSL_HORIZONTAL)
wxSlider *channels = safenew wxSliderWrapper(this, ID_SLIDER_CHANNEL, .Position(wxEXPAND | wxALL)
mMixerSpec->GetNumChannels(), 1, mMixerSpec->GetMaxNumChannels(), .AddSlider( {},
wxDefaultPosition, wxSize(300, -1)); mMixerSpec->GetNumChannels(),
channels->SetName(label); mMixerSpec->GetMaxNumChannels(), 1 );
horSizer->Add(channels, 0, wxEXPAND | wxALL, 5);
vertSizer->Add(horSizer.release(), 0, wxALIGN_CENTRE | wxALL, 5);
} }
S.EndHorizontalLay();
vertSizer->Add(CreateStdButtonSizer(this, eCancelButton | eOkButton | eHelpButton).release(), 0, wxEXPAND); S.AddStandardButtons( eCancelButton | eOkButton | eHelpButton );
SetAutoLayout(true);
SetSizer(uVertSizer.release());
} }
vertSizer->Fit( this ); SetAutoLayout(true);
vertSizer->SetSizeHints( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
SetSizeHints( 640, 480, 20000, 20000 ); SetSizeHints( 640, 480, 20000, 20000 );