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:
@@ -62,10 +62,23 @@ public:
|
||||
wxWindow *GetWindow() const { return (wxWindow *)m_validatorWindow; }
|
||||
void SetWindow(wxWindowBase *win) { m_validatorWindow = win; }
|
||||
|
||||
// validators beep by default if invalid key is pressed, these functions
|
||||
// allow to change it
|
||||
// validators beep by default if invalid key is pressed, this function
|
||||
// allows to change this
|
||||
static void SuppressBellOnError(bool suppress = true)
|
||||
{ ms_isSilent = suppress; }
|
||||
|
||||
// test if beep is currently disabled
|
||||
static bool IsSilent() { return ms_isSilent; }
|
||||
static void SetBellOnError(bool doIt = true) { ms_isSilent = doIt; }
|
||||
|
||||
// this function is deprecated because it handled its parameter
|
||||
// unnaturally: it disabled the bell when it was true, not false as could
|
||||
// be expected; use SuppressBellOnError() instead
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
wxDEPRECATED_INLINE(
|
||||
static void SetBellOnError(bool doIt = true),
|
||||
ms_isSilent = doIt;
|
||||
)
|
||||
#endif
|
||||
|
||||
protected:
|
||||
wxWindowBase *m_validatorWindow;
|
||||
|
Reference in New Issue
Block a user