mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 16:50:26 +02:00
Fix for bug #773
This is only a workaround since the real problem is in wxGTK. Hoping it has been fixed in wx3.
This commit is contained in:
parent
a869490b44
commit
994acab14f
@ -1876,6 +1876,10 @@ int Effect::GetAudioOutCount()
|
||||
return 0;
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(EffectDialog, wxDialog)
|
||||
EVT_BUTTON(wxID_OK, EffectDialog::OnOk)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
EffectDialog::EffectDialog(wxWindow * parent,
|
||||
const wxString & title,
|
||||
int type,
|
||||
@ -1950,6 +1954,21 @@ void EffectDialog::OnPreview(wxCommandEvent & WXUNUSED(event))
|
||||
return;
|
||||
}
|
||||
|
||||
void EffectDialog::OnOk(wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
// On wxGTK (wx2.8.12), the default action is still executed even if
|
||||
// the button is disabled. This appears to affect all wxDialogs, not
|
||||
// just our Effects dialogs. So, this is a only temporary workaround
|
||||
// for legacy effects that disable the OK button. Hopefully this has
|
||||
// been corrected in wx3.
|
||||
if (FindWindowById(wxID_OK)->IsEnabled() && Validate() && TransferDataFromWindow())
|
||||
{
|
||||
EndModal(true);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// EffectPanel
|
||||
|
@ -467,10 +467,13 @@ public:
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool Validate();
|
||||
virtual void OnPreview(wxCommandEvent & event);
|
||||
virtual void OnOk(wxCommandEvent & event);
|
||||
|
||||
private:
|
||||
int mType;
|
||||
int mAdditionalButtons;
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user