From d183babc8d4f3510194a05069fba7de598b577c8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 22 Feb 2014 14:54:44 +0000 Subject: [PATCH] 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 --- include/wx/propgrid/props.h | 2 ++ src/propgrid/props.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index ea902d13e6..7023974fcd 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -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; diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 2b4d2ce11a..66eb47d2a9 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -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() {