Replace wxValidator::SetBellOnError() with SuppressBellOnError().
SetBellOnError() erroneously inversed the value of its parameter. Fixing it to behave correctly could silently break the existing code which might work around this bug already because it always behaved like this (ever since it was added 10.5 years ago). So instead simply deprecate this function and add a new SuppressBellOnError() one which behaves as expected. Closes #11318. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -173,7 +173,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString&title, int x, int y, int w, int
|
||||
|
||||
// All validators share a common (static) flag that controls
|
||||
// whether they beep on error. Here we turn it off:
|
||||
wxValidator::SetBellOnError(m_silent);
|
||||
wxValidator::SuppressBellOnError(m_silent);
|
||||
file_menu->Check(VALIDATE_TOGGLE_BELL, !wxValidator::IsSilent());
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
@@ -221,7 +221,7 @@ void MyFrame::OnTestDialog(wxCommandEvent& WXUNUSED(event))
|
||||
void MyFrame::OnToggleBell(wxCommandEvent& event)
|
||||
{
|
||||
m_silent = !m_silent;
|
||||
wxValidator::SetBellOnError(m_silent);
|
||||
wxValidator::SuppressBellOnError(m_silent);
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user