X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/adaaa68635b4c8a4d8c5284add40366ea3eefb07..23efa4bfb9104d6ef947a217efa80b2bc5bf9e76:/interface/wx/valtext.h diff --git a/interface/wx/valtext.h b/interface/wx/valtext.h index 21527bc796..c61435b3be 100644 --- a/interface/wx/valtext.h +++ b/interface/wx/valtext.h @@ -6,6 +6,46 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// + +/** + Styles used by wxTextValidator. +*/ +enum wxTextValidatorStyle +{ + /// No filtering takes place. + wxFILTER_NONE, + + /// Non-ASCII characters are filtered out. + wxFILTER_ASCII, + + /// Non-alpha characters are filtered out. + wxFILTER_ALPHA, + + /// Non-alphanumeric characters are filtered out. + wxFILTER_ALPHANUMERIC, + + /// Non-numeric characters are filtered out. + wxFILTER_NUMERIC, + + /// Use an include list. The validator checks if the user input is on + /// the list, complaining if not. See wxTextValidator::SetIncludes(). + wxFILTER_INCLUDE_LIST, + + /// Use an exclude list. The validator checks if the user input is on + /// the list, complaining if it is. See wxTextValidator::SetExcludes(). + wxFILTER_EXCLUDE_LIST, + + /// Use an include list. The validator checks if each input character is + /// in the list (one character per list element), complaining if not. + /// See wxTextValidator::SetIncludes(). + wxFILTER_INCLUDE_CHAR_LIST, + + /// Use an include list. The validator checks if each input character is + /// in the list (one character per list element), complaining if it is. + /// See wxTextValidator::SetExcludes(). + wxFILTER_EXCLUDE_CHAR_LIST +}; + /** @class wxTextValidator @@ -14,33 +54,6 @@ For more information, please see @ref overview_validator. - @beginStyleTable - @style{wxFILTER_NONE} - No filtering takes place. - @style{wxFILTER_ASCII} - Non-ASCII characters are filtered out. - @style{wxFILTER_ALPHA} - Non-alpha characters are filtered out. - @style{wxFILTER_ALPHANUMERIC} - Non-alphanumeric characters are filtered out. - @style{wxFILTER_NUMERIC} - Non-numeric characters are filtered out. - @style{wxFILTER_INCLUDE_LIST} - Use an include list. The validator checks if the user input is on - the list, complaining if not. See SetIncludes(). - @style{wxFILTER_EXCLUDE_LIST} - Use an exclude list. The validator checks if the user input is on - the list, complaining if it is. See SetExcludes(). - @style{wxFILTER_INCLUDE_CHAR_LIST} - Use an include list. The validator checks if each input character is - in the list (one character per list element), complaining if not. - See SetIncludes(). - @style{wxFILTER_EXCLUDE_CHAR_LIST} - Use an include list. The validator checks if each input character is - in the list (one character per list element), complaining if it is. - See SetExcludes(). - @endStyleTable - @library{wxcore} @category{validator} @@ -53,23 +66,24 @@ public: Default constructor. */ wxTextValidator(const wxTextValidator& validator); + /** Constructor taking a style and optional pointer to a wxString variable. @param style - A bitlist of flags documented in the class description. + One of the ::wxTextValidatorStyle styles. @param valPtr A pointer to a wxString variable that contains the value. This variable should have a lifetime equal to or longer than the validator lifetime (which is usually determined by the lifetime of the window). */ - wxTextValidator(long style = wxFILTER_NONE, wxString* valPtr = NULL); + wxTextValidator(wxTextValidatorStyle style = wxFILTER_NONE, wxString* valPtr = NULL); /** Clones the text validator using the copy constructor. */ - virtual wxValidator* Clone() const; + virtual wxObject* Clone() const; /** Returns a reference to the exclude list (the list of invalid values). @@ -84,7 +98,7 @@ public: /** Returns the validator style. */ - long GetStyle() const; + wxTextValidatorStyle GetStyle() const; /** Receives character input from the window and filters it according to @@ -105,7 +119,7 @@ public: /** Sets the validator style. */ - void SetStyle(long style); + void SetStyle(wxTextValidatorStyle style); /** Transfers the value in the text control to the string.