// Created: 2007-03-28
// RCS-ID: $Id$
// Copyright: (c) Jaakko Salli
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PROPGRID_PROPS_H_
#define _WX_PROPGRID_PROPS_H_
+#include "wx/defs.h"
+
#if wxUSE_PROPGRID
// -----------------------------------------------------------------------
#include "wx/textctrl.h"
#include "wx/button.h"
#include "wx/listbox.h"
+#include "wx/valtext.h"
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-/** Constants used with DoValidation() methods.
+/** Constants used with NumericValidation<>().
*/
-enum wxPGDoValidationConstants
+enum wxPGNumericValidationConstants
{
/** Instead of modifying the value, show an error message.
*/
// -----------------------------------------------------------------------
+#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.
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;
wxPGValidationInfo* pValidationInfo,
int mode =
wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE );
+ static wxValidator* GetClassValidator();
virtual wxValidator* DoGetValidator () const;
protected: