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:
parent
b5dc59677c
commit
71000f6cb2
@ -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,15 +2984,11 @@ bool EffectUIHost::Initialize()
|
|||||||
|
|
||||||
bar->SetSizerAndFit(bs);
|
bar->SetSizerAndFit(bs);
|
||||||
|
|
||||||
long buttons = eApplyButton;
|
long buttons = eApplyButton + eCloseButton;
|
||||||
if (!mIsBatch)
|
|
||||||
{
|
|
||||||
buttons += eCloseButton;
|
|
||||||
if (mEffect->mUIDebug)
|
if (mEffect->mUIDebug)
|
||||||
{
|
{
|
||||||
buttons += eDebugButton;
|
buttons += eDebugButton;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
wxSizer *s = CreateStdButtonSizer(this, buttons, bar);
|
wxSizer *s = CreateStdButtonSizer(this, buttons, bar);
|
||||||
vs->Add(s, 0, wxEXPAND | wxALIGN_CENTER_VERTICAL);
|
vs->Add(s, 0, wxEXPAND | wxALIGN_CENTER_VERTICAL);
|
||||||
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user