Use enum class to represent NumericType

This is for better type safety.
This commit is contained in:
Artur Wieczorek 2024-01-06 17:53:35 +01:00
parent e7ab6a6d53
commit 3cb3d62212
4 changed files with 19 additions and 10 deletions

View file

@ -162,13 +162,22 @@ constexpr wxPGNumericValidationMode wxPG_PROPERTY_VALIDATION_WRAP { wxPGNumericV
class WXDLLIMPEXP_PROPGRID wxNumericPropertyValidator : public wxTextValidator
{
public:
enum NumericType
enum class NumericType
{
Signed = 0,
Signed,
Unsigned,
Float
};
#if WXWIN_COMPATIBILITY_3_2
wxDEPRECATED_MSG("use NumericType::Signed instead")
static const NumericType Signed = NumericType::Signed;
wxDEPRECATED_MSG("use NumericType::Unsigned instead")
static const NumericType Unsigned = NumericType::Unsigned;
wxDEPRECATED_MSG("use NumericType::Float instead")
static const NumericType Float = NumericType::Float;
#endif // WXWIN_COMPATIBILITY_3_2
wxNumericPropertyValidator( NumericType numericType, int base = 10 );
virtual ~wxNumericPropertyValidator() = default;
virtual bool Validate(wxWindow* parent) override;