]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/propgrid/props.h
going private for m_peer to give a foundation for better encapsulation
[wxWidgets.git] / include / wx / propgrid / props.h
index daa54624034a6743b4373467ce3ff7b1e13afbe8..77470cda2c99d5c9bc7ea0bbf2adf3865d145bbf 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef _WX_PROPGRID_PROPS_H_
 #define _WX_PROPGRID_PROPS_H_
 
+#include "wx/defs.h"
+
 #if wxUSE_PROPGRID
 
 // -----------------------------------------------------------------------
@@ -25,6 +27,7 @@ class wxPGArrayEditorDialog;
 #include "wx/textctrl.h"
 #include "wx/button.h"
 #include "wx/listbox.h"
+#include "wx/valtext.h"
 
 // -----------------------------------------------------------------------
 
@@ -141,6 +144,29 @@ enum wxPGNumericValidationConstants
 
 // -----------------------------------------------------------------------
 
+#if wxUSE_VALIDATORS
+
+/**
+    A more comprehensive numeric validator class.
+*/
+class WXDLLIMPEXP_PROPGRID wxNumericPropertyValidator : public wxTextValidator
+{
+public:
+    enum NumericType
+    {
+        Signed = 0,
+        Unsigned,
+        Float
+    };
+
+    wxNumericPropertyValidator( NumericType numericType, int base = 10 );
+    virtual ~wxNumericPropertyValidator() { }
+    virtual bool Validate(wxWindow* parent);
+};
+
+#endif // wxUSE_VALIDATORS
+
+
 /** @class wxIntProperty
     @ingroup classes
     Basic property with integer value.
@@ -255,6 +281,7 @@ public:
     virtual bool DoSetAttribute( const wxString& name, wxVariant& value );
     virtual bool ValidateValue( wxVariant& value,
                                 wxPGValidationInfo& validationInfo ) const;
+    virtual wxValidator* DoGetValidator () const;
     virtual bool IntToValue( wxVariant& variant,
                              int number,
                              int argFlags = 0 ) const;
@@ -300,6 +327,7 @@ public:
                               wxPGValidationInfo* pValidationInfo,
                               int mode =
                                  wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE );
+    static wxValidator* GetClassValidator();
     virtual wxValidator* DoGetValidator () const;
 
 protected:
@@ -969,7 +997,7 @@ public:
     void SetCustomButton( const wxString& custBtText,
                           wxArrayStringProperty* pcc )
     {
-        if ( custBtText.length() )
+        if ( !custBtText.empty() )
         {
             EnableCustomNewAction();
             m_pCallingClass = pcc;