]> git.saurik.com Git - wxWidgets.git/commitdiff
document the protected functions of wxTextValidator; it helps user to eventually...
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Thu, 5 Feb 2009 18:50:43 +0000 (18:50 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Thu, 5 Feb 2009 18:50:43 +0000 (18:50 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/valtext.h
interface/wx/valtext.h

index c5ca124b67ccd44cebba3c00f2528776d745bdf2..955a7f38f80cd0f1149f444922213f0056305922 100644 (file)
@@ -85,7 +85,7 @@ protected:
     // returns true if all characters of the given string are present in m_includes
     bool ContainsOnlyIncludedCharacters(const wxString& val) const;
 
-    // returns true if all characters of the given string are NOT present in m_excludes
+    // returns true if at least one character of the given string is present in m_excludes
     bool ContainsExcludedCharacters(const wxString& val) const;
 
     // returns the error message if the contents of 'val' are invalid
index 55978a5c4cb8fdd04dfcca70e57496fbd2b0e324..b96a58009031870ebd1eb69dbcf9807b23e3e59c 100644 (file)
@@ -117,9 +117,16 @@ public:
 
     /**
         Returns the validator style.
+
+        @see HasFlag()
     */
     long GetStyle() const;
 
+    /**
+        Returns @true if the given @a style bit is set in the current style.
+    */
+    bool HasFlag(wxTextValidatorStyle style) const;
+
     /**
         Receives character input from the window and filters it according to
         the current validator style.
@@ -159,6 +166,10 @@ public:
         of the ::wxTextValidatorStyle values.
 
         Note that not all possible combinations make sense!
+        Also note that the order in which the checks are performed is important,
+        in case you specify more than a single style.
+        wxTextValidator will perform the checks in the same definition order
+        used in the ::wxTextValidatorStyle enumeration.
     */
     void SetStyle(long style);
 
@@ -177,5 +188,25 @@ public:
         depending on the validator style.
     */
     virtual bool Validate(wxWindow* parent);
+
+protected:
+
+    /**
+        Returns @true if all the characters of the given @a val string
+        are present in the include list (set by SetIncludes() or SetCharIncludes()).
+    */
+    bool ContainsOnlyIncludedCharacters(const wxString& val) const;
+
+    /**
+        Returns true if at least one character of the given @a val string
+        is present in the exclude list (set by SetExcludes() or SetCharExcludes()).
+    */
+    bool ContainsExcludedCharacters(const wxString& val) const;
+
+    /**
+        Returns the error message if the contents of @a val are invalid
+        or the empty string if @a val is valid.
+    */
+    virtual wxString IsValid(const wxString& val) const;
 };