1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 16:40:07 +02:00

Make sure the current dialogs buttons are found...

...FindWindowById() looks at parents too
This commit is contained in:
Leland Lucius 2015-05-15 18:50:08 -05:00
parent b5dc59677c
commit 71000f6cb2

View File

@ -2630,7 +2630,7 @@ void EffectDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
// just our Effects dialogs. So, this is a only temporary workaround // just our Effects dialogs. So, this is a only temporary workaround
// for legacy effects that disable the OK button. Hopefully this has // for legacy effects that disable the OK button. Hopefully this has
// been corrected in wx3. // been corrected in wx3.
if (FindWindowById(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow()) if (FindWindow(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
{ {
EndModal(true); EndModal(true);
} }
@ -2984,14 +2984,10 @@ bool EffectUIHost::Initialize()
bar->SetSizerAndFit(bs); bar->SetSizerAndFit(bs);
long buttons = eApplyButton; long buttons = eApplyButton + eCloseButton;
if (!mIsBatch) if (mEffect->mUIDebug)
{ {
buttons += eCloseButton; buttons += eDebugButton;
if (mEffect->mUIDebug)
{
buttons += eDebugButton;
}
} }
wxSizer *s = CreateStdButtonSizer(this, buttons, bar); wxSizer *s = CreateStdButtonSizer(this, buttons, bar);
@ -3002,13 +2998,13 @@ bool EffectUIHost::Initialize()
Fit(); Fit();
Center(); Center();
mApplyBtn = (wxButton *) FindWindowById(wxID_APPLY); mApplyBtn = (wxButton *) FindWindow(wxID_APPLY);
mCloseBtn = (wxButton *) FindWindowById(wxID_CANCEL); mCloseBtn = (wxButton *) FindWindow(wxID_CANCEL);
UpdateControls(); UpdateControls();
w->SetAccept(!mIsGUI); w->SetAccept(!mIsGUI);
(!mIsGUI ? w : FindWindowById(wxID_APPLY))->SetFocus(); (!mIsGUI ? w : FindWindow(wxID_APPLY))->SetFocus();
LoadUserPresets(); LoadUserPresets();
@ -3075,7 +3071,7 @@ void EffectUIHost::OnApply(wxCommandEvent & evt)
// just our Effects dialogs. So, this is a only temporary workaround // just our Effects dialogs. So, this is a only temporary workaround
// for legacy effects that disable the OK button. Hopefully this has // for legacy effects that disable the OK button. Hopefully this has
// been corrected in wx3. // been corrected in wx3.
if (!FindWindowById(wxID_APPLY)->IsEnabled()) if (!FindWindow(wxID_APPLY)->IsEnabled())
{ {
return; return;
} }
@ -3222,7 +3218,7 @@ void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt))
menu->Append(0, _("About"), sub); menu->Append(0, _("About"), sub);
wxRect r = FindWindowById(kMenuID)->GetParent()->GetRect(); wxRect r = FindWindow(kMenuID)->GetParent()->GetRect();
PopupMenu(menu, wxPoint(r.GetLeft(), r.GetBottom())); PopupMenu(menu, wxPoint(r.GetLeft(), r.GetBottom()));
delete menu; delete menu;