X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..9e9574fe45b176ee74bba8fad7574cf9906145d1:/interface/wx/validate.h diff --git a/interface/wx/validate.h b/interface/wx/validate.h index 76f4abd835..5a1c4e81d9 100644 --- a/interface/wx/validate.h +++ b/interface/wx/validate.h @@ -2,13 +2,11 @@ // Name: validate.h // Purpose: interface of wxValidator // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @class wxValidator - @wxheader{validate.h} wxValidator is the base class for a family of validator classes that mediate between a class of control, and application data. @@ -27,19 +25,14 @@ For more information, please see @ref overview_validator. - @beginWxPythonOnly - If you wish to create a validator class in wxPython you should derive the - class from @c wxPyValidator in order to get Python-aware capabilities for - the various virtual methods. - @endWxPythonOnly - @library{wxcore} @category{validator} @stdobjects ::wxDefaultValidator - @see @ref overview_validator, wxTextValidator, wxGenericValidator + @see @ref overview_validator, wxTextValidator, wxGenericValidator, + wxIntegerValidator, wxFloatingPointValidator */ class wxValidator : public wxEvtHandler { @@ -52,7 +45,7 @@ public: /** Destructor. */ - ~wxValidator(); + virtual ~wxValidator(); /** All validator classes must implement the Clone() function, which @@ -75,11 +68,33 @@ public: /** This functions switches on or turns off the error sound produced by the validators if an invalid key is pressed. + + @since 2.9.1 + + @param suppress + If @true, error sound is not played when a validator detects an + error. If @false, error sound is enabled. */ - void SetBellOnError(bool doIt = true); + static void SuppressBellOnError(bool suppress = true); + /** + Returns if the error sound is currently disabled. + */ + static bool IsSilent(); + /** Associates a window with the validator. + + This function is automatically called by wxWidgets when creating a wxWindow-derived + class instance which takes a wxValidator reference. + + E.g. + @code + new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, + wxTextValidator(wxFILTER_ALPHA, &g_data.m_string)); + @endcode + will automatically link the wxTextValidator instance with the wxTextCtrl + instance. */ void SetWindow(wxWindow* window); @@ -103,6 +118,9 @@ public: This overridable function is called when the value in the associated window must be validated. + @param parent + The parent of the window associated with the validator. + @return @false if the value in the window is not valid; you may pop up an error dialog. */ @@ -112,5 +130,5 @@ public: /** An empty, "null" wxValidator instance. */ -wxValidator wxDefaultValidator; +const wxValidator wxDefaultValidator;