sizers
This commit is contained in:
parent
4d154c4d97
commit
84c0a0b666
|
@ -52,7 +52,6 @@ class AboutDialog:public wxDialog {
|
||||||
|
|
||||||
void OnOK(wxCommandEvent & event);
|
void OnOK(wxCommandEvent & event);
|
||||||
|
|
||||||
wxBoxSizer *topsizer;
|
|
||||||
wxStaticBitmap *icon;
|
wxStaticBitmap *icon;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|
|
@ -105,38 +105,42 @@ LabelDialog::LabelDialog(wxWindow *parent,
|
||||||
{
|
{
|
||||||
SetName(GetTitle());
|
SetName(GetTitle());
|
||||||
|
|
||||||
// Create the main sizer
|
{
|
||||||
wxBoxSizer *vs = new wxBoxSizer(wxVERTICAL);
|
// Create the main sizer
|
||||||
|
auto vs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
|
||||||
// A little instruction
|
// A little instruction
|
||||||
wxStaticText *instruct =
|
wxStaticText *instruct =
|
||||||
safenew wxStaticText(this,
|
safenew wxStaticText(this,
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
_("Press F2 or double click to edit cell contents."));
|
_("Press F2 or double click to edit cell contents."));
|
||||||
instruct->SetName(instruct->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
instruct->SetName(instruct->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
||||||
vs->Add(instruct,
|
vs->Add(instruct,
|
||||||
0,
|
0,
|
||||||
wxALIGN_LEFT | wxALL,
|
wxALIGN_LEFT | wxALL,
|
||||||
5);
|
5);
|
||||||
|
|
||||||
// Create the main sizer
|
// Create the main sizer
|
||||||
mGrid = new Grid(this, wxID_ANY);
|
mGrid = new Grid(this, wxID_ANY);
|
||||||
vs->Add(mGrid, 1, wxEXPAND | wxALL, 5);
|
vs->Add(mGrid, 1, wxEXPAND | wxALL, 5);
|
||||||
|
|
||||||
// Create the action buttons
|
// Create the action buttons
|
||||||
wxBoxSizer *hs = new wxBoxSizer(wxHORIZONTAL);
|
{
|
||||||
hs->Add(safenew wxButton(this, ID_INSERTA, _("Insert &After")), 1, wxCENTER | wxALL, 5);
|
auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
hs->Add(safenew wxButton(this, ID_INSERTB, _("Insert &Before")), 1, wxCENTER | wxALL, 5);
|
hs->Add(safenew wxButton(this, ID_INSERTA, _("Insert &After")), 1, wxCENTER | wxALL, 5);
|
||||||
hs->Add(safenew wxButton(this, ID_REMOVE, _("&Remove")), 1, wxCENTER | wxALL, 5);
|
hs->Add(safenew wxButton(this, ID_INSERTB, _("Insert &Before")), 1, wxCENTER | wxALL, 5);
|
||||||
hs->Add(safenew wxButton(this, ID_IMPORT, _("&Import...")), 1, wxCENTER | wxALL, 5);
|
hs->Add(safenew wxButton(this, ID_REMOVE, _("&Remove")), 1, wxCENTER | wxALL, 5);
|
||||||
hs->Add(safenew wxButton(this, ID_EXPORT, _("&Export...")), 1, wxCENTER | wxALL, 5);
|
hs->Add(safenew wxButton(this, ID_IMPORT, _("&Import...")), 1, wxCENTER | wxALL, 5);
|
||||||
vs->Add(hs, 0, wxEXPAND | wxCENTER | wxALL, 5);
|
hs->Add(safenew wxButton(this, ID_EXPORT, _("&Export...")), 1, wxCENTER | wxALL, 5);
|
||||||
|
vs->Add(hs.release(), 0, wxEXPAND | wxCENTER | wxALL, 5);
|
||||||
|
}
|
||||||
|
|
||||||
// Create the exit buttons
|
// Create the exit buttons
|
||||||
vs->Add(CreateStdButtonSizer(this, eCancelButton|eOkButton), 0, wxEXPAND);
|
vs->Add(CreateStdButtonSizer(this, eCancelButton | eOkButton).release(), 0, wxEXPAND);
|
||||||
|
|
||||||
// Make it so
|
// Make it so
|
||||||
SetSizer(vs);
|
SetSizer(vs.release());
|
||||||
|
}
|
||||||
|
|
||||||
// Build the initial (empty) grid
|
// Build the initial (empty) grid
|
||||||
mGrid->CreateGrid(0, Col_Max);
|
mGrid->CreateGrid(0, Col_Max);
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ MixerBoard::MixerBoard(AudacityProject* pProject,
|
||||||
mScrolledWindow->SetVirtualSize(size);
|
mScrolledWindow->SetVirtualSize(size);
|
||||||
|
|
||||||
/* This doesn't work to make the mScrolledWindow automatically resize, so do it explicitly in OnSize.
|
/* This doesn't work to make the mScrolledWindow automatically resize, so do it explicitly in OnSize.
|
||||||
wxBoxSizer* pBoxSizer = new wxBoxSizer(wxVERTICAL);
|
auto pBoxSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
pBoxSizer->Add(mScrolledWindow, 0, wxExpand, 0);
|
pBoxSizer->Add(mScrolledWindow, 0, wxExpand, 0);
|
||||||
this->SetAutoLayout(true);
|
this->SetAutoLayout(true);
|
||||||
this->SetSizer(pBoxSizer);
|
this->SetSizer(pBoxSizer);
|
||||||
|
|
|
@ -927,7 +927,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize,
|
||||||
wxNO_BORDER);
|
wxNO_BORDER);
|
||||||
mMainPanel->SetSizer( new wxBoxSizer(wxVERTICAL) );
|
mMainPanel->SetSizer( safenew wxBoxSizer(wxVERTICAL) );
|
||||||
pPage = mMainPanel;
|
pPage = mMainPanel;
|
||||||
// Set the colour here to the track panel background to avoid
|
// Set the colour here to the track panel background to avoid
|
||||||
// flicker when Audacity starts up.
|
// flicker when Audacity starts up.
|
||||||
|
@ -937,13 +937,17 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||||
//pPage->SetBackgroundColour( theTheme.Colour( clrDark ));
|
//pPage->SetBackgroundColour( theTheme.Colour( clrDark ));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxBoxSizer *bs = new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer *bs;
|
||||||
bs->Add( mToolManager->GetTopDock(), 0, wxEXPAND | wxALIGN_TOP );
|
{
|
||||||
bs->Add( mRuler, 0, wxEXPAND );
|
auto ubs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
bs->Add( pPage, 1, wxEXPAND );
|
bs = ubs.get();
|
||||||
bs->Add( mToolManager->GetBotDock(), 0, wxEXPAND );
|
bs->Add(mToolManager->GetTopDock(), 0, wxEXPAND | wxALIGN_TOP);
|
||||||
SetAutoLayout( true );
|
bs->Add(mRuler, 0, wxEXPAND);
|
||||||
SetSizer( bs );
|
bs->Add(pPage, 1, wxEXPAND);
|
||||||
|
bs->Add(mToolManager->GetBotDock(), 0, wxEXPAND);
|
||||||
|
SetAutoLayout(true);
|
||||||
|
SetSizer(ubs.release());
|
||||||
|
}
|
||||||
bs->Layout();
|
bs->Layout();
|
||||||
|
|
||||||
// The right hand side translates to NEW TrackPanel(... in normal
|
// The right hand side translates to NEW TrackPanel(... in normal
|
||||||
|
@ -972,33 +976,37 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||||
// keyboard focus problems.
|
// keyboard focus problems.
|
||||||
pPage->MoveBeforeInTabOrder(mToolManager->GetTopDock());
|
pPage->MoveBeforeInTabOrder(mToolManager->GetTopDock());
|
||||||
|
|
||||||
bs = (wxBoxSizer *) pPage->GetSizer();
|
bs = (wxBoxSizer *)pPage->GetSizer();
|
||||||
|
|
||||||
wxBoxSizer *hs;
|
{
|
||||||
wxBoxSizer *vs;
|
// Top horizontal grouping
|
||||||
|
auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
// Top horizontal grouping
|
// Track panel
|
||||||
hs = new wxBoxSizer( wxHORIZONTAL );
|
hs->Add(mTrackPanel, 1, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP);
|
||||||
|
|
||||||
// Track panel
|
{
|
||||||
hs->Add( mTrackPanel, 1, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP );
|
// Vertical grouping
|
||||||
|
auto vs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
|
||||||
// Vertical grouping
|
// Vertical scroll bar
|
||||||
vs = new wxBoxSizer( wxVERTICAL );
|
vs->Add(mVsbar, 1, wxEXPAND | wxALIGN_TOP);
|
||||||
|
hs->Add(vs.release(), 0, wxEXPAND | wxALIGN_TOP);
|
||||||
|
}
|
||||||
|
|
||||||
// Vertical scroll bar
|
bs->Add(hs.release(), 1, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP);
|
||||||
vs->Add( mVsbar, 1, wxEXPAND | wxALIGN_TOP );
|
}
|
||||||
hs->Add( vs, 0, wxEXPAND | wxALIGN_TOP );
|
|
||||||
bs->Add( hs, 1, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP );
|
|
||||||
|
|
||||||
// Bottom horizontal grouping
|
{
|
||||||
hs = new wxBoxSizer( wxHORIZONTAL );
|
// Bottom horizontal grouping
|
||||||
|
auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
// Bottom scrollbar
|
// Bottom scrollbar
|
||||||
hs->Add( mTrackPanel->GetLeftOffset() - 1, 0 );
|
hs->Add(mTrackPanel->GetLeftOffset() - 1, 0);
|
||||||
hs->Add( mHsbar, 1, wxALIGN_BOTTOM );
|
hs->Add(mHsbar, 1, wxALIGN_BOTTOM);
|
||||||
hs->Add( mVsbar->GetSize().GetWidth(), 0 );
|
hs->Add(mVsbar->GetSize().GetWidth(), 0);
|
||||||
bs->Add( hs, 0, wxEXPAND | wxALIGN_LEFT );
|
bs->Add(hs.release(), 0, wxEXPAND | wxALIGN_LEFT);
|
||||||
|
}
|
||||||
|
|
||||||
// Lay it out
|
// Lay it out
|
||||||
pPage->SetAutoLayout(true);
|
pPage->SetAutoLayout(true);
|
||||||
|
|
|
@ -707,7 +707,7 @@ wxStaticBox * ShuttleGuiBase::StartStatic(const wxString &Str, int iProp)
|
||||||
Str );
|
Str );
|
||||||
pBox->SetLabel( Str );
|
pBox->SetLabel( Str );
|
||||||
pBox->SetName(wxStripMenuCodes(Str));
|
pBox->SetName(wxStripMenuCodes(Str));
|
||||||
mpSubSizer = new wxStaticBoxSizer(
|
mpSubSizer = std::make_unique<wxStaticBoxSizer>(
|
||||||
pBox,
|
pBox,
|
||||||
wxVERTICAL );
|
wxVERTICAL );
|
||||||
miSizerProp = iProp;
|
miSizerProp = iProp;
|
||||||
|
@ -973,7 +973,7 @@ void ShuttleGuiBase::StartHorizontalLay( int PositionFlags, int iProp)
|
||||||
if( mShuttleMode != eIsCreating )
|
if( mShuttleMode != eIsCreating )
|
||||||
return;
|
return;
|
||||||
miSizerProp=iProp;
|
miSizerProp=iProp;
|
||||||
mpSubSizer = new wxBoxSizer( wxHORIZONTAL );
|
mpSubSizer = std::make_unique<wxBoxSizer>( wxHORIZONTAL );
|
||||||
UpdateSizersCore( false, PositionFlags | wxALL );
|
UpdateSizersCore( false, PositionFlags | wxALL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -989,7 +989,7 @@ void ShuttleGuiBase::StartVerticalLay(int iProp)
|
||||||
if( mShuttleMode != eIsCreating )
|
if( mShuttleMode != eIsCreating )
|
||||||
return;
|
return;
|
||||||
miSizerProp=iProp;
|
miSizerProp=iProp;
|
||||||
mpSubSizer = new wxBoxSizer( wxVERTICAL );
|
mpSubSizer = std::make_unique<wxBoxSizer>( wxVERTICAL );
|
||||||
UpdateSizers();
|
UpdateSizers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1004,7 +1004,7 @@ void ShuttleGuiBase::StartMultiColumn(int nCols, int PositionFlags)
|
||||||
{
|
{
|
||||||
if( mShuttleMode != eIsCreating )
|
if( mShuttleMode != eIsCreating )
|
||||||
return;
|
return;
|
||||||
mpSubSizer = new wxFlexGridSizer( nCols );
|
mpSubSizer = std::make_unique<wxFlexGridSizer>( nCols );
|
||||||
UpdateSizersCore( false, PositionFlags | wxALL );
|
UpdateSizersCore( false, PositionFlags | wxALL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1935,16 +1935,16 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags)
|
||||||
{
|
{
|
||||||
// When adding sizers into sizers, don't add a border.
|
// When adding sizers into sizers, don't add a border.
|
||||||
// unless it's a static box sizer.
|
// unless it's a static box sizer.
|
||||||
if( wxDynamicCast( mpSubSizer, wxStaticBoxSizer ))
|
wxSizer *const pSubSizer = mpSubSizer.get();
|
||||||
|
if (wxDynamicCast(pSubSizer, wxStaticBoxSizer))
|
||||||
{
|
{
|
||||||
mpSizer->Add( mpSubSizer,miSizerProp, Flags , miBorder);
|
mpSizer->Add( mpSubSizer.release(), miSizerProp, Flags , miBorder);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mpSizer->Add( mpSubSizer,miSizerProp, Flags ,0);//miBorder);
|
mpSizer->Add( mpSubSizer.release(), miSizerProp, Flags ,0);//miBorder);
|
||||||
}
|
}
|
||||||
mpSizer = mpSubSizer;
|
mpSizer = pSubSizer;
|
||||||
mpSubSizer = NULL;
|
|
||||||
PushSizer();
|
PushSizer();
|
||||||
}
|
}
|
||||||
mpLastWind = mpWind;
|
mpLastWind = mpWind;
|
||||||
|
@ -2116,7 +2116,7 @@ AttachableScrollBar * ShuttleGui::AddAttachableScrollBar( long style )
|
||||||
return pAttachableScrollBar;
|
return pAttachableScrollBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSizer *CreateStdButtonSizer(wxWindow *parent, long buttons, wxWindow *extra)
|
std::unique_ptr<wxSizer> CreateStdButtonSizer(wxWindow *parent, long buttons, wxWindow *extra)
|
||||||
{
|
{
|
||||||
wxASSERT(parent != NULL); // To justify safenew
|
wxASSERT(parent != NULL); // To justify safenew
|
||||||
|
|
||||||
|
@ -2136,7 +2136,7 @@ wxSizer *CreateStdButtonSizer(wxWindow *parent, long buttons, wxWindow *extra)
|
||||||
}
|
}
|
||||||
|
|
||||||
wxButton *b = NULL;
|
wxButton *b = NULL;
|
||||||
wxStdDialogButtonSizer *bs = new wxStdDialogButtonSizer();
|
auto bs = std::make_unique<wxStdDialogButtonSizer>();
|
||||||
|
|
||||||
if( buttons & eOkButton )
|
if( buttons & eOkButton )
|
||||||
{
|
{
|
||||||
|
@ -2226,9 +2226,8 @@ wxSizer *CreateStdButtonSizer(wxWindow *parent, long buttons, wxWindow *extra)
|
||||||
bs->Insert( lastLastSpacer + 1, b, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
|
bs->Insert( lastLastSpacer + 1, b, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, margin );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSizer * s;
|
std::unique_ptr<wxSizer> s = std::make_unique<wxBoxSizer>( wxVERTICAL );
|
||||||
s = new wxBoxSizer( wxVERTICAL );
|
s->Add( bs.release(), 1, wxEXPAND | wxALL, 7 );
|
||||||
s->Add( bs, 1, wxEXPAND | wxALL, 7 );
|
|
||||||
s->Add( 0, 3 ); // a little extra space
|
s->Add( 0, 3 ); // a little extra space
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
|
|
@ -313,7 +313,7 @@ protected:
|
||||||
// Proportion set by user rather than default.
|
// Proportion set by user rather than default.
|
||||||
int miPropSetByUser;
|
int miPropSetByUser;
|
||||||
|
|
||||||
wxSizer * mpSubSizer;
|
std::unique_ptr<wxSizer> mpSubSizer;
|
||||||
wxSizer * mpSizer;
|
wxSizer * mpSizer;
|
||||||
wxWindow * mpParent;
|
wxWindow * mpParent;
|
||||||
wxWindow * mpWind;
|
wxWindow * mpWind;
|
||||||
|
@ -358,7 +358,7 @@ enum
|
||||||
eCloseID = wxID_CANCEL
|
eCloseID = wxID_CANCEL
|
||||||
};
|
};
|
||||||
|
|
||||||
AUDACITY_DLL_API wxSizer *CreateStdButtonSizer( wxWindow *parent,
|
AUDACITY_DLL_API std::unique_ptr<wxSizer> CreateStdButtonSizer( wxWindow *parent,
|
||||||
long buttons = eOkButton | eCancelButton,
|
long buttons = eOkButton | eCancelButton,
|
||||||
wxWindow *extra = NULL );
|
wxWindow *extra = NULL );
|
||||||
|
|
||||||
|
|
|
@ -2887,175 +2887,179 @@ int EffectUIHost::ShowModal()
|
||||||
|
|
||||||
bool EffectUIHost::Initialize()
|
bool EffectUIHost::Initialize()
|
||||||
{
|
{
|
||||||
wxBoxSizer *vs = new wxBoxSizer(wxVERTICAL);
|
|
||||||
wxBoxSizer *hs = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
|
|
||||||
EffectPanel *w = safenew EffectPanel(this);
|
EffectPanel *w = safenew EffectPanel(this);
|
||||||
|
|
||||||
// Try to give the window a sensible default/minimum size
|
|
||||||
w->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
|
|
||||||
mParent->GetSize().GetHeight() / 2));
|
|
||||||
|
|
||||||
mDisableTransport = !gAudioIO->IsAvailable(mProject);
|
|
||||||
mPlaying = gAudioIO->IsStreamActive(); // not exactly right, but will suffice
|
|
||||||
mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0;
|
|
||||||
|
|
||||||
if (!mClient->PopulateUI(w))
|
|
||||||
{
|
{
|
||||||
return false;
|
auto vs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
}
|
{
|
||||||
|
auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
hs->Add(w, 1, wxEXPAND);
|
// Try to give the window a sensible default/minimum size
|
||||||
vs->Add(hs, 1, wxEXPAND);
|
w->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
|
||||||
|
mParent->GetSize().GetHeight() / 2));
|
||||||
|
|
||||||
wxPanel *buttonPanel = safenew wxPanel(this, wxID_ANY);
|
mDisableTransport = !gAudioIO->IsAvailable(mProject);
|
||||||
wxPanel *const bar = safenew wxPanel(buttonPanel, wxID_ANY);
|
mPlaying = gAudioIO->IsStreamActive(); // not exactly right, but will suffice
|
||||||
|
mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0;
|
||||||
|
|
||||||
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
if (!mClient->PopulateUI(w))
|
||||||
bar->SetName(wxT("\a"));
|
{
|
||||||
bar->SetLabel(wxT("\a"));
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
|
hs->Add(w, 1, wxEXPAND);
|
||||||
|
vs->Add(hs.release(), 1, wxEXPAND);
|
||||||
|
}
|
||||||
|
|
||||||
mSupportsRealtime = mEffect->SupportsRealtime();
|
wxPanel *buttonPanel = safenew wxPanel(this, wxID_ANY);
|
||||||
mIsGUI = mClient->IsGraphicalUI();
|
wxPanel *const bar = safenew wxPanel(buttonPanel, wxID_ANY);
|
||||||
mIsBatch = mEffect->IsBatchProcessing();
|
|
||||||
|
|
||||||
wxBitmapButton *bb;
|
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
||||||
|
bar->SetName(wxT("\a"));
|
||||||
|
bar->SetLabel(wxT("\a"));
|
||||||
|
|
||||||
int margin = 0;
|
wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
|
mSupportsRealtime = mEffect->SupportsRealtime();
|
||||||
|
mIsGUI = mClient->IsGraphicalUI();
|
||||||
|
mIsBatch = mEffect->IsBatchProcessing();
|
||||||
|
|
||||||
|
wxBitmapButton *bb;
|
||||||
|
|
||||||
|
int margin = 0;
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
margin = 3; // I'm sure it's needed because of the order things are created...
|
margin = 3; // I'm sure it's needed because of the order things are created...
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!mIsGUI)
|
|
||||||
{
|
|
||||||
wxASSERT(bar); // To justify safenew
|
|
||||||
mMenuBtn = safenew wxButton(bar, kMenuID, _("&Manage"));
|
|
||||||
bs->Add(mMenuBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wxASSERT(bar); // To justify safenew
|
|
||||||
mMenuBtn = safenew wxBitmapButton(bar, kMenuID, CreateBitmap(effect_menu_xpm, true, false));
|
|
||||||
#if defined(__WXMAC__)
|
|
||||||
mMenuBtn->SetName(_("&Manage"));
|
|
||||||
#else
|
|
||||||
mMenuBtn->SetLabel(_("&Manage"));
|
|
||||||
#endif
|
|
||||||
bs->Add(mMenuBtn);
|
|
||||||
}
|
|
||||||
mMenuBtn->SetToolTip(_("Manage presets and options"));
|
|
||||||
|
|
||||||
bs->Add(5, 5);
|
|
||||||
|
|
||||||
if (!mIsBatch)
|
|
||||||
{
|
|
||||||
if (!mIsGUI)
|
if (!mIsGUI)
|
||||||
{
|
{
|
||||||
if (mSupportsRealtime)
|
wxASSERT(bar); // To justify safenew
|
||||||
{
|
mMenuBtn = safenew wxButton(bar, kMenuID, _("&Manage"));
|
||||||
wxASSERT(bar); // To justify safenew
|
bs->Add(mMenuBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
||||||
mPlayToggleBtn = safenew wxButton(bar, kPlayID, _("Start &Playback"));
|
|
||||||
mPlayToggleBtn->SetToolTip(_("Start and stop playback"));
|
|
||||||
bs->Add(mPlayToggleBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
|
||||||
}
|
|
||||||
else if (mEffect->GetType() != EffectTypeAnalyze)
|
|
||||||
{
|
|
||||||
wxASSERT(bar); // To justify safenew
|
|
||||||
mPlayToggleBtn = safenew wxButton(bar, kPlayID, _("&Preview"));
|
|
||||||
mPlayToggleBtn->SetToolTip(_("Preview effect"));
|
|
||||||
bs->Add(mPlayToggleBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mPlayBM = CreateBitmap(effect_play_xpm, true, false);
|
|
||||||
mPlayDisabledBM = CreateBitmap(effect_play_disabled_xpm, true, false);
|
|
||||||
mStopBM = CreateBitmap(effect_stop_xpm, true, false);
|
|
||||||
mStopDisabledBM = CreateBitmap(effect_stop_disabled_xpm, true, false);
|
|
||||||
wxASSERT(bar); // To justify safenew
|
wxASSERT(bar); // To justify safenew
|
||||||
bb = safenew wxBitmapButton(bar, kPlayID, mPlayBM);
|
mMenuBtn = safenew wxBitmapButton(bar, kMenuID, CreateBitmap(effect_menu_xpm, true, false));
|
||||||
bb->SetBitmapDisabled(mPlayDisabledBM);
|
|
||||||
mPlayBtn = bb;
|
|
||||||
bs->Add(mPlayBtn);
|
|
||||||
if (!mSupportsRealtime)
|
|
||||||
{
|
|
||||||
mPlayBtn->SetToolTip(_("Preview effect"));
|
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
mPlayBtn->SetName(_("Preview effect"));
|
mMenuBtn->SetName(_("&Manage"));
|
||||||
#else
|
#else
|
||||||
mPlayBtn->SetLabel(_("&Preview effect"));
|
mMenuBtn->SetLabel(_("&Manage"));
|
||||||
#endif
|
#endif
|
||||||
}
|
bs->Add(mMenuBtn);
|
||||||
}
|
}
|
||||||
|
mMenuBtn->SetToolTip(_("Manage presets and options"));
|
||||||
|
|
||||||
if (mSupportsRealtime)
|
bs->Add(5, 5);
|
||||||
|
|
||||||
|
if (!mIsBatch)
|
||||||
{
|
{
|
||||||
if (!mIsGUI)
|
if (!mIsGUI)
|
||||||
{
|
{
|
||||||
wxASSERT(bar); // To justify safenew
|
if (mSupportsRealtime)
|
||||||
mRewindBtn = safenew wxButton(bar, kRewindID, _("Skip &Backward"));
|
{
|
||||||
bs->Add(mRewindBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
wxASSERT(bar); // To justify safenew
|
||||||
|
mPlayToggleBtn = safenew wxButton(bar, kPlayID, _("Start &Playback"));
|
||||||
|
mPlayToggleBtn->SetToolTip(_("Start and stop playback"));
|
||||||
|
bs->Add(mPlayToggleBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
||||||
|
}
|
||||||
|
else if (mEffect->GetType() != EffectTypeAnalyze)
|
||||||
|
{
|
||||||
|
wxASSERT(bar); // To justify safenew
|
||||||
|
mPlayToggleBtn = safenew wxButton(bar, kPlayID, _("&Preview"));
|
||||||
|
mPlayToggleBtn->SetToolTip(_("Preview effect"));
|
||||||
|
bs->Add(mPlayToggleBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
mPlayBM = CreateBitmap(effect_play_xpm, true, false);
|
||||||
|
mPlayDisabledBM = CreateBitmap(effect_play_disabled_xpm, true, false);
|
||||||
|
mStopBM = CreateBitmap(effect_stop_xpm, true, false);
|
||||||
|
mStopDisabledBM = CreateBitmap(effect_stop_disabled_xpm, true, false);
|
||||||
wxASSERT(bar); // To justify safenew
|
wxASSERT(bar); // To justify safenew
|
||||||
bb = safenew wxBitmapButton(bar, kRewindID, CreateBitmap(effect_rewind_xpm, true, true));
|
bb = safenew wxBitmapButton(bar, kPlayID, mPlayBM);
|
||||||
bb->SetBitmapDisabled(CreateBitmap(effect_rewind_disabled_xpm, true, true));
|
bb->SetBitmapDisabled(mPlayDisabledBM);
|
||||||
mRewindBtn = bb;
|
mPlayBtn = bb;
|
||||||
|
bs->Add(mPlayBtn);
|
||||||
|
if (!mSupportsRealtime)
|
||||||
|
{
|
||||||
|
mPlayBtn->SetToolTip(_("Preview effect"));
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
mRewindBtn->SetName(_("Skip &Backward"));
|
mPlayBtn->SetName(_("Preview effect"));
|
||||||
#else
|
#else
|
||||||
mRewindBtn->SetLabel(_("Skip &Backward"));
|
mPlayBtn->SetLabel(_("&Preview effect"));
|
||||||
#endif
|
#endif
|
||||||
bs->Add(mRewindBtn);
|
}
|
||||||
}
|
}
|
||||||
mRewindBtn->SetToolTip(_("Skip backward"));
|
|
||||||
|
|
||||||
if (!mIsGUI)
|
if (mSupportsRealtime)
|
||||||
{
|
{
|
||||||
wxASSERT(bar); // To justify safenew
|
if (!mIsGUI)
|
||||||
mFFwdBtn = safenew wxButton(bar, kFFwdID, _("Skip &Forward"));
|
{
|
||||||
bs->Add(mFFwdBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
wxASSERT(bar); // To justify safenew
|
||||||
}
|
mRewindBtn = safenew wxButton(bar, kRewindID, _("Skip &Backward"));
|
||||||
else
|
bs->Add(mRewindBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
||||||
{
|
}
|
||||||
wxASSERT(bar); // To justify safenew
|
else
|
||||||
bb = safenew wxBitmapButton(bar, kFFwdID, CreateBitmap(effect_ffwd_xpm, true, true));
|
{
|
||||||
bb->SetBitmapDisabled(CreateBitmap(effect_ffwd_disabled_xpm, true, true));
|
wxASSERT(bar); // To justify safenew
|
||||||
mFFwdBtn = bb;
|
bb = safenew wxBitmapButton(bar, kRewindID, CreateBitmap(effect_rewind_xpm, true, true));
|
||||||
|
bb->SetBitmapDisabled(CreateBitmap(effect_rewind_disabled_xpm, true, true));
|
||||||
|
mRewindBtn = bb;
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
mFFwdBtn->SetName(_("Skip &Foreward"));
|
mRewindBtn->SetName(_("Skip &Backward"));
|
||||||
#else
|
#else
|
||||||
mFFwdBtn->SetLabel(_("Skip &Foreward"));
|
mRewindBtn->SetLabel(_("Skip &Backward"));
|
||||||
#endif
|
#endif
|
||||||
bs->Add(mFFwdBtn);
|
bs->Add(mRewindBtn);
|
||||||
|
}
|
||||||
|
mRewindBtn->SetToolTip(_("Skip backward"));
|
||||||
|
|
||||||
|
if (!mIsGUI)
|
||||||
|
{
|
||||||
|
wxASSERT(bar); // To justify safenew
|
||||||
|
mFFwdBtn = safenew wxButton(bar, kFFwdID, _("Skip &Forward"));
|
||||||
|
bs->Add(mFFwdBtn, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxASSERT(bar); // To justify safenew
|
||||||
|
bb = safenew wxBitmapButton(bar, kFFwdID, CreateBitmap(effect_ffwd_xpm, true, true));
|
||||||
|
bb->SetBitmapDisabled(CreateBitmap(effect_ffwd_disabled_xpm, true, true));
|
||||||
|
mFFwdBtn = bb;
|
||||||
|
#if defined(__WXMAC__)
|
||||||
|
mFFwdBtn->SetName(_("Skip &Foreward"));
|
||||||
|
#else
|
||||||
|
mFFwdBtn->SetLabel(_("Skip &Foreward"));
|
||||||
|
#endif
|
||||||
|
bs->Add(mFFwdBtn);
|
||||||
|
}
|
||||||
|
mFFwdBtn->SetToolTip(_("Skip forward"));
|
||||||
|
|
||||||
|
bs->Add(5, 5);
|
||||||
|
|
||||||
|
mEnableCb = safenew wxCheckBox(bar, kEnableID, _("&Enable"));
|
||||||
|
mEnableCb->SetValue(mEnabled);
|
||||||
|
mEnableCb->SetName(_("Enable"));
|
||||||
|
bs->Add(mEnableCb, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
||||||
}
|
}
|
||||||
mFFwdBtn->SetToolTip(_("Skip forward"));
|
|
||||||
|
|
||||||
bs->Add(5, 5);
|
|
||||||
|
|
||||||
mEnableCb = safenew wxCheckBox(bar, kEnableID, _("&Enable"));
|
|
||||||
mEnableCb->SetValue(mEnabled);
|
|
||||||
mEnableCb->SetName(_("Enable"));
|
|
||||||
bs->Add(mEnableCb, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, margin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bar->SetSizerAndFit(bs);
|
||||||
|
|
||||||
|
long buttons = eApplyButton + eCloseButton;
|
||||||
|
if (mEffect->mUIDebug)
|
||||||
|
{
|
||||||
|
buttons += eDebugButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
buttonPanel->SetSizer(CreateStdButtonSizer(buttonPanel, buttons, bar).release());
|
||||||
|
vs->Add(buttonPanel, 0, wxEXPAND);
|
||||||
|
|
||||||
|
SetSizer(vs.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
bar->SetSizerAndFit(bs);
|
|
||||||
|
|
||||||
long buttons = eApplyButton + eCloseButton;
|
|
||||||
if (mEffect->mUIDebug)
|
|
||||||
{
|
|
||||||
buttons += eDebugButton;
|
|
||||||
}
|
|
||||||
|
|
||||||
buttonPanel->SetSizer(CreateStdButtonSizer(buttonPanel, buttons, bar));
|
|
||||||
vs->Add(buttonPanel, 0, wxEXPAND);
|
|
||||||
|
|
||||||
SetSizer(vs);
|
|
||||||
Layout();
|
Layout();
|
||||||
Fit();
|
Fit();
|
||||||
Center();
|
Center();
|
||||||
|
|
|
@ -104,10 +104,12 @@ EffectRack::EffectRack()
|
||||||
mRemovePushed = CreateBitmap(remove_16x16_xpm, false, true);
|
mRemovePushed = CreateBitmap(remove_16x16_xpm, false, true);
|
||||||
mRemoveRaised = CreateBitmap(remove_16x16_xpm, true, true);
|
mRemoveRaised = CreateBitmap(remove_16x16_xpm, true, true);
|
||||||
|
|
||||||
wxBoxSizer *bs = new wxBoxSizer(wxVERTICAL);
|
{
|
||||||
mPanel = safenew wxPanel(this, wxID_ANY);
|
auto bs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
bs->Add(mPanel, 1, wxEXPAND);
|
mPanel = safenew wxPanel(this, wxID_ANY);
|
||||||
SetSizer(bs);
|
bs->Add(mPanel, 1, wxEXPAND);
|
||||||
|
SetSizer(bs.release());
|
||||||
|
}
|
||||||
|
|
||||||
wxBoxSizer *hs = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *hs = new wxBoxSizer(wxHORIZONTAL);
|
||||||
wxASSERT(mPanel); // To justify safenew
|
wxASSERT(mPanel); // To justify safenew
|
||||||
|
@ -118,17 +120,19 @@ EffectRack::EffectRack()
|
||||||
hs->AddStretchSpacer();
|
hs->AddStretchSpacer();
|
||||||
hs->Add(safenew wxToggleButton(mPanel, wxID_CLEAR, _("&Bypass")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
hs->Add(safenew wxToggleButton(mPanel, wxID_CLEAR, _("&Bypass")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||||
|
|
||||||
bs = new wxBoxSizer(wxVERTICAL);
|
{
|
||||||
bs->Add(hs, 0, wxEXPAND);
|
auto bs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
bs->Add(safenew wxStaticLine(mPanel, wxID_ANY), 0, wxEXPAND);
|
bs->Add(hs, 0, wxEXPAND);
|
||||||
|
bs->Add(safenew wxStaticLine(mPanel, wxID_ANY), 0, wxEXPAND);
|
||||||
|
|
||||||
mMainSizer = new wxFlexGridSizer(7);
|
mMainSizer = new wxFlexGridSizer(7);
|
||||||
mMainSizer->AddGrowableCol(6);
|
mMainSizer->AddGrowableCol(6);
|
||||||
mMainSizer->SetHGap(0);
|
mMainSizer->SetHGap(0);
|
||||||
mMainSizer->SetVGap(0);
|
mMainSizer->SetVGap(0);
|
||||||
bs->Add(mMainSizer, 1, wxEXPAND);
|
bs->Add(mMainSizer, 1, wxEXPAND);
|
||||||
|
|
||||||
mPanel->SetSizer(bs);
|
mPanel->SetSizer(bs.release());
|
||||||
|
}
|
||||||
|
|
||||||
wxString oldPath = gPrefs->GetPath();
|
wxString oldPath = gPrefs->GetPath();
|
||||||
gPrefs->SetPath(wxT("/EffectsRack"));
|
gPrefs->SetPath(wxT("/EffectsRack"));
|
||||||
|
|
|
@ -2825,12 +2825,14 @@ void VSTEffect::BuildFancy()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
|
{
|
||||||
|
auto mainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
|
||||||
mainSizer->Add(mControl, 0, wxALIGN_CENTER);
|
mainSizer->Add(mControl, 0, wxALIGN_CENTER);
|
||||||
|
|
||||||
mParent->SetMinSize(wxDefaultSize);
|
mParent->SetMinSize(wxDefaultSize);
|
||||||
mParent->SetSizer(mainSizer);
|
mParent->SetSizer(mainSizer.release());
|
||||||
|
}
|
||||||
|
|
||||||
NeedEditIdle(true);
|
NeedEditIdle(true);
|
||||||
|
|
||||||
|
@ -2841,119 +2843,126 @@ void VSTEffect::BuildFancy()
|
||||||
|
|
||||||
void VSTEffect::BuildPlain()
|
void VSTEffect::BuildPlain()
|
||||||
{
|
{
|
||||||
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
|
|
||||||
wxASSERT(mParent); // To justify safenew
|
wxASSERT(mParent); // To justify safenew
|
||||||
wxScrolledWindow *const scroller = safenew wxScrolledWindow(mParent,
|
wxScrolledWindow *const scroller = safenew wxScrolledWindow(mParent,
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize,
|
||||||
wxVSCROLL | wxTAB_TRAVERSAL);
|
wxVSCROLL | wxTAB_TRAVERSAL);
|
||||||
|
|
||||||
// Try to give the window a sensible default/minimum size
|
{
|
||||||
scroller->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
|
auto mainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
mParent->GetSize().GetHeight() / 2));
|
|
||||||
scroller->SetScrollRate(0, 20);
|
|
||||||
|
|
||||||
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
// Try to give the window a sensible default/minimum size
|
||||||
scroller->SetName(wxT("\a"));
|
scroller->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
|
||||||
scroller->SetLabel(wxT("\a"));
|
mParent->GetSize().GetHeight() / 2));
|
||||||
|
scroller->SetScrollRate(0, 20);
|
||||||
|
|
||||||
mainSizer->Add(scroller, 1, wxEXPAND | wxALL, 5);
|
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
||||||
mParent->SetSizer(mainSizer);
|
scroller->SetName(wxT("\a"));
|
||||||
|
scroller->SetLabel(wxT("\a"));
|
||||||
|
|
||||||
|
mainSizer->Add(scroller, 1, wxEXPAND | wxALL, 5);
|
||||||
|
mParent->SetSizer(mainSizer.release());
|
||||||
|
}
|
||||||
|
|
||||||
mNames = new wxStaticText *[mAEffect->numParams];
|
mNames = new wxStaticText *[mAEffect->numParams];
|
||||||
mSliders = new wxSlider *[mAEffect->numParams];
|
mSliders = new wxSlider *[mAEffect->numParams];
|
||||||
mDisplays = new wxStaticText *[mAEffect->numParams];
|
mDisplays = new wxStaticText *[mAEffect->numParams];
|
||||||
mLabels = new wxStaticText *[mAEffect->numParams];
|
mLabels = new wxStaticText *[mAEffect->numParams];
|
||||||
|
|
||||||
wxSizer *paramSizer = new wxStaticBoxSizer(wxVERTICAL, scroller, _("Effect Settings"));
|
|
||||||
|
|
||||||
wxFlexGridSizer *gridSizer = new wxFlexGridSizer(4, 0, 0);
|
|
||||||
gridSizer->AddGrowableCol(1);
|
|
||||||
|
|
||||||
// Add the duration control for generators
|
|
||||||
if (GetType() == EffectTypeGenerate)
|
|
||||||
{
|
{
|
||||||
wxControl *item = safenew wxStaticText(scroller, 0, _("Duration:"));
|
auto paramSizer = std::make_unique<wxStaticBoxSizer>(wxVERTICAL, scroller, _("Effect Settings"));
|
||||||
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
|
||||||
mDuration = safenew
|
|
||||||
NumericTextCtrl(NumericConverter::TIME,
|
|
||||||
scroller,
|
|
||||||
ID_Duration,
|
|
||||||
mHost->GetDurationFormat(),
|
|
||||||
mHost->GetDuration(),
|
|
||||||
mSampleRate,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxDefaultSize,
|
|
||||||
true);
|
|
||||||
mDuration->SetName(_("Duration"));
|
|
||||||
mDuration->EnableMenu();
|
|
||||||
gridSizer->Add(mDuration, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find the longest parameter name.
|
|
||||||
int namew = 0;
|
|
||||||
int w;
|
|
||||||
int h;
|
|
||||||
for (int i = 0; i < mAEffect->numParams; i++)
|
|
||||||
{
|
|
||||||
wxString text = GetString(effGetParamName, i);
|
|
||||||
|
|
||||||
if (text.Right(1) != wxT(':'))
|
|
||||||
{
|
{
|
||||||
text += wxT(':');
|
auto gridSizer = std::make_unique<wxFlexGridSizer>(4, 0, 0);
|
||||||
}
|
gridSizer->AddGrowableCol(1);
|
||||||
|
|
||||||
scroller->GetTextExtent(text, &w, &h);
|
// Add the duration control for generators
|
||||||
if (w > namew)
|
if (GetType() == EffectTypeGenerate)
|
||||||
{
|
{
|
||||||
namew = w;
|
wxControl *item = safenew wxStaticText(scroller, 0, _("Duration:"));
|
||||||
|
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
||||||
|
mDuration = safenew
|
||||||
|
NumericTextCtrl(NumericConverter::TIME,
|
||||||
|
scroller,
|
||||||
|
ID_Duration,
|
||||||
|
mHost->GetDurationFormat(),
|
||||||
|
mHost->GetDuration(),
|
||||||
|
mSampleRate,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
true);
|
||||||
|
mDuration->SetName(_("Duration"));
|
||||||
|
mDuration->EnableMenu();
|
||||||
|
gridSizer->Add(mDuration, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find the longest parameter name.
|
||||||
|
int namew = 0;
|
||||||
|
int w;
|
||||||
|
int h;
|
||||||
|
for (int i = 0; i < mAEffect->numParams; i++)
|
||||||
|
{
|
||||||
|
wxString text = GetString(effGetParamName, i);
|
||||||
|
|
||||||
|
if (text.Right(1) != wxT(':'))
|
||||||
|
{
|
||||||
|
text += wxT(':');
|
||||||
|
}
|
||||||
|
|
||||||
|
scroller->GetTextExtent(text, &w, &h);
|
||||||
|
if (w > namew)
|
||||||
|
{
|
||||||
|
namew = w;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scroller->GetTextExtent(wxT("HHHHHHHH"), &w, &h);
|
||||||
|
|
||||||
|
for (int i = 0; i < mAEffect->numParams; i++)
|
||||||
|
{
|
||||||
|
mNames[i] = safenew wxStaticText(scroller,
|
||||||
|
wxID_ANY,
|
||||||
|
wxEmptyString,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxSize(namew, -1),
|
||||||
|
wxALIGN_RIGHT | wxST_NO_AUTORESIZE);
|
||||||
|
gridSizer->Add(mNames[i], 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
||||||
|
|
||||||
|
mSliders[i] = safenew wxSlider(scroller,
|
||||||
|
ID_Sliders + i,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1000,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxSize(200, -1));
|
||||||
|
gridSizer->Add(mSliders[i], 0, wxALIGN_CENTER_VERTICAL | wxEXPAND | wxALL, 5);
|
||||||
|
|
||||||
|
mDisplays[i] = safenew wxStaticText(scroller,
|
||||||
|
wxID_ANY,
|
||||||
|
wxEmptyString,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxSize(w, -1),
|
||||||
|
wxALIGN_RIGHT | wxST_NO_AUTORESIZE);
|
||||||
|
gridSizer->Add(mDisplays[i], 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
||||||
|
|
||||||
|
mLabels[i] = safenew wxStaticText(scroller,
|
||||||
|
wxID_ANY,
|
||||||
|
wxEmptyString,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxSize(w, -1),
|
||||||
|
wxALIGN_LEFT | wxST_NO_AUTORESIZE);
|
||||||
|
gridSizer->Add(mLabels[i], 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
paramSizer->Add(gridSizer.release(), 1, wxEXPAND | wxALL, 5);
|
||||||
}
|
}
|
||||||
|
scroller->SetSizer(paramSizer.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
scroller->GetTextExtent(wxT("HHHHHHHH"), &w, &h);
|
|
||||||
|
|
||||||
for (int i = 0; i < mAEffect->numParams; i++)
|
|
||||||
{
|
|
||||||
mNames[i] = safenew wxStaticText(scroller,
|
|
||||||
wxID_ANY,
|
|
||||||
wxEmptyString,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxSize(namew, -1),
|
|
||||||
wxALIGN_RIGHT | wxST_NO_AUTORESIZE);
|
|
||||||
gridSizer->Add(mNames[i], 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
|
||||||
|
|
||||||
mSliders[i] = safenew wxSlider(scroller,
|
|
||||||
ID_Sliders + i,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1000,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxSize(200, -1));
|
|
||||||
gridSizer->Add(mSliders[i], 0, wxALIGN_CENTER_VERTICAL | wxEXPAND | wxALL, 5);
|
|
||||||
|
|
||||||
mDisplays[i] = safenew wxStaticText(scroller,
|
|
||||||
wxID_ANY,
|
|
||||||
wxEmptyString,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxSize(w, -1),
|
|
||||||
wxALIGN_RIGHT | wxST_NO_AUTORESIZE);
|
|
||||||
gridSizer->Add(mDisplays[i], 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
|
||||||
|
|
||||||
mLabels[i] = safenew wxStaticText(scroller,
|
|
||||||
wxID_ANY,
|
|
||||||
wxEmptyString,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxSize(w, -1),
|
|
||||||
wxALIGN_LEFT | wxST_NO_AUTORESIZE);
|
|
||||||
gridSizer->Add(mLabels[i], 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
paramSizer->Add(gridSizer, 1, wxEXPAND | wxALL, 5);
|
|
||||||
scroller->SetSizer(paramSizer);
|
|
||||||
|
|
||||||
RefreshParameters();
|
RefreshParameters();
|
||||||
|
|
||||||
mSliders[0]->SetFocus();
|
mSliders[0]->SetFocus();
|
||||||
|
|
|
@ -1164,285 +1164,293 @@ bool LadspaEffect::PopulateUI(wxWindow *parent)
|
||||||
|
|
||||||
memset(mFields, 0, mData->PortCount * sizeof(wxTextCtrl *));
|
memset(mFields, 0, mData->PortCount * sizeof(wxTextCtrl *));
|
||||||
|
|
||||||
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
|
|
||||||
wxASSERT(mParent); // To justify safenew
|
|
||||||
wxScrolledWindow *const w = safenew wxScrolledWindow(mParent,
|
wxScrolledWindow *const w = safenew wxScrolledWindow(mParent,
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize,
|
||||||
wxVSCROLL | wxTAB_TRAVERSAL);
|
wxVSCROLL | wxTAB_TRAVERSAL);
|
||||||
w->SetScrollRate(0, 20);
|
|
||||||
|
|
||||||
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
|
||||||
w->SetName(wxT("\a"));
|
|
||||||
w->SetLabel(wxT("\a"));
|
|
||||||
|
|
||||||
mainSizer->Add(w, 1, wxEXPAND);
|
|
||||||
mParent->SetSizer(mainSizer);
|
|
||||||
|
|
||||||
wxSizer *marginSizer = new wxBoxSizer(wxVERTICAL);
|
|
||||||
|
|
||||||
if (mNumInputControls)
|
|
||||||
{
|
{
|
||||||
wxStaticBoxSizer *paramSizer = new wxStaticBoxSizer(wxVERTICAL, w, _("Effect Settings"));
|
auto mainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
wxASSERT(mParent); // To justify safenew
|
||||||
|
w->SetScrollRate(0, 20);
|
||||||
|
|
||||||
wxFlexGridSizer *gridSizer = new wxFlexGridSizer(5, 0, 0);
|
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
||||||
gridSizer->AddGrowableCol(3);
|
w->SetName(wxT("\a"));
|
||||||
|
w->SetLabel(wxT("\a"));
|
||||||
|
|
||||||
wxControl *item;
|
mainSizer->Add(w, 1, wxEXPAND);
|
||||||
|
mParent->SetSizer(mainSizer.release());
|
||||||
|
}
|
||||||
|
|
||||||
// Add the duration control for generators
|
wxSizer *marginSizer;
|
||||||
if (GetType() == EffectTypeGenerate)
|
{
|
||||||
|
auto uMarginSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
marginSizer = uMarginSizer.get();
|
||||||
|
|
||||||
|
if (mNumInputControls)
|
||||||
{
|
{
|
||||||
item = safenew wxStaticText(w, 0, _("Duration:"));
|
auto paramSizer = std::make_unique<wxStaticBoxSizer>(wxVERTICAL, w, _("Effect Settings"));
|
||||||
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
|
||||||
mDuration = safenew
|
|
||||||
NumericTextCtrl(NumericConverter::TIME,
|
|
||||||
w,
|
|
||||||
ID_Duration,
|
|
||||||
mHost->GetDurationFormat(),
|
|
||||||
mHost->GetDuration(),
|
|
||||||
mSampleRate,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxDefaultSize,
|
|
||||||
true);
|
|
||||||
mDuration->SetName(_("Duration"));
|
|
||||||
mDuration->EnableMenu();
|
|
||||||
gridSizer->Add(mDuration, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (unsigned long p = 0; p < mData->PortCount; p++)
|
auto gridSizer = std::make_unique<wxFlexGridSizer>(5, 0, 0);
|
||||||
{
|
gridSizer->AddGrowableCol(3);
|
||||||
LADSPA_PortDescriptor d = mData->PortDescriptors[p];
|
|
||||||
if (LADSPA_IS_PORT_AUDIO(d) || LADSPA_IS_PORT_OUTPUT(d))
|
wxControl *item;
|
||||||
|
|
||||||
|
// Add the duration control for generators
|
||||||
|
if (GetType() == EffectTypeGenerate)
|
||||||
{
|
{
|
||||||
continue;
|
item = safenew wxStaticText(w, 0, _("Duration:"));
|
||||||
}
|
|
||||||
|
|
||||||
wxString labelText = LAT1CTOWX(mData->PortNames[p]);
|
|
||||||
item = safenew wxStaticText(w, 0, labelText + wxT(":"));
|
|
||||||
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
|
||||||
|
|
||||||
wxString fieldText;
|
|
||||||
LADSPA_PortRangeHint hint = mData->PortRangeHints[p];
|
|
||||||
|
|
||||||
if (LADSPA_IS_HINT_TOGGLED(hint.HintDescriptor))
|
|
||||||
{
|
|
||||||
mToggles[p] = safenew wxCheckBox(w, ID_Toggles + p, wxT(""));
|
|
||||||
mToggles[p]->SetName(labelText);
|
|
||||||
mToggles[p]->SetValue(mInputControls[p] > 0);
|
|
||||||
gridSizer->Add(mToggles[p], 0, wxALL, 5);
|
|
||||||
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString bound;
|
|
||||||
float lower = -FLT_MAX;
|
|
||||||
float upper = FLT_MAX;
|
|
||||||
bool haslo = false;
|
|
||||||
bool hashi = false;
|
|
||||||
bool forceint = false;
|
|
||||||
|
|
||||||
if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor))
|
|
||||||
{
|
|
||||||
lower = hint.LowerBound;
|
|
||||||
haslo = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor))
|
|
||||||
{
|
|
||||||
upper = hint.UpperBound;
|
|
||||||
hashi = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LADSPA_IS_HINT_SAMPLE_RATE(hint.HintDescriptor))
|
|
||||||
{
|
|
||||||
lower *= mSampleRate;
|
|
||||||
upper *= mSampleRate;
|
|
||||||
forceint = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Limit to the UI precision
|
|
||||||
lower = ceilf(lower * 1000000.0) / 1000000.0;
|
|
||||||
upper = floorf(upper * 1000000.0) / 1000000.0;
|
|
||||||
mInputControls[p] = roundf(mInputControls[p] * 1000000.0) / 1000000.0;
|
|
||||||
|
|
||||||
if (haslo && mInputControls[p] < lower)
|
|
||||||
{
|
|
||||||
mInputControls[p] = lower;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hashi && mInputControls[p] > upper)
|
|
||||||
{
|
|
||||||
mInputControls[p] = lower;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't specify a value at creation time. This prevents unwanted events
|
|
||||||
// being sent to the OnTextCtrl() handler before the associated slider
|
|
||||||
// has been created.
|
|
||||||
mFields[p] = safenew wxTextCtrl(w, ID_Texts + p);
|
|
||||||
mFields[p]->SetName(labelText);
|
|
||||||
gridSizer->Add(mFields[p], 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
|
||||||
|
|
||||||
wxString str;
|
|
||||||
if (haslo)
|
|
||||||
{
|
|
||||||
if (LADSPA_IS_HINT_INTEGER(hint.HintDescriptor) || forceint)
|
|
||||||
{
|
|
||||||
str.Printf(wxT("%d"), (int)(lower + 0.5));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
str = Internat::ToDisplayString(lower);
|
|
||||||
}
|
|
||||||
item = safenew wxStaticText(w, 0, str);
|
|
||||||
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
||||||
}
|
mDuration = safenew
|
||||||
else
|
NumericTextCtrl(NumericConverter::TIME,
|
||||||
{
|
w,
|
||||||
|
ID_Duration,
|
||||||
|
mHost->GetDurationFormat(),
|
||||||
|
mHost->GetDuration(),
|
||||||
|
mSampleRate,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
true);
|
||||||
|
mDuration->SetName(_("Duration"));
|
||||||
|
mDuration->EnableMenu();
|
||||||
|
gridSizer->Add(mDuration, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
gridSizer->Add(1, 1, 0);
|
gridSizer->Add(1, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
mSliders[p] = safenew wxSlider(w, ID_Sliders + p,
|
for (unsigned long p = 0; p < mData->PortCount; p++)
|
||||||
0, 0, 1000,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxSize(200, -1));
|
|
||||||
mSliders[p]->SetName(labelText);
|
|
||||||
gridSizer->Add(mSliders[p], 0, wxALIGN_CENTER_VERTICAL | wxEXPAND | wxALL, 5);
|
|
||||||
|
|
||||||
if (hashi)
|
|
||||||
{
|
{
|
||||||
|
LADSPA_PortDescriptor d = mData->PortDescriptors[p];
|
||||||
|
if (LADSPA_IS_PORT_AUDIO(d) || LADSPA_IS_PORT_OUTPUT(d))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString labelText = LAT1CTOWX(mData->PortNames[p]);
|
||||||
|
item = safenew wxStaticText(w, 0, labelText + wxT(":"));
|
||||||
|
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
||||||
|
|
||||||
|
wxString fieldText;
|
||||||
|
LADSPA_PortRangeHint hint = mData->PortRangeHints[p];
|
||||||
|
|
||||||
|
if (LADSPA_IS_HINT_TOGGLED(hint.HintDescriptor))
|
||||||
|
{
|
||||||
|
mToggles[p] = safenew wxCheckBox(w, ID_Toggles + p, wxT(""));
|
||||||
|
mToggles[p]->SetName(labelText);
|
||||||
|
mToggles[p]->SetValue(mInputControls[p] > 0);
|
||||||
|
gridSizer->Add(mToggles[p], 0, wxALL, 5);
|
||||||
|
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString bound;
|
||||||
|
float lower = -FLT_MAX;
|
||||||
|
float upper = FLT_MAX;
|
||||||
|
bool haslo = false;
|
||||||
|
bool hashi = false;
|
||||||
|
bool forceint = false;
|
||||||
|
|
||||||
|
if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor))
|
||||||
|
{
|
||||||
|
lower = hint.LowerBound;
|
||||||
|
haslo = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor))
|
||||||
|
{
|
||||||
|
upper = hint.UpperBound;
|
||||||
|
hashi = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LADSPA_IS_HINT_SAMPLE_RATE(hint.HintDescriptor))
|
||||||
|
{
|
||||||
|
lower *= mSampleRate;
|
||||||
|
upper *= mSampleRate;
|
||||||
|
forceint = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Limit to the UI precision
|
||||||
|
lower = ceilf(lower * 1000000.0) / 1000000.0;
|
||||||
|
upper = floorf(upper * 1000000.0) / 1000000.0;
|
||||||
|
mInputControls[p] = roundf(mInputControls[p] * 1000000.0) / 1000000.0;
|
||||||
|
|
||||||
|
if (haslo && mInputControls[p] < lower)
|
||||||
|
{
|
||||||
|
mInputControls[p] = lower;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hashi && mInputControls[p] > upper)
|
||||||
|
{
|
||||||
|
mInputControls[p] = lower;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't specify a value at creation time. This prevents unwanted events
|
||||||
|
// being sent to the OnTextCtrl() handler before the associated slider
|
||||||
|
// has been created.
|
||||||
|
mFields[p] = safenew wxTextCtrl(w, ID_Texts + p);
|
||||||
|
mFields[p]->SetName(labelText);
|
||||||
|
gridSizer->Add(mFields[p], 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||||
|
|
||||||
|
wxString str;
|
||||||
|
if (haslo)
|
||||||
|
{
|
||||||
|
if (LADSPA_IS_HINT_INTEGER(hint.HintDescriptor) || forceint)
|
||||||
|
{
|
||||||
|
str.Printf(wxT("%d"), (int)(lower + 0.5));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str = Internat::ToDisplayString(lower);
|
||||||
|
}
|
||||||
|
item = safenew wxStaticText(w, 0, str);
|
||||||
|
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
mSliders[p] = safenew wxSlider(w, ID_Sliders + p,
|
||||||
|
0, 0, 1000,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxSize(200, -1));
|
||||||
|
mSliders[p]->SetName(labelText);
|
||||||
|
gridSizer->Add(mSliders[p], 0, wxALIGN_CENTER_VERTICAL | wxEXPAND | wxALL, 5);
|
||||||
|
|
||||||
|
if (hashi)
|
||||||
|
{
|
||||||
|
if (LADSPA_IS_HINT_INTEGER(hint.HintDescriptor) || forceint)
|
||||||
|
{
|
||||||
|
str.Printf(wxT("%d"), (int)(upper + 0.5));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str = Internat::ToDisplayString(upper);
|
||||||
|
}
|
||||||
|
item = safenew wxStaticText(w, 0, str);
|
||||||
|
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 5);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (LADSPA_IS_HINT_INTEGER(hint.HintDescriptor) || forceint)
|
if (LADSPA_IS_HINT_INTEGER(hint.HintDescriptor) || forceint)
|
||||||
{
|
{
|
||||||
str.Printf(wxT("%d"), (int)(upper + 0.5));
|
fieldText.Printf(wxT("%d"), (int)(mInputControls[p] + 0.5));
|
||||||
|
|
||||||
|
IntegerValidator<float> vld(&mInputControls[p]);
|
||||||
|
vld.SetRange(haslo ? lower : INT_MIN,
|
||||||
|
hashi ? upper : INT_MAX);
|
||||||
|
mFields[p]->SetValidator(vld);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str = Internat::ToDisplayString(upper);
|
fieldText = Internat::ToDisplayString(mInputControls[p]);
|
||||||
}
|
|
||||||
item = safenew wxStaticText(w, 0, str);
|
|
||||||
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, 5);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LADSPA_IS_HINT_INTEGER(hint.HintDescriptor) || forceint)
|
// > 12 decimal places can cause rounding errors in display.
|
||||||
{
|
FloatingPointValidator<float> vld(6, &mInputControls[p]);
|
||||||
fieldText.Printf(wxT("%d"), (int)(mInputControls[p] + 0.5));
|
vld.SetRange(lower, upper);
|
||||||
|
|
||||||
IntegerValidator<float> vld(&mInputControls[p]);
|
// Set number of decimal places
|
||||||
vld.SetRange(haslo ? lower : INT_MIN,
|
if (upper - lower < 10.0)
|
||||||
hashi ? upper : INT_MAX);
|
{
|
||||||
mFields[p]->SetValidator(vld);
|
vld.SetStyle(NUM_VAL_THREE_TRAILING_ZEROES);
|
||||||
}
|
}
|
||||||
else
|
else if (upper - lower < 100.0)
|
||||||
{
|
{
|
||||||
fieldText = Internat::ToDisplayString(mInputControls[p]);
|
vld.SetStyle(NUM_VAL_TWO_TRAILING_ZEROES);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vld.SetStyle(NUM_VAL_ONE_TRAILING_ZERO);
|
||||||
|
}
|
||||||
|
|
||||||
// > 12 decimal places can cause rounding errors in display.
|
mFields[p]->SetValidator(vld);
|
||||||
FloatingPointValidator<float> vld(6, &mInputControls[p]);
|
|
||||||
vld.SetRange(lower, upper);
|
|
||||||
|
|
||||||
// Set number of decimal places
|
|
||||||
if (upper - lower < 10.0)
|
|
||||||
{
|
|
||||||
vld.SetStyle(NUM_VAL_THREE_TRAILING_ZEROES);
|
|
||||||
}
|
|
||||||
else if (upper - lower < 100.0)
|
|
||||||
{
|
|
||||||
vld.SetStyle(NUM_VAL_TWO_TRAILING_ZEROES);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vld.SetStyle(NUM_VAL_ONE_TRAILING_ZERO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mFields[p]->SetValidator(vld);
|
// Set the textctrl value. This will trigger an event so OnTextCtrl()
|
||||||
|
// can update the slider.
|
||||||
|
mFields[p]->SetValue(fieldText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the textctrl value. This will trigger an event so OnTextCtrl()
|
paramSizer->Add(gridSizer.release(), 0, wxEXPAND | wxALL, 5);
|
||||||
// can update the slider.
|
marginSizer->Add(paramSizer.release(), 0, wxEXPAND | wxALL, 5);
|
||||||
mFields[p]->SetValue(fieldText);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paramSizer->Add(gridSizer, 0, wxEXPAND | wxALL, 5);
|
if (mNumOutputControls > 0)
|
||||||
marginSizer->Add(paramSizer, 0, wxEXPAND | wxALL, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mNumOutputControls > 0 )
|
|
||||||
{
|
|
||||||
wxSizer *paramSizer = new wxStaticBoxSizer(wxVERTICAL, w, _("Effect Output"));
|
|
||||||
|
|
||||||
wxFlexGridSizer *gridSizer = new wxFlexGridSizer(2, 0, 0);
|
|
||||||
gridSizer->AddGrowableCol(1);
|
|
||||||
|
|
||||||
wxControl *item;
|
|
||||||
|
|
||||||
for (unsigned long p = 0; p < mData->PortCount; p++)
|
|
||||||
{
|
{
|
||||||
LADSPA_PortDescriptor d = mData->PortDescriptors[p];
|
auto paramSizer = std::make_unique<wxStaticBoxSizer>(wxVERTICAL, w, _("Effect Output"));
|
||||||
if (LADSPA_IS_PORT_AUDIO(d) || LADSPA_IS_PORT_INPUT(d))
|
|
||||||
|
auto gridSizer = std::make_unique<wxFlexGridSizer>(2, 0, 0);
|
||||||
|
gridSizer->AddGrowableCol(1);
|
||||||
|
|
||||||
|
wxControl *item;
|
||||||
|
|
||||||
|
for (unsigned long p = 0; p < mData->PortCount; p++)
|
||||||
{
|
{
|
||||||
continue;
|
LADSPA_PortDescriptor d = mData->PortDescriptors[p];
|
||||||
|
if (LADSPA_IS_PORT_AUDIO(d) || LADSPA_IS_PORT_INPUT(d))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString labelText = LAT1CTOWX(mData->PortNames[p]);
|
||||||
|
item = safenew wxStaticText(w, 0, labelText + wxT(":"));
|
||||||
|
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
||||||
|
|
||||||
|
LADSPA_PortRangeHint hint = mData->PortRangeHints[p];
|
||||||
|
|
||||||
|
wxString bound;
|
||||||
|
float lower = 0.0;
|
||||||
|
float upper = 1.0;
|
||||||
|
bool haslo = false;
|
||||||
|
bool hashi = false;
|
||||||
|
bool forceint = false;
|
||||||
|
|
||||||
|
if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor))
|
||||||
|
{
|
||||||
|
lower = hint.LowerBound;
|
||||||
|
haslo = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor))
|
||||||
|
{
|
||||||
|
upper = hint.UpperBound;
|
||||||
|
hashi = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LADSPA_IS_HINT_SAMPLE_RATE(hint.HintDescriptor))
|
||||||
|
{
|
||||||
|
lower *= mSampleRate;
|
||||||
|
upper *= mSampleRate;
|
||||||
|
forceint = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Limit to the UI precision
|
||||||
|
lower = ceilf(lower * 1000000.0) / 1000000.0;
|
||||||
|
upper = floorf(upper * 1000000.0) / 1000000.0;
|
||||||
|
mInputControls[p] = roundf(mInputControls[p] * 1000000.0) / 1000000.0;
|
||||||
|
|
||||||
|
mMeters[p] = safenew LadspaEffectMeter(w, mOutputControls[p], lower, upper);
|
||||||
|
mMeters[p]->SetName(labelText);
|
||||||
|
gridSizer->Add(mMeters[p], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString labelText = LAT1CTOWX(mData->PortNames[p]);
|
paramSizer->Add(gridSizer.release(), 0, wxEXPAND | wxALL, 5);
|
||||||
item = safenew wxStaticText(w, 0, labelText + wxT(":"));
|
marginSizer->Add(paramSizer.release(), 0, wxEXPAND | wxALL, 5);
|
||||||
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
|
|
||||||
|
|
||||||
LADSPA_PortRangeHint hint = mData->PortRangeHints[p];
|
RefreshControls(true);
|
||||||
|
|
||||||
wxString bound;
|
|
||||||
float lower = 0.0;
|
|
||||||
float upper = 1.0;
|
|
||||||
bool haslo = false;
|
|
||||||
bool hashi = false;
|
|
||||||
bool forceint = false;
|
|
||||||
|
|
||||||
if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor))
|
|
||||||
{
|
|
||||||
lower = hint.LowerBound;
|
|
||||||
haslo = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor))
|
|
||||||
{
|
|
||||||
upper = hint.UpperBound;
|
|
||||||
hashi = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LADSPA_IS_HINT_SAMPLE_RATE(hint.HintDescriptor))
|
|
||||||
{
|
|
||||||
lower *= mSampleRate;
|
|
||||||
upper *= mSampleRate;
|
|
||||||
forceint = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Limit to the UI precision
|
|
||||||
lower = ceilf(lower * 1000000.0) / 1000000.0;
|
|
||||||
upper = floorf(upper * 1000000.0) / 1000000.0;
|
|
||||||
mInputControls[p] = roundf(mInputControls[p] * 1000000.0) / 1000000.0;
|
|
||||||
|
|
||||||
mMeters[p] = safenew LadspaEffectMeter(w, mOutputControls[p], lower, upper);
|
|
||||||
mMeters[p]->SetName(labelText);
|
|
||||||
gridSizer->Add(mMeters[p], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paramSizer->Add(gridSizer, 0, wxEXPAND | wxALL, 5);
|
w->SetSizer(uMarginSizer.release());
|
||||||
marginSizer->Add(paramSizer, 0, wxEXPAND | wxALL, 5);
|
|
||||||
|
|
||||||
RefreshControls(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
w->SetSizer(marginSizer);
|
|
||||||
w->Layout();
|
w->Layout();
|
||||||
|
|
||||||
// Try to give the window a sensible default/minimum size
|
// Try to give the window a sensible default/minimum size
|
||||||
|
|
|
@ -1465,11 +1465,11 @@ bool LV2Effect::BuildFancy()
|
||||||
wxSizerItem *si = NULL;
|
wxSizerItem *si = NULL;
|
||||||
if (vs)
|
if (vs)
|
||||||
{
|
{
|
||||||
wxBoxSizer *hs = new wxBoxSizer(wxHORIZONTAL);
|
auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
if (hs)
|
if (hs)
|
||||||
{
|
{
|
||||||
si = hs->Add(mContainer, 1, wxCENTER | wxEXPAND);
|
si = hs->Add(mContainer, 1, wxCENTER | wxEXPAND);
|
||||||
vs->Add(hs, 0, wxCENTER);
|
vs->Add(hs.release(), 0, wxCENTER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1578,281 +1578,290 @@ bool LV2Effect::BuildPlain()
|
||||||
mSliders = new wxSlider *[ctrlcnt];
|
mSliders = new wxSlider *[ctrlcnt];
|
||||||
mFields = new wxTextCtrl *[ctrlcnt];
|
mFields = new wxTextCtrl *[ctrlcnt];
|
||||||
|
|
||||||
wxSizer *outerSizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *innerSizer;
|
||||||
|
|
||||||
wxASSERT(mParent); // To justify safenew
|
wxASSERT(mParent); // To justify safenew
|
||||||
wxScrolledWindow *const w = safenew wxScrolledWindow(mParent,
|
wxScrolledWindow *const w = safenew wxScrolledWindow(mParent,
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize,
|
||||||
wxVSCROLL | wxTAB_TRAVERSAL);
|
wxVSCROLL | wxTAB_TRAVERSAL);
|
||||||
w->SetScrollRate(0, 20);
|
|
||||||
|
|
||||||
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
|
||||||
w->SetName(wxT("\a"));
|
|
||||||
w->SetLabel(wxT("\a"));
|
|
||||||
|
|
||||||
outerSizer->Add(w, 1, wxEXPAND);
|
|
||||||
|
|
||||||
wxSizer *innerSizer = new wxBoxSizer(wxVERTICAL);
|
|
||||||
|
|
||||||
if (GetType() == EffectTypeGenerate)
|
|
||||||
{
|
{
|
||||||
// Add the length control
|
auto outerSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
wxSizer *groupSizer = new wxStaticBoxSizer(wxVERTICAL, w, _("Generator"));
|
w->SetScrollRate(0, 20);
|
||||||
|
|
||||||
wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
|
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
||||||
|
w->SetName(wxT("\a"));
|
||||||
|
w->SetLabel(wxT("\a"));
|
||||||
|
|
||||||
wxWindow *item = safenew wxStaticText(w, 0, _("&Duration:"));
|
outerSizer->Add(w, 1, wxEXPAND);
|
||||||
sizer->Add(item, 0, wxALIGN_CENTER | wxALL, 5);
|
|
||||||
mDuration = safenew
|
|
||||||
NumericTextCtrl(NumericConverter::TIME,
|
|
||||||
w,
|
|
||||||
ID_Duration,
|
|
||||||
mHost->GetDurationFormat(),
|
|
||||||
mHost->GetDuration(),
|
|
||||||
mSampleRate,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxDefaultSize,
|
|
||||||
true);
|
|
||||||
mDuration->SetName(_("Duration"));
|
|
||||||
mDuration->EnableMenu();
|
|
||||||
sizer->Add(mDuration, 0, wxALIGN_CENTER | wxALL, 5);
|
|
||||||
|
|
||||||
groupSizer->Add(sizer, 0, wxALIGN_CENTER | wxALL, 5);
|
|
||||||
innerSizer->Add(groupSizer, 0, wxEXPAND | wxALL, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
mGroups.Sort();
|
|
||||||
|
|
||||||
for (size_t i = 0, cnt = mGroups.GetCount(); i < cnt; i++)
|
|
||||||
{
|
|
||||||
wxString label = mGroups[i];
|
|
||||||
if (label.IsEmpty())
|
|
||||||
{
|
{
|
||||||
label = _("Effect Settings");
|
auto uInnerSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
}
|
innerSizer = uInnerSizer.get();
|
||||||
wxSizer *groupSizer = new wxStaticBoxSizer(wxVERTICAL, w, label);
|
|
||||||
|
|
||||||
wxFlexGridSizer *gridSizer = new wxFlexGridSizer(numCols, 5, 5);
|
if (GetType() == EffectTypeGenerate)
|
||||||
gridSizer->AddGrowableCol(3);
|
|
||||||
|
|
||||||
const wxArrayInt & params = mGroupMap[mGroups[i]];
|
|
||||||
for (size_t pi = 0, cnt = params.GetCount(); pi < cnt; pi++)
|
|
||||||
{
|
|
||||||
int p = params[pi];
|
|
||||||
LV2Port & ctrl = mControls[p];
|
|
||||||
wxString labelText = ctrl.mName;
|
|
||||||
if (!ctrl.mUnits.IsEmpty())
|
|
||||||
{
|
{
|
||||||
labelText += wxT(" (") + ctrl.mUnits + wxT(")");
|
// Add the length control
|
||||||
|
auto groupSizer = std::make_unique<wxStaticBoxSizer>(wxVERTICAL, w, _("Generator"));
|
||||||
|
|
||||||
|
auto sizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
|
wxWindow *item = safenew wxStaticText(w, 0, _("&Duration:"));
|
||||||
|
sizer->Add(item, 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
|
mDuration = safenew
|
||||||
|
NumericTextCtrl(NumericConverter::TIME,
|
||||||
|
w,
|
||||||
|
ID_Duration,
|
||||||
|
mHost->GetDurationFormat(),
|
||||||
|
mHost->GetDuration(),
|
||||||
|
mSampleRate,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
true);
|
||||||
|
mDuration->SetName(_("Duration"));
|
||||||
|
mDuration->EnableMenu();
|
||||||
|
sizer->Add(mDuration, 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
|
|
||||||
|
groupSizer->Add(sizer.release(), 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
|
innerSizer->Add(groupSizer.release(), 0, wxEXPAND | wxALL, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctrl.mTrigger)
|
mGroups.Sort();
|
||||||
|
|
||||||
|
for (size_t i = 0, cnt = mGroups.GetCount(); i < cnt; i++)
|
||||||
{
|
{
|
||||||
gridSizer->Add(1, 1, 0);
|
wxString label = mGroups[i];
|
||||||
|
if (label.IsEmpty())
|
||||||
wxASSERT(w); // To justify safenew
|
|
||||||
wxButton *b = safenew wxButton(w, ID_Triggers + p, labelText);
|
|
||||||
gridSizer->Add(b, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
|
||||||
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxWindow *item = safenew wxStaticText(w, wxID_ANY, labelText + wxT(":"),
|
|
||||||
wxDefaultPosition, wxDefaultSize,
|
|
||||||
wxALIGN_RIGHT);
|
|
||||||
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT);
|
|
||||||
|
|
||||||
if (ctrl.mToggle)
|
|
||||||
{
|
|
||||||
wxCheckBox *c = safenew wxCheckBox(w, ID_Toggles + p, wxT(""));
|
|
||||||
c->SetName(labelText);
|
|
||||||
c->SetValue(ctrl.mVal > 0);
|
|
||||||
gridSizer->Add(c, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
|
||||||
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
}
|
|
||||||
else if (ctrl.mEnumeration) // Check before integer
|
|
||||||
{
|
|
||||||
int s;
|
|
||||||
for (s = (int) ctrl.mScaleValues.GetCount() - 1; s >= 0; s--)
|
|
||||||
{
|
{
|
||||||
if (ctrl.mVal >= ctrl.mScaleValues[s])
|
label = _("Effect Settings");
|
||||||
|
}
|
||||||
|
auto groupSizer = std::make_unique<wxStaticBoxSizer>(wxVERTICAL, w, label);
|
||||||
|
|
||||||
|
auto gridSizer = std::make_unique<wxFlexGridSizer>(numCols, 5, 5);
|
||||||
|
gridSizer->AddGrowableCol(3);
|
||||||
|
|
||||||
|
const wxArrayInt & params = mGroupMap[mGroups[i]];
|
||||||
|
for (size_t pi = 0, cnt = params.GetCount(); pi < cnt; pi++)
|
||||||
|
{
|
||||||
|
int p = params[pi];
|
||||||
|
LV2Port & ctrl = mControls[p];
|
||||||
|
wxString labelText = ctrl.mName;
|
||||||
|
if (!ctrl.mUnits.IsEmpty())
|
||||||
{
|
{
|
||||||
break;
|
labelText += wxT(" (") + ctrl.mUnits + wxT(")");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (s < 0)
|
if (ctrl.mTrigger)
|
||||||
{
|
|
||||||
s = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxChoice *c = safenew wxChoice(w, ID_Choices + p);
|
|
||||||
c->SetName(labelText);
|
|
||||||
c->Append(ctrl.mScaleLabels);
|
|
||||||
c->SetSelection(s);
|
|
||||||
gridSizer->Add(c, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
|
||||||
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
}
|
|
||||||
else if (!ctrl.mInput)
|
|
||||||
{
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
LV2EffectMeter *m = safenew LV2EffectMeter(w, ctrl);
|
|
||||||
gridSizer->Add(m, 0, wxALIGN_CENTER_VERTICAL | wxEXPAND);
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mFields[p] = safenew wxTextCtrl(w, ID_Texts + p, wxT(""));
|
|
||||||
mFields[p]->SetName(labelText);
|
|
||||||
gridSizer->Add(mFields[p], 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
|
||||||
|
|
||||||
float rate = ctrl.mSampleRate ? mSampleRate : 1.0;
|
|
||||||
|
|
||||||
ctrl.mVal = ctrl.mDef;
|
|
||||||
ctrl.mLo = ctrl.mMin * rate;
|
|
||||||
ctrl.mHi = ctrl.mMax * rate;
|
|
||||||
ctrl.mTmp = ctrl.mDef * rate;
|
|
||||||
|
|
||||||
if (ctrl.mInteger)
|
|
||||||
{
|
|
||||||
IntegerValidator<float> vld(&ctrl.mTmp);
|
|
||||||
vld.SetRange(ctrl.mLo, ctrl.mHi);
|
|
||||||
mFields[p]->SetValidator(vld);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FloatingPointValidator<float> vld(6, &ctrl.mTmp);
|
|
||||||
vld.SetRange(ctrl.mLo, ctrl.mHi);
|
|
||||||
|
|
||||||
// Set number of decimal places
|
|
||||||
float range = ctrl.mHi - ctrl.mLo;
|
|
||||||
int style = range < 10 ? NUM_VAL_THREE_TRAILING_ZEROES :
|
|
||||||
range < 100 ? NUM_VAL_TWO_TRAILING_ZEROES :
|
|
||||||
NUM_VAL_ONE_TRAILING_ZERO;
|
|
||||||
vld.SetStyle(style);
|
|
||||||
|
|
||||||
mFields[p]->SetValidator(vld);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctrl.mHasLo)
|
|
||||||
{
|
|
||||||
wxString str;
|
|
||||||
if (ctrl.mInteger || ctrl.mSampleRate)
|
|
||||||
{
|
{
|
||||||
str.Printf(wxT("%d"), lrintf(ctrl.mLo));
|
gridSizer->Add(1, 1, 0);
|
||||||
|
|
||||||
|
wxASSERT(w); // To justify safenew
|
||||||
|
wxButton *b = safenew wxButton(w, ID_Triggers + p, labelText);
|
||||||
|
gridSizer->Add(b, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
||||||
|
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
wxWindow *item = safenew wxStaticText(w, wxID_ANY, labelText + wxT(":"),
|
||||||
str = Internat::ToDisplayString(ctrl.mLo);
|
wxDefaultPosition, wxDefaultSize,
|
||||||
}
|
wxALIGN_RIGHT);
|
||||||
item = safenew wxStaticText(w, wxID_ANY, str);
|
|
||||||
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT);
|
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gridSizer->Add(1, 1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
mSliders[p] = safenew wxSlider(w, ID_Sliders + p,
|
if (ctrl.mToggle)
|
||||||
0, 0, 1000,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxSize(150, -1));
|
|
||||||
mSliders[p]->SetName(labelText);
|
|
||||||
gridSizer->Add(mSliders[p], 0, wxALIGN_CENTER_VERTICAL | wxEXPAND);
|
|
||||||
|
|
||||||
if (ctrl.mHasHi)
|
|
||||||
{
|
|
||||||
wxString str;
|
|
||||||
if (ctrl.mInteger || ctrl.mSampleRate)
|
|
||||||
{
|
{
|
||||||
str.Printf(wxT("%d"), lrintf(ctrl.mHi));
|
wxCheckBox *c = safenew wxCheckBox(w, ID_Toggles + p, wxT(""));
|
||||||
|
c->SetName(labelText);
|
||||||
|
c->SetValue(ctrl.mVal > 0);
|
||||||
|
gridSizer->Add(c, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
||||||
|
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
}
|
||||||
|
else if (ctrl.mEnumeration) // Check before integer
|
||||||
|
{
|
||||||
|
int s;
|
||||||
|
for (s = (int)ctrl.mScaleValues.GetCount() - 1; s >= 0; s--)
|
||||||
|
{
|
||||||
|
if (ctrl.mVal >= ctrl.mScaleValues[s])
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s < 0)
|
||||||
|
{
|
||||||
|
s = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxChoice *c = safenew wxChoice(w, ID_Choices + p);
|
||||||
|
c->SetName(labelText);
|
||||||
|
c->Append(ctrl.mScaleLabels);
|
||||||
|
c->SetSelection(s);
|
||||||
|
gridSizer->Add(c, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
||||||
|
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
}
|
||||||
|
else if (!ctrl.mInput)
|
||||||
|
{
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
LV2EffectMeter *m = safenew LV2EffectMeter(w, ctrl);
|
||||||
|
gridSizer->Add(m, 0, wxALIGN_CENTER_VERTICAL | wxEXPAND);
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str = Internat::ToDisplayString(ctrl.mHi);
|
mFields[p] = safenew wxTextCtrl(w, ID_Texts + p, wxT(""));
|
||||||
|
mFields[p]->SetName(labelText);
|
||||||
|
gridSizer->Add(mFields[p], 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
||||||
|
|
||||||
|
float rate = ctrl.mSampleRate ? mSampleRate : 1.0;
|
||||||
|
|
||||||
|
ctrl.mVal = ctrl.mDef;
|
||||||
|
ctrl.mLo = ctrl.mMin * rate;
|
||||||
|
ctrl.mHi = ctrl.mMax * rate;
|
||||||
|
ctrl.mTmp = ctrl.mDef * rate;
|
||||||
|
|
||||||
|
if (ctrl.mInteger)
|
||||||
|
{
|
||||||
|
IntegerValidator<float> vld(&ctrl.mTmp);
|
||||||
|
vld.SetRange(ctrl.mLo, ctrl.mHi);
|
||||||
|
mFields[p]->SetValidator(vld);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FloatingPointValidator<float> vld(6, &ctrl.mTmp);
|
||||||
|
vld.SetRange(ctrl.mLo, ctrl.mHi);
|
||||||
|
|
||||||
|
// Set number of decimal places
|
||||||
|
float range = ctrl.mHi - ctrl.mLo;
|
||||||
|
int style = range < 10 ? NUM_VAL_THREE_TRAILING_ZEROES :
|
||||||
|
range < 100 ? NUM_VAL_TWO_TRAILING_ZEROES :
|
||||||
|
NUM_VAL_ONE_TRAILING_ZERO;
|
||||||
|
vld.SetStyle(style);
|
||||||
|
|
||||||
|
mFields[p]->SetValidator(vld);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ctrl.mHasLo)
|
||||||
|
{
|
||||||
|
wxString str;
|
||||||
|
if (ctrl.mInteger || ctrl.mSampleRate)
|
||||||
|
{
|
||||||
|
str.Printf(wxT("%d"), lrintf(ctrl.mLo));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str = Internat::ToDisplayString(ctrl.mLo);
|
||||||
|
}
|
||||||
|
item = safenew wxStaticText(w, wxID_ANY, str);
|
||||||
|
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
mSliders[p] = safenew wxSlider(w, ID_Sliders + p,
|
||||||
|
0, 0, 1000,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxSize(150, -1));
|
||||||
|
mSliders[p]->SetName(labelText);
|
||||||
|
gridSizer->Add(mSliders[p], 0, wxALIGN_CENTER_VERTICAL | wxEXPAND);
|
||||||
|
|
||||||
|
if (ctrl.mHasHi)
|
||||||
|
{
|
||||||
|
wxString str;
|
||||||
|
if (ctrl.mInteger || ctrl.mSampleRate)
|
||||||
|
{
|
||||||
|
str.Printf(wxT("%d"), lrintf(ctrl.mHi));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str = Internat::ToDisplayString(ctrl.mHi);
|
||||||
|
}
|
||||||
|
item = safenew wxStaticText(w, wxID_ANY, str);
|
||||||
|
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gridSizer->Add(1, 1, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
item = safenew wxStaticText(w, wxID_ANY, str);
|
|
||||||
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
groupSizer->Add(gridSizer.release(), 1, wxEXPAND | wxALL, 5);
|
||||||
|
innerSizer->Add(groupSizer.release(), 0, wxEXPAND | wxALL, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
innerSizer->Layout();
|
||||||
|
|
||||||
|
// Calculate the maximum width of all columns (bypass Generator sizer)
|
||||||
|
wxArrayInt widths;
|
||||||
|
widths.Add(0, numCols);
|
||||||
|
|
||||||
|
size_t cnt = innerSizer->GetChildren().GetCount();
|
||||||
|
for (size_t i = (GetType() == EffectTypeGenerate); i < cnt; i++)
|
||||||
|
{
|
||||||
|
wxSizer *groupSizer = innerSizer->GetItem(i)->GetSizer();
|
||||||
|
wxFlexGridSizer *gridSizer = (wxFlexGridSizer *)groupSizer->GetItem((size_t)0)->GetSizer();
|
||||||
|
|
||||||
|
size_t items = gridSizer->GetChildren().GetCount();
|
||||||
|
int cols = gridSizer->GetCols();
|
||||||
|
|
||||||
|
for (size_t j = 0; j < items; j++)
|
||||||
{
|
{
|
||||||
gridSizer->Add(1, 1, 0);
|
wxSizerItem *item = gridSizer->GetItem(j);
|
||||||
|
widths[j % cols] = wxMax(widths[j % cols], item->GetSize().GetWidth());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
groupSizer->Add(gridSizer, 1, wxEXPAND | wxALL, 5);
|
// Set each column in all of the groups to the same width.
|
||||||
innerSizer->Add(groupSizer, 0, wxEXPAND | wxALL, 5);
|
for (size_t i = (GetType() == EffectTypeGenerate); i < cnt; i++)
|
||||||
}
|
|
||||||
|
|
||||||
innerSizer->Layout();
|
|
||||||
|
|
||||||
// Calculate the maximum width of all columns (bypass Generator sizer)
|
|
||||||
wxArrayInt widths;
|
|
||||||
widths.Add(0, numCols);
|
|
||||||
|
|
||||||
size_t cnt = innerSizer->GetChildren().GetCount();
|
|
||||||
for (size_t i = (GetType() == EffectTypeGenerate); i < cnt; i++)
|
|
||||||
{
|
|
||||||
wxSizer *groupSizer = innerSizer->GetItem(i)->GetSizer();
|
|
||||||
wxFlexGridSizer *gridSizer = (wxFlexGridSizer *)groupSizer->GetItem((size_t) 0)->GetSizer();
|
|
||||||
|
|
||||||
size_t items = gridSizer->GetChildren().GetCount();
|
|
||||||
int cols = gridSizer->GetCols();
|
|
||||||
|
|
||||||
for (size_t j = 0; j < items; j++)
|
|
||||||
{
|
|
||||||
wxSizerItem *item = gridSizer->GetItem(j);
|
|
||||||
widths[j % cols] = wxMax(widths[j % cols], item->GetSize().GetWidth());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set each column in all of the groups to the same width.
|
|
||||||
for (size_t i = (GetType() == EffectTypeGenerate); i < cnt; i++)
|
|
||||||
{
|
|
||||||
wxSizer *groupSizer = innerSizer->GetItem(i)->GetSizer();
|
|
||||||
wxFlexGridSizer *gridSizer = (wxFlexGridSizer *)groupSizer->GetItem((size_t) 0)->GetSizer();
|
|
||||||
|
|
||||||
size_t items = gridSizer->GetChildren().GetCount();
|
|
||||||
int cols = gridSizer->GetCols();
|
|
||||||
|
|
||||||
for (size_t j = 0; j < items; j++)
|
|
||||||
{
|
|
||||||
wxSizerItem *item = gridSizer->GetItem(j);
|
|
||||||
|
|
||||||
int flags = item->GetFlag();
|
|
||||||
if (flags & wxEXPAND)
|
|
||||||
{
|
{
|
||||||
continue;
|
wxSizer *groupSizer = innerSizer->GetItem(i)->GetSizer();
|
||||||
|
wxFlexGridSizer *gridSizer = (wxFlexGridSizer *)groupSizer->GetItem((size_t)0)->GetSizer();
|
||||||
|
|
||||||
|
size_t items = gridSizer->GetChildren().GetCount();
|
||||||
|
int cols = gridSizer->GetCols();
|
||||||
|
|
||||||
|
for (size_t j = 0; j < items; j++)
|
||||||
|
{
|
||||||
|
wxSizerItem *item = gridSizer->GetItem(j);
|
||||||
|
|
||||||
|
int flags = item->GetFlag();
|
||||||
|
if (flags & wxEXPAND)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flags & wxALIGN_RIGHT)
|
||||||
|
{
|
||||||
|
flags = (flags & ~wxALL) | wxLEFT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
flags = (flags & ~wxALL) | wxRIGHT;
|
||||||
|
}
|
||||||
|
item->SetFlag(flags);
|
||||||
|
|
||||||
|
item->SetBorder(widths[j % cols] - item->GetMinSize().GetWidth());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & wxALIGN_RIGHT)
|
w->SetSizer(uInnerSizer.release());
|
||||||
{
|
|
||||||
flags = (flags & ~wxALL) | wxLEFT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flags = (flags & ~wxALL) | wxRIGHT;
|
|
||||||
}
|
|
||||||
item->SetFlag(flags);
|
|
||||||
|
|
||||||
item->SetBorder(widths[j % cols] - item->GetMinSize().GetWidth());
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
w->SetSizer(innerSizer);
|
mParent->SetSizer(outerSizer.release());
|
||||||
mParent->SetSizer(outerSizer);
|
}
|
||||||
|
|
||||||
// Try to give the window a sensible default/minimum size
|
// Try to give the window a sensible default/minimum size
|
||||||
wxSize sz1 = innerSizer->GetMinSize();
|
wxSize sz1 = innerSizer->GetMinSize();
|
||||||
|
|
|
@ -2242,33 +2242,39 @@ NyquistOutputDialog::NyquistOutputDialog(wxWindow * parent, wxWindowID id,
|
||||||
{
|
{
|
||||||
SetName(GetTitle());
|
SetName(GetTitle());
|
||||||
|
|
||||||
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *mainSizer;
|
||||||
wxBoxSizer *hSizer;
|
{
|
||||||
wxButton *button;
|
auto uMainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
wxControl *item;
|
mainSizer = uMainSizer.get();
|
||||||
|
wxButton *button;
|
||||||
|
wxControl *item;
|
||||||
|
|
||||||
item = safenew wxStaticText(this, -1, prompt);
|
item = safenew wxStaticText(this, -1, prompt);
|
||||||
item->SetName(prompt); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
item->SetName(prompt); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
||||||
mainSizer->Add(item, 0, wxALIGN_LEFT | wxLEFT | wxTOP | wxRIGHT, 10);
|
mainSizer->Add(item, 0, wxALIGN_LEFT | wxLEFT | wxTOP | wxRIGHT, 10);
|
||||||
|
|
||||||
// TODO use ShowInfoDialog() instead.
|
// TODO use ShowInfoDialog() instead.
|
||||||
// Beware this dialog MUST work with screen readers.
|
// Beware this dialog MUST work with screen readers.
|
||||||
item = safenew wxTextCtrl(this, -1, message,
|
item = safenew wxTextCtrl(this, -1, message,
|
||||||
wxDefaultPosition, wxSize(400, 200),
|
wxDefaultPosition, wxSize(400, 200),
|
||||||
wxTE_MULTILINE | wxTE_READONLY);
|
wxTE_MULTILINE | wxTE_READONLY);
|
||||||
mainSizer->Add(item, 0, wxALIGN_LEFT | wxALL, 10);
|
mainSizer->Add(item, 0, wxALIGN_LEFT | wxALL, 10);
|
||||||
|
|
||||||
hSizer = new wxBoxSizer(wxHORIZONTAL);
|
{
|
||||||
|
auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
/* i18n-hint: In most languages OK is to be translated as OK. It appears on a button.*/
|
/* i18n-hint: In most languages OK is to be translated as OK. It appears on a button.*/
|
||||||
button = safenew wxButton(this, wxID_OK, _("OK"));
|
button = safenew wxButton(this, wxID_OK, _("OK"));
|
||||||
button->SetDefault();
|
button->SetDefault();
|
||||||
hSizer->Add(button, 0, wxALIGN_CENTRE | wxALL, 5);
|
hSizer->Add(button, 0, wxALIGN_CENTRE | wxALL, 5);
|
||||||
|
|
||||||
mainSizer->Add(hSizer, 0, wxALIGN_CENTRE | wxLEFT | wxBOTTOM | wxRIGHT, 5);
|
mainSizer->Add(hSizer.release(), 0, wxALIGN_CENTRE | wxLEFT | wxBOTTOM | wxRIGHT, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetAutoLayout(true);
|
||||||
|
SetSizer(uMainSizer.release());
|
||||||
|
}
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(mainSizer);
|
|
||||||
mainSizer->Fit(this);
|
mainSizer->Fit(this);
|
||||||
mainSizer->SetSizeHints(this);
|
mainSizer->SetSizeHints(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1212,34 +1212,41 @@ ExportMixerDialog::ExportMixerDialog( TrackList *tracks, bool selectedOnly,
|
||||||
if (maxNumChannels > 32)
|
if (maxNumChannels > 32)
|
||||||
maxNumChannels = 32;
|
maxNumChannels = 32;
|
||||||
|
|
||||||
mMixerSpec = new MixerSpec( numTracks, maxNumChannels );
|
mMixerSpec = new MixerSpec(numTracks, maxNumChannels);
|
||||||
|
|
||||||
wxBoxSizer *vertSizer = new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer *vertSizer;
|
||||||
|
{
|
||||||
|
auto uVertSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
vertSizer = uVertSizer.get();
|
||||||
|
|
||||||
wxWindow *mixerPanel = safenew ExportMixerPanel( mMixerSpec, mTrackNames, this,
|
wxWindow *mixerPanel = safenew ExportMixerPanel(mMixerSpec, mTrackNames, this,
|
||||||
ID_MIXERPANEL, wxDefaultPosition, wxSize( 400, -1 ) );
|
ID_MIXERPANEL, wxDefaultPosition, wxSize(400, -1));
|
||||||
mixerPanel->SetName(_("Mixer Panel"));
|
mixerPanel->SetName(_("Mixer Panel"));
|
||||||
vertSizer->Add( mixerPanel, 1, wxEXPAND | wxALIGN_CENTRE | wxALL, 5 );
|
vertSizer->Add(mixerPanel, 1, wxEXPAND | wxALIGN_CENTRE | wxALL, 5);
|
||||||
|
|
||||||
wxBoxSizer *horSizer = new wxBoxSizer( wxHORIZONTAL );
|
{
|
||||||
|
auto horSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
wxString label;
|
wxString label;
|
||||||
label.Printf( _( "Output Channels: %2d" ), mMixerSpec->GetNumChannels() );
|
label.Printf(_("Output Channels: %2d"), mMixerSpec->GetNumChannels());
|
||||||
mChannelsText = safenew wxStaticText(this, -1, label);
|
mChannelsText = safenew wxStaticText(this, -1, label);
|
||||||
horSizer->Add( mChannelsText, 0, wxALIGN_LEFT | wxALL, 5 );
|
horSizer->Add(mChannelsText, 0, wxALIGN_LEFT | wxALL, 5);
|
||||||
|
|
||||||
wxSlider *channels = safenew wxSlider( this, ID_SLIDER_CHANNEL,
|
wxSlider *channels = safenew wxSlider(this, ID_SLIDER_CHANNEL,
|
||||||
mMixerSpec->GetNumChannels(), 1, mMixerSpec->GetMaxNumChannels(),
|
mMixerSpec->GetNumChannels(), 1, mMixerSpec->GetMaxNumChannels(),
|
||||||
wxDefaultPosition, wxSize( 300, -1 ) );
|
wxDefaultPosition, wxSize(300, -1));
|
||||||
channels->SetName(label);
|
channels->SetName(label);
|
||||||
horSizer->Add( channels, 0, wxEXPAND | wxALL, 5 );
|
horSizer->Add(channels, 0, wxEXPAND | wxALL, 5);
|
||||||
|
|
||||||
vertSizer->Add( horSizer, 0, wxALIGN_CENTRE | wxALL, 5 );
|
vertSizer->Add(horSizer.release(), 0, wxALIGN_CENTRE | wxALL, 5);
|
||||||
|
}
|
||||||
|
|
||||||
vertSizer->Add( CreateStdButtonSizer(this, eCancelButton|eOkButton), 0, wxEXPAND );
|
vertSizer->Add(CreateStdButtonSizer(this, eCancelButton | eOkButton).release(), 0, wxEXPAND);
|
||||||
|
|
||||||
|
SetAutoLayout(true);
|
||||||
|
SetSizer(uVertSizer.release());
|
||||||
|
}
|
||||||
|
|
||||||
SetAutoLayout( true );
|
|
||||||
SetSizer( vertSizer );
|
|
||||||
vertSizer->Fit( this );
|
vertSizer->Fit( this );
|
||||||
vertSizer->SetSizeHints( this );
|
vertSizer->SetSizeHints( this );
|
||||||
|
|
||||||
|
|
|
@ -751,19 +751,24 @@ wxDialog( parent, id, title, position, size, style | wxRESIZE_BORDER )
|
||||||
mFile = _mFile;
|
mFile = _mFile;
|
||||||
scount = mFile->GetStreamCount();
|
scount = mFile->GetStreamCount();
|
||||||
for (wxInt32 i = 0; i < scount; i++)
|
for (wxInt32 i = 0; i < scount; i++)
|
||||||
mFile->SetStreamUsage(i,FALSE);
|
mFile->SetStreamUsage(i, FALSE);
|
||||||
|
|
||||||
wxBoxSizer *vertSizer = new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer *vertSizer;
|
||||||
wxArrayString *choices = mFile->GetStreamInfo();
|
{
|
||||||
StreamList = safenew wxListBox(this, -1, wxDefaultPosition, wxDefaultSize, *choices , wxLB_EXTENDED | wxLB_ALWAYS_SB);
|
auto uVertSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
vertSizer = uVertSizer.get();
|
||||||
|
|
||||||
vertSizer->Add( StreamList, 1, wxEXPAND | wxALIGN_LEFT | wxALL, 5 );
|
wxArrayString *choices = mFile->GetStreamInfo();
|
||||||
|
StreamList = safenew wxListBox(this, -1, wxDefaultPosition, wxDefaultSize, *choices, wxLB_EXTENDED | wxLB_ALWAYS_SB);
|
||||||
|
|
||||||
vertSizer->Add( CreateStdButtonSizer(this, eCancelButton|eOkButton), 0, wxEXPAND );
|
vertSizer->Add(StreamList, 1, wxEXPAND | wxALIGN_LEFT | wxALL, 5);
|
||||||
|
|
||||||
SetAutoLayout( true );
|
vertSizer->Add(CreateStdButtonSizer(this, eCancelButton | eOkButton).release(), 0, wxEXPAND);
|
||||||
|
|
||||||
SetSizer( vertSizer );
|
SetAutoLayout(true);
|
||||||
|
|
||||||
|
SetSizer(uVertSizer.release());
|
||||||
|
}
|
||||||
|
|
||||||
vertSizer->Fit( this );
|
vertSizer->Fit( this );
|
||||||
|
|
||||||
|
|
|
@ -240,8 +240,8 @@ static wxString AskCopyOrEdit()
|
||||||
wxDialog dialog(NULL, -1, wxString(_("Warning")));
|
wxDialog dialog(NULL, -1, wxString(_("Warning")));
|
||||||
dialog.SetName(dialog.GetTitle());
|
dialog.SetName(dialog.GetTitle());
|
||||||
|
|
||||||
wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *vbox;
|
||||||
dialog.SetSizer(vbox);
|
dialog.SetSizer(vbox = safenew wxBoxSizer(wxVERTICAL));
|
||||||
|
|
||||||
wxStaticText *message = safenew wxStaticText(&dialog, -1, wxString::Format(_("\
|
wxStaticText *message = safenew wxStaticText(&dialog, -1, wxString::Format(_("\
|
||||||
When importing uncompressed audio files you can either copy them \
|
When importing uncompressed audio files you can either copy them \
|
||||||
|
@ -261,19 +261,27 @@ How do you want to import the current file(s)?"), oldCopyPref == wxT("copy") ? _
|
||||||
|
|
||||||
wxStaticBox *box = safenew wxStaticBox(&dialog, -1, _("Choose an import method"));
|
wxStaticBox *box = safenew wxStaticBox(&dialog, -1, _("Choose an import method"));
|
||||||
box->SetName(box->GetLabel());
|
box->SetName(box->GetLabel());
|
||||||
wxStaticBoxSizer *boxsizer = new wxStaticBoxSizer(box, wxVERTICAL);
|
|
||||||
|
|
||||||
wxRadioButton *copyRadio = safenew wxRadioButton(&dialog, -1, _("Make a © of the files before editing (safer)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
|
wxRadioButton *aliasRadio;
|
||||||
boxsizer->Add(copyRadio, 0, wxALL);
|
wxRadioButton *copyRadio;
|
||||||
copyRadio->SetName(wxStripMenuCodes(copyRadio->GetLabel()));
|
wxCheckBox *dontAskNextTimeBox;
|
||||||
|
|
||||||
wxRadioButton *aliasRadio = safenew wxRadioButton(&dialog, -1, _("Read the files &directly from the original (faster)"));
|
{
|
||||||
boxsizer->Add(aliasRadio, 0, wxALL);
|
auto boxsizer = std::make_unique<wxStaticBoxSizer>(box, wxVERTICAL);
|
||||||
aliasRadio->SetName(wxStripMenuCodes(aliasRadio->GetLabel()));
|
|
||||||
|
copyRadio = safenew wxRadioButton(&dialog, -1, _("Make a © of the files before editing (safer)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
|
||||||
|
boxsizer->Add(copyRadio, 0, wxALL);
|
||||||
|
copyRadio->SetName(wxStripMenuCodes(copyRadio->GetLabel()));
|
||||||
|
|
||||||
|
aliasRadio = safenew wxRadioButton(&dialog, -1, _("Read the files &directly from the original (faster)"));
|
||||||
|
boxsizer->Add(aliasRadio, 0, wxALL);
|
||||||
|
aliasRadio->SetName(wxStripMenuCodes(aliasRadio->GetLabel()));
|
||||||
|
|
||||||
|
dontAskNextTimeBox = safenew wxCheckBox(&dialog, -1, _("Don't &warn again and always use my choice above"));
|
||||||
|
boxsizer->Add(dontAskNextTimeBox, 0, wxALL);
|
||||||
|
vbox->Add(boxsizer.release(), 0, wxALL, 10);
|
||||||
|
}
|
||||||
|
|
||||||
wxCheckBox *dontAskNextTimeBox = safenew wxCheckBox(&dialog, -1, _("Don't &warn again and always use my choice above"));
|
|
||||||
boxsizer->Add(dontAskNextTimeBox, 0, wxALL);
|
|
||||||
vbox->Add(boxsizer, 0, wxALL, 10);
|
|
||||||
dontAskNextTimeBox->SetName(wxStripMenuCodes(dontAskNextTimeBox->GetLabel()));
|
dontAskNextTimeBox->SetName(wxStripMenuCodes(dontAskNextTimeBox->GetLabel()));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -282,8 +282,8 @@ void ControlToolBar::ArrangeButtons()
|
||||||
Detach( mSizer );
|
Detach( mSizer );
|
||||||
delete mSizer;
|
delete mSizer;
|
||||||
}
|
}
|
||||||
mSizer = new wxBoxSizer( wxHORIZONTAL );
|
|
||||||
Add( mSizer, 1, wxEXPAND );
|
Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);
|
||||||
|
|
||||||
// Start with a little extra space
|
// Start with a little extra space
|
||||||
mSizer->Add( 5, 55 );
|
mSizer->Add( 5, 55 );
|
||||||
|
|
|
@ -113,8 +113,7 @@ void MeterToolBar::ReCreateButtons()
|
||||||
|
|
||||||
void MeterToolBar::Populate()
|
void MeterToolBar::Populate()
|
||||||
{
|
{
|
||||||
mSizer = new wxGridBagSizer();
|
Add((mSizer = safenew wxGridBagSizer()), 1, wxEXPAND);
|
||||||
Add( mSizer, 1, wxEXPAND );
|
|
||||||
|
|
||||||
if( mWhichMeters & kWithRecordMeter ){
|
if( mWhichMeters & kWithRecordMeter ){
|
||||||
//JKC: Record on left, playback on right. Left to right flow
|
//JKC: Record on left, playback on right. Left to right flow
|
||||||
|
|
|
@ -114,7 +114,6 @@ void SelectionBar::Populate()
|
||||||
SetFont(wxFont(9, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
SetFont(wxFont(9, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||||
|
|
||||||
wxFlexGridSizer *mainSizer;
|
wxFlexGridSizer *mainSizer;
|
||||||
wxBoxSizer *hSizer;
|
|
||||||
|
|
||||||
/* we don't actually need a control yet, but we want to use it's methods
|
/* we don't actually need a control yet, but we want to use it's methods
|
||||||
* to do some look-ups, so we'll have to create one. We can't make the
|
* to do some look-ups, so we'll have to create one. We can't make the
|
||||||
|
@ -122,8 +121,7 @@ void SelectionBar::Populate()
|
||||||
* runtime */
|
* runtime */
|
||||||
wxString formatName = mListener ? mListener->AS_GetSelectionFormat() : wxString(wxEmptyString);
|
wxString formatName = mListener ? mListener->AS_GetSelectionFormat() : wxString(wxEmptyString);
|
||||||
|
|
||||||
mainSizer = new wxFlexGridSizer(7, 1, 1);
|
Add((mainSizer = safenew wxFlexGridSizer(7, 1, 1)), 0, wxALIGN_CENTER_VERTICAL);
|
||||||
Add(mainSizer, 0, wxALIGN_CENTER_VERTICAL);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Top row (mostly labels)
|
// Top row (mostly labels)
|
||||||
|
@ -150,19 +148,20 @@ void SelectionBar::Populate()
|
||||||
bool showSelectionLength = false;
|
bool showSelectionLength = false;
|
||||||
gPrefs->Read(wxT("/ShowSelectionLength"), &showSelectionLength);
|
gPrefs->Read(wxT("/ShowSelectionLength"), &showSelectionLength);
|
||||||
|
|
||||||
hSizer = new wxBoxSizer(wxHORIZONTAL);
|
{
|
||||||
mRightEndButton = safenew wxRadioButton(this, OnEndRadioID, _("End"),
|
auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
wxDefaultPosition, wxDefaultSize,
|
mRightEndButton = safenew wxRadioButton(this, OnEndRadioID, _("End"),
|
||||||
wxRB_GROUP);
|
wxDefaultPosition, wxDefaultSize,
|
||||||
mRightEndButton->SetName(_("End"));
|
wxRB_GROUP);
|
||||||
mRightEndButton->SetValue(!showSelectionLength);
|
mRightEndButton->SetName(_("End"));
|
||||||
hSizer->Add(mRightEndButton,
|
mRightEndButton->SetValue(!showSelectionLength);
|
||||||
0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 5);
|
hSizer->Add(mRightEndButton,
|
||||||
mRightLengthButton = safenew wxRadioButton(this, OnLengthRadioID, _("Length"));
|
0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 5);
|
||||||
mRightLengthButton->SetName(_("Length"));
|
mRightLengthButton = safenew wxRadioButton(this, OnLengthRadioID, _("Length"));
|
||||||
mRightLengthButton->SetValue(showSelectionLength);
|
mRightLengthButton->SetName(_("Length"));
|
||||||
hSizer->Add(mRightLengthButton,
|
mRightLengthButton->SetValue(showSelectionLength);
|
||||||
0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
hSizer->Add(mRightLengthButton,
|
||||||
|
0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
// Refer to Microsoft KB article 261192 for an explanation as
|
// Refer to Microsoft KB article 261192 for an explanation as
|
||||||
// to why this is needed. We've only experienced it under Win2k
|
// to why this is needed. We've only experienced it under Win2k
|
||||||
|
@ -170,12 +169,13 @@ void SelectionBar::Populate()
|
||||||
// in for all versions.
|
// in for all versions.
|
||||||
wxRadioButton* dummyButton =
|
wxRadioButton* dummyButton =
|
||||||
safenew wxRadioButton(this, wxID_ANY, _("hidden"),
|
safenew wxRadioButton(this, wxID_ANY, _("hidden"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxRB_GROUP);
|
wxRB_GROUP);
|
||||||
dummyButton->Disable();
|
dummyButton->Disable();
|
||||||
dummyButton->Hide();
|
dummyButton->Hide();
|
||||||
#endif
|
#endif
|
||||||
mainSizer->Add(hSizer, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
mainSizer->Add(hSizer.release(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
||||||
|
}
|
||||||
|
|
||||||
mainSizer->Add(5, 1);
|
mainSizer->Add(5, 1);
|
||||||
|
|
||||||
|
|
|
@ -123,8 +123,8 @@ void SpectralSelectionBar::Populate()
|
||||||
? mListener->SSBL_GetBandwidthSelectionFormatName()
|
? mListener->SSBL_GetBandwidthSelectionFormatName()
|
||||||
: wxString(wxEmptyString);
|
: wxString(wxEmptyString);
|
||||||
|
|
||||||
wxFlexGridSizer *mainSizer = new wxFlexGridSizer(1, 1, 1);
|
wxFlexGridSizer *mainSizer;
|
||||||
Add(mainSizer, 0, wxALIGN_CENTER_VERTICAL);
|
Add((mainSizer = safenew wxFlexGridSizer(1, 1, 1)), 0, wxALIGN_CENTER_VERTICAL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Top row, choice box
|
// Top row, choice box
|
||||||
|
@ -144,42 +144,44 @@ void SpectralSelectionBar::Populate()
|
||||||
// Bottom row, split into two columns, each with one control
|
// Bottom row, split into two columns, each with one control
|
||||||
//
|
//
|
||||||
|
|
||||||
wxBoxSizer *subSizer = new wxBoxSizer(wxHORIZONTAL);
|
{
|
||||||
|
auto subSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
mCenterCtrl = safenew NumericTextCtrl(
|
mCenterCtrl = safenew NumericTextCtrl(
|
||||||
NumericConverter::FREQUENCY, this, OnCenterID, frequencyFormatName, 0.0);
|
NumericConverter::FREQUENCY, this, OnCenterID, frequencyFormatName, 0.0);
|
||||||
mCenterCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
|
mCenterCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
|
||||||
mCenterCtrl->SetName(_("Center Frequency:"));
|
mCenterCtrl->SetName(_("Center Frequency:"));
|
||||||
mCenterCtrl->EnableMenu();
|
mCenterCtrl->EnableMenu();
|
||||||
subSizer->Add(mCenterCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
subSizer->Add(mCenterCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
||||||
|
|
||||||
mWidthCtrl = safenew NumericTextCtrl(
|
mWidthCtrl = safenew NumericTextCtrl(
|
||||||
NumericConverter::BANDWIDTH, this, OnWidthID, bandwidthFormatName, 0.0);
|
NumericConverter::BANDWIDTH, this, OnWidthID, bandwidthFormatName, 0.0);
|
||||||
mWidthCtrl->SetInvalidValue(-1.0);
|
mWidthCtrl->SetInvalidValue(-1.0);
|
||||||
mWidthCtrl->SetName(wxString(_("Bandwidth:")));
|
mWidthCtrl->SetName(wxString(_("Bandwidth:")));
|
||||||
mWidthCtrl->EnableMenu();
|
mWidthCtrl->EnableMenu();
|
||||||
subSizer->Add(mWidthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
subSizer->Add(mWidthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
||||||
|
|
||||||
mLowCtrl = safenew NumericTextCtrl(
|
mLowCtrl = safenew NumericTextCtrl(
|
||||||
NumericConverter::FREQUENCY, this, OnLowID, frequencyFormatName, 0.0);
|
NumericConverter::FREQUENCY, this, OnLowID, frequencyFormatName, 0.0);
|
||||||
mLowCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
|
mLowCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
|
||||||
mLowCtrl->SetName(_("Low Frequency:"));
|
mLowCtrl->SetName(_("Low Frequency:"));
|
||||||
mLowCtrl->EnableMenu();
|
mLowCtrl->EnableMenu();
|
||||||
subSizer->Add(mLowCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
subSizer->Add(mLowCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
||||||
|
|
||||||
mHighCtrl = safenew NumericTextCtrl(
|
mHighCtrl = safenew NumericTextCtrl(
|
||||||
NumericConverter::FREQUENCY, this, OnHighID, frequencyFormatName, 0.0);
|
NumericConverter::FREQUENCY, this, OnHighID, frequencyFormatName, 0.0);
|
||||||
mHighCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
|
mHighCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
|
||||||
mHighCtrl->SetName(wxString(_("High Frequency:")));
|
mHighCtrl->SetName(wxString(_("High Frequency:")));
|
||||||
mHighCtrl->EnableMenu();
|
mHighCtrl->EnableMenu();
|
||||||
subSizer->Add(mHighCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
subSizer->Add(mHighCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
||||||
|
|
||||||
mCenterCtrl->Show(mbCenterAndWidth);
|
mCenterCtrl->Show(mbCenterAndWidth);
|
||||||
mWidthCtrl->Show(mbCenterAndWidth);
|
mWidthCtrl->Show(mbCenterAndWidth);
|
||||||
mLowCtrl->Show(!mbCenterAndWidth);
|
mLowCtrl->Show(!mbCenterAndWidth);
|
||||||
mHighCtrl->Show(!mbCenterAndWidth);
|
mHighCtrl->Show(!mbCenterAndWidth);
|
||||||
|
|
||||||
mainSizer->Add(subSizer, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
mainSizer->Add(subSizer.release(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
||||||
|
}
|
||||||
|
|
||||||
mainSizer->Layout();
|
mainSizer->Layout();
|
||||||
|
|
||||||
|
|
|
@ -430,8 +430,7 @@ void ToolBar::ReCreateButtons()
|
||||||
ms->Add( mGrabber, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP | wxRIGHT, 1 );
|
ms->Add( mGrabber, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP | wxRIGHT, 1 );
|
||||||
|
|
||||||
// Use a box sizer for laying out controls
|
// Use a box sizer for laying out controls
|
||||||
mHSizer = new wxBoxSizer( wxHORIZONTAL );
|
ms->Add((mHSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);
|
||||||
ms->Add( mHSizer, 1, wxEXPAND );
|
|
||||||
|
|
||||||
// (Re)Establish dock state
|
// (Re)Establish dock state
|
||||||
SetDocked( GetDock(), false );
|
SetDocked( GetDock(), false );
|
||||||
|
|
|
@ -118,25 +118,28 @@ class ToolFrame:public wxFrame
|
||||||
mBar = bar;
|
mBar = bar;
|
||||||
|
|
||||||
// Transfer the bar to the ferry
|
// Transfer the bar to the ferry
|
||||||
bar->Reparent( this );
|
bar->Reparent(this);
|
||||||
|
|
||||||
// We use a sizer to maintain proper spacing
|
|
||||||
wxBoxSizer *s = new wxBoxSizer( wxHORIZONTAL );
|
|
||||||
|
|
||||||
// Add the bar to the sizer
|
|
||||||
s->Add( bar, 1, wxEXPAND | wxALL, border );
|
|
||||||
|
|
||||||
// Add space for the resize grabber
|
|
||||||
if( bar->IsResizable() )
|
|
||||||
{
|
{
|
||||||
s->Add( sizerW, 1 );
|
// We use a sizer to maintain proper spacing
|
||||||
width += sizerW;
|
auto s = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
|
// Add the bar to the sizer
|
||||||
|
s->Add(bar, 1, wxEXPAND | wxALL, border);
|
||||||
|
|
||||||
|
// Add space for the resize grabber
|
||||||
|
if (bar->IsResizable())
|
||||||
|
{
|
||||||
|
s->Add(sizerW, 1);
|
||||||
|
width += sizerW;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetSize(width + 2, bar->GetDockedSize().y + 2);
|
||||||
|
|
||||||
|
// Attach the sizer and resize the window to fit
|
||||||
|
SetSizer(s.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
SetSize( width + 2, bar->GetDockedSize().y + 2 );
|
|
||||||
|
|
||||||
// Attach the sizer and resize the window to fit
|
|
||||||
SetSizer( s );
|
|
||||||
Layout();
|
Layout();
|
||||||
|
|
||||||
// Inform toolbar of change
|
// Inform toolbar of change
|
||||||
|
|
|
@ -186,8 +186,7 @@ AButton * ToolsToolBar::MakeTool( teBmps eTool,
|
||||||
void ToolsToolBar::Populate()
|
void ToolsToolBar::Populate()
|
||||||
{
|
{
|
||||||
MakeButtonBackgroundsSmall();
|
MakeButtonBackgroundsSmall();
|
||||||
mToolSizer = new wxGridSizer( 2, 3, 1, 1 );
|
Add(mToolSizer = safenew wxGridSizer(2, 3, 1, 1));
|
||||||
Add( mToolSizer );
|
|
||||||
|
|
||||||
/* Tools */
|
/* Tools */
|
||||||
mTool[ selectTool ] = MakeTool( bmpIBeam, selectTool, _("Selection Tool") );
|
mTool[ selectTool ] = MakeTool( bmpIBeam, selectTool, _("Selection Tool") );
|
||||||
|
|
|
@ -109,28 +109,33 @@ ErrorDialog::ErrorDialog(
|
||||||
#if 0
|
#if 0
|
||||||
// Original non ShuttleGui based code.
|
// Original non ShuttleGui based code.
|
||||||
// Layout did not look good on Windows.
|
// Layout did not look good on Windows.
|
||||||
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer mainSizer;
|
||||||
wxBoxSizer *vSizer = new wxBoxSizer(wxVERTICAL);
|
{
|
||||||
|
auto uMainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
mainSizer = uMainSizer.get();
|
||||||
|
wxBoxSizer *vSizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
wxBoxSizer *hSizer = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *hSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
wxStaticText *statText = safenew wxStaticText(this, -1, message);
|
wxStaticText *statText = safenew wxStaticText(this, -1, message);
|
||||||
mainSizer->Add(statText, 0, wxALIGN_LEFT|wxALL, 5);
|
mainSizer->Add(statText, 0, wxALIGN_LEFT|wxALL, 5);
|
||||||
|
|
||||||
wxButton *help = safenew wxButton(this, wxID_HELP, _("Help"));
|
wxButton *help = safenew wxButton(this, wxID_HELP, _("Help"));
|
||||||
hSizer->Add(help, 0, wxALIGN_LEFT|wxALL, 5);
|
hSizer->Add(help, 0, wxALIGN_LEFT|wxALL, 5);
|
||||||
|
|
||||||
wxButton *ok = safenew wxButton(this, wxID_OK, _("OK"));
|
wxButton *ok = safenew wxButton(this, wxID_OK, _("OK"));
|
||||||
ok->SetDefault();
|
ok->SetDefault();
|
||||||
ok->SetFocus();
|
ok->SetFocus();
|
||||||
hSizer->Add(ok, 0, wxALIGN_RIGHT|wxALL, 5);
|
hSizer->Add(ok, 0, wxALIGN_RIGHT|wxALL, 5);
|
||||||
|
|
||||||
vSizer->Add(hSizer, 0, wxALIGN_CENTER|wxALL, 5);
|
vSizer->Add(hSizer, 0, wxALIGN_CENTER|wxALL, 5);
|
||||||
|
|
||||||
mainSizer->Add(vSizer, 0, wxALL, 15 );
|
mainSizer->Add(vSizer, 0, wxALL, 15 );
|
||||||
|
|
||||||
|
SetAutoLayout(true);
|
||||||
|
SetSizer(uMainSizer.release());
|
||||||
|
}
|
||||||
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(mainSizer);
|
|
||||||
mainSizer->Fit(this);
|
mainSizer->Fit(this);
|
||||||
mainSizer->SetSizeHints(this);
|
mainSizer->SetSizeHints(this);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -68,65 +68,78 @@ MultiDialog::MultiDialog(wxWindow * pParent,
|
||||||
{
|
{
|
||||||
SetName(GetTitle());
|
SetName(GetTitle());
|
||||||
|
|
||||||
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
|
wxString *buttonLabels;
|
||||||
wxBoxSizer *vSizer = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *mainSizer;
|
||||||
wxBoxSizer *iconAndTextSizer = new wxBoxSizer( wxHORIZONTAL );
|
|
||||||
|
|
||||||
wxBitmap bitmap = wxArtProvider::GetIcon(wxART_WARNING,
|
|
||||||
wxART_MESSAGE_BOX);
|
|
||||||
wxStaticBitmap *icon = safenew wxStaticBitmap(this, -1, bitmap);
|
|
||||||
iconAndTextSizer->Add( icon, 0, wxCENTER );
|
|
||||||
|
|
||||||
wxStaticText *statText = safenew wxStaticText(this, -1, message);
|
|
||||||
statText->SetName(message); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
|
||||||
iconAndTextSizer->Add(statText, 1, wxCENTER|wxLEFT,15 );
|
|
||||||
|
|
||||||
vSizer->Add(iconAndTextSizer, 0, wxALIGN_LEFT|wxALL, 5);
|
|
||||||
|
|
||||||
|
|
||||||
int count=0;
|
|
||||||
while(buttons[count])count++;
|
|
||||||
wxString *buttonLabels = new wxString[count];
|
|
||||||
|
|
||||||
count=0;
|
|
||||||
while(buttons[count]){
|
|
||||||
buttonLabels[count] = buttons[count];
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
mRadioBox = safenew wxRadioBox(this,-1,
|
|
||||||
boxMsg,
|
|
||||||
wxDefaultPosition, wxDefaultSize,
|
|
||||||
count, buttonLabels,
|
|
||||||
1, wxRA_SPECIFY_COLS);
|
|
||||||
mRadioBox->SetName(boxMsg);
|
|
||||||
mRadioBox->SetSelection(0);
|
|
||||||
vSizer->Add(mRadioBox, 1, wxEXPAND | wxALIGN_CENTER | wxALL, 5);
|
|
||||||
|
|
||||||
|
|
||||||
wxBoxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
|
|
||||||
wxButton* pButton;
|
|
||||||
if(log)
|
|
||||||
{
|
{
|
||||||
pButton = safenew wxButton(this, ID_SHOW_LOG_BUTTON, _("Show Log for Details"));
|
auto uMainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
buttonSizer->Add(pButton, 0, wxALIGN_LEFT | wxALL, 5);
|
mainSizer = uMainSizer.get();
|
||||||
pButton->SetDefault(); // Encourage user to look at files.
|
|
||||||
|
|
||||||
buttonSizer->AddSpacer(40);
|
{
|
||||||
|
auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
{
|
||||||
|
auto iconAndTextSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
|
wxBitmap bitmap = wxArtProvider::GetIcon(wxART_WARNING,
|
||||||
|
wxART_MESSAGE_BOX);
|
||||||
|
wxStaticBitmap *icon = safenew wxStaticBitmap(this, -1, bitmap);
|
||||||
|
iconAndTextSizer->Add(icon, 0, wxCENTER);
|
||||||
|
|
||||||
|
wxStaticText *statText = safenew wxStaticText(this, -1, message);
|
||||||
|
statText->SetName(message); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
||||||
|
iconAndTextSizer->Add(statText, 1, wxCENTER | wxLEFT, 15);
|
||||||
|
|
||||||
|
vSizer->Add(iconAndTextSizer.release(), 0, wxALIGN_LEFT | wxALL, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
while (buttons[count])count++;
|
||||||
|
buttonLabels = new wxString[count];
|
||||||
|
|
||||||
|
count = 0;
|
||||||
|
while (buttons[count]){
|
||||||
|
buttonLabels[count] = buttons[count];
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
mRadioBox = safenew wxRadioBox(this, -1,
|
||||||
|
boxMsg,
|
||||||
|
wxDefaultPosition, wxDefaultSize,
|
||||||
|
count, buttonLabels,
|
||||||
|
1, wxRA_SPECIFY_COLS);
|
||||||
|
mRadioBox->SetName(boxMsg);
|
||||||
|
mRadioBox->SetSelection(0);
|
||||||
|
vSizer->Add(mRadioBox, 1, wxEXPAND | wxALIGN_CENTER | wxALL, 5);
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
auto buttonSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
|
wxButton* pButton;
|
||||||
|
if (log)
|
||||||
|
{
|
||||||
|
pButton = safenew wxButton(this, ID_SHOW_LOG_BUTTON, _("Show Log for Details"));
|
||||||
|
buttonSizer->Add(pButton, 0, wxALIGN_LEFT | wxALL, 5);
|
||||||
|
pButton->SetDefault(); // Encourage user to look at files.
|
||||||
|
|
||||||
|
buttonSizer->AddSpacer(40);
|
||||||
|
}
|
||||||
|
|
||||||
|
pButton = safenew wxButton(this, wxID_OK, _("OK"));
|
||||||
|
if (!log)
|
||||||
|
pButton->SetDefault();
|
||||||
|
buttonSizer->Add(pButton, 0, wxALIGN_RIGHT | wxALL, 5);
|
||||||
|
|
||||||
|
vSizer->Add(buttonSizer.release(), 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
mainSizer->Add(vSizer.release(), 0, wxALL, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetAutoLayout(true);
|
||||||
|
SetSizer(uMainSizer.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
pButton = safenew wxButton(this, wxID_OK, _("OK"));
|
|
||||||
if(!log)
|
|
||||||
pButton->SetDefault();
|
|
||||||
buttonSizer->Add(pButton, 0, wxALIGN_RIGHT | wxALL, 5);
|
|
||||||
|
|
||||||
vSizer->Add(buttonSizer, 0, wxALIGN_CENTER | wxALL, 5);
|
|
||||||
|
|
||||||
|
|
||||||
mainSizer->Add(vSizer, 0, wxALL, 5);
|
|
||||||
SetAutoLayout(true);
|
|
||||||
SetSizer(mainSizer);
|
|
||||||
mainSizer->Fit(this);
|
mainSizer->Fit(this);
|
||||||
mainSizer->SetSizeHints(this);
|
mainSizer->SetSizeHints(this);
|
||||||
delete[] buttonLabels;
|
delete[] buttonLabels;
|
||||||
|
|
|
@ -1087,101 +1087,111 @@ bool ProgressDialog::Create(const wxString & title,
|
||||||
}
|
}
|
||||||
SetName(GetTitle());
|
SetName(GetTitle());
|
||||||
|
|
||||||
wxBoxSizer *v;
|
|
||||||
wxWindow *w;
|
wxWindow *w;
|
||||||
wxSize ds;
|
wxSize ds;
|
||||||
|
|
||||||
SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT);
|
SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT);
|
||||||
|
|
||||||
v = new wxBoxSizer(wxVERTICAL);
|
wxFlexGridSizer *g;
|
||||||
|
wxBoxSizer *h;
|
||||||
mMessage = safenew wxStaticText(this,
|
|
||||||
wxID_ANY,
|
|
||||||
message,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxDefaultSize,
|
|
||||||
wxALIGN_LEFT);
|
|
||||||
mMessage->SetName(message); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
|
||||||
v->Add(mMessage, 1, wxEXPAND | wxALL, 10);
|
|
||||||
ds.y += mMessage->GetSize().y + 20;
|
|
||||||
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
mGauge = safenew wxGauge(this,
|
|
||||||
wxID_ANY,
|
|
||||||
1000,
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxDefaultSize,
|
|
||||||
wxGA_HORIZONTAL);
|
|
||||||
v->Add(mGauge, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10);
|
|
||||||
ds.y += mGauge->GetSize().y + 10;
|
|
||||||
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
wxFlexGridSizer *g = new wxFlexGridSizer(2, 2, 10, 10);
|
|
||||||
|
|
||||||
w = safenew wxStaticText(this,
|
|
||||||
wxID_ANY,
|
|
||||||
_("Elapsed Time:"),
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxDefaultSize,
|
|
||||||
wxALIGN_RIGHT);
|
|
||||||
w->SetName(w->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
|
||||||
g->Add(w, 0, wxALIGN_RIGHT);
|
|
||||||
|
|
||||||
mElapsed = safenew wxStaticText(this,
|
|
||||||
wxID_ANY,
|
|
||||||
wxT("00:00:00"),
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxDefaultSize,
|
|
||||||
wxALIGN_LEFT);
|
|
||||||
mElapsed->SetName(mElapsed->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
|
||||||
g->Add(mElapsed, 0, wxALIGN_LEFT);
|
|
||||||
ds.y += mElapsed->GetSize().y + 10;
|
|
||||||
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
w = safenew wxStaticText(this,
|
|
||||||
wxID_ANY,
|
|
||||||
_("Remaining Time:"),
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxDefaultSize,
|
|
||||||
wxALIGN_RIGHT);
|
|
||||||
w->SetName(w->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
|
||||||
g->Add(w, 0, wxALIGN_RIGHT);
|
|
||||||
|
|
||||||
mRemaining = safenew wxStaticText(this,
|
|
||||||
wxID_ANY,
|
|
||||||
wxT("00:00:00"),
|
|
||||||
wxDefaultPosition,
|
|
||||||
wxDefaultSize,
|
|
||||||
wxALIGN_LEFT);
|
|
||||||
mRemaining->SetName(mRemaining->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
|
||||||
g->Add(mRemaining, 0, wxALIGN_LEFT);
|
|
||||||
|
|
||||||
v->Add(g, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT | wxBOTTOM, 10);
|
|
||||||
ds.y += mRemaining->GetSize().y + 10;
|
|
||||||
|
|
||||||
wxBoxSizer *h = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
|
|
||||||
if (!(flags & pdlgHideStopButton))
|
|
||||||
{
|
{
|
||||||
w = safenew wxButton(this, wxID_OK, _("Stop"));
|
auto v = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
h->Add(w, 0, wxRIGHT, 10);
|
|
||||||
|
mMessage = safenew wxStaticText(this,
|
||||||
|
wxID_ANY,
|
||||||
|
message,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
wxALIGN_LEFT);
|
||||||
|
mMessage->SetName(message); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
||||||
|
v->Add(mMessage, 1, wxEXPAND | wxALL, 10);
|
||||||
|
ds.y += mMessage->GetSize().y + 20;
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
mGauge = safenew wxGauge(this,
|
||||||
|
wxID_ANY,
|
||||||
|
1000,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
wxGA_HORIZONTAL);
|
||||||
|
v->Add(mGauge, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10);
|
||||||
|
ds.y += mGauge->GetSize().y + 10;
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
{
|
||||||
|
auto ug = std::make_unique<wxFlexGridSizer>(2, 2, 10, 10);
|
||||||
|
g = ug.get();
|
||||||
|
|
||||||
|
w = safenew wxStaticText(this,
|
||||||
|
wxID_ANY,
|
||||||
|
_("Elapsed Time:"),
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
wxALIGN_RIGHT);
|
||||||
|
w->SetName(w->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
||||||
|
g->Add(w, 0, wxALIGN_RIGHT);
|
||||||
|
|
||||||
|
mElapsed = safenew wxStaticText(this,
|
||||||
|
wxID_ANY,
|
||||||
|
wxT("00:00:00"),
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
wxALIGN_LEFT);
|
||||||
|
mElapsed->SetName(mElapsed->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
||||||
|
g->Add(mElapsed, 0, wxALIGN_LEFT);
|
||||||
|
ds.y += mElapsed->GetSize().y + 10;
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
w = safenew wxStaticText(this,
|
||||||
|
wxID_ANY,
|
||||||
|
_("Remaining Time:"),
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
wxALIGN_RIGHT);
|
||||||
|
w->SetName(w->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
||||||
|
g->Add(w, 0, wxALIGN_RIGHT);
|
||||||
|
|
||||||
|
mRemaining = safenew wxStaticText(this,
|
||||||
|
wxID_ANY,
|
||||||
|
wxT("00:00:00"),
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
wxALIGN_LEFT);
|
||||||
|
mRemaining->SetName(mRemaining->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
|
||||||
|
g->Add(mRemaining, 0, wxALIGN_LEFT);
|
||||||
|
|
||||||
|
v->Add(ug.release(), 0, wxALIGN_CENTER | wxLEFT | wxRIGHT | wxBOTTOM, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
ds.y += mRemaining->GetSize().y + 10;
|
||||||
|
|
||||||
|
{
|
||||||
|
auto uh = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
h = uh.get();
|
||||||
|
|
||||||
|
if (!(flags & pdlgHideStopButton))
|
||||||
|
{
|
||||||
|
w = safenew wxButton(this, wxID_OK, _("Stop"));
|
||||||
|
h->Add(w, 0, wxRIGHT, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(flags & pdlgHideCancelButton))
|
||||||
|
{
|
||||||
|
w = safenew wxButton(this, wxID_CANCEL, _("Cancel"));
|
||||||
|
h->Add(w, 0, wxRIGHT, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
v->Add(uh.release(), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetSizer(v.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & pdlgHideCancelButton))
|
|
||||||
{
|
|
||||||
w = safenew wxButton(this, wxID_CANCEL, _("Cancel"));
|
|
||||||
h->Add(w, 0, wxRIGHT, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
v->Add(h, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 10);
|
|
||||||
|
|
||||||
SetSizer(v);
|
|
||||||
Layout();
|
Layout();
|
||||||
|
|
||||||
ds.x = wxMax(g->GetSize().x, h->GetSize().x) + 10;
|
ds.x = wxMax(g->GetSize().x, h->GetSize().x) + 10;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user