Allow retrieving wxPG_FLOAT_PRECISION and not just setting it.

It was possible to call SetAttribute() to change this attribute value but not
to get it back. Override DoGetAttribute() to also allow the latter.

See #15625.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75978 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-02-22 14:54:44 +00:00
parent 876859fcb7
commit d183babc8d
2 changed files with 12 additions and 0 deletions

View File

@ -316,6 +316,8 @@ public:
const wxString& text,
int argFlags = 0 ) const;
virtual bool DoSetAttribute( const wxString& name, wxVariant& value );
virtual wxVariant DoGetAttribute( const wxString& name ) const;
virtual bool ValidateValue( wxVariant& value,
wxPGValidationInfo& validationInfo ) const;

View File

@ -822,6 +822,16 @@ bool wxFloatProperty::DoSetAttribute( const wxString& name, wxVariant& value )
return false;
}
wxVariant wxFloatProperty::DoGetAttribute( const wxString& name ) const
{
wxVariant value;
if ( name == wxPG_FLOAT_PRECISION )
{
value = (long)m_precision;
}
return value;
}
wxValidator*
wxFloatProperty::GetClassValidator()
{