From 8d601fed17cd833cd35982515abcef5972ca9c08 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 16 Jul 2014 20:10:06 +0000 Subject: [PATCH] Use the same macro to implement all wxPG property classes. Currently, WX_PG_IMPLEMENT_PROPERTY_CLASS macro is used to implement most of the property classes (and also property classes in the propgrid sample) but few property classes are implemented in alternative way, using separate IMPLEMENT_DYNAMIC_CLASS and WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN macros. These two macros can be replaced with WX_PG_IMPLEMENT_PROPERTY_CLASS macro (which is a concatenation of both) so property class implementation can be unified. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/property.cpp | 9 ++++----- src/propgrid/props.cpp | 15 ++++++--------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 419d5fd0fb..21da745cdb 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -2716,9 +2716,8 @@ void wxPGProperty::SubPropsChanged( int oldSelInd ) // wxPGRootProperty // ----------------------------------------------------------------------- -WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxPGRootProperty,none,TextCtrl) -IMPLEMENT_DYNAMIC_CLASS(wxPGRootProperty, wxPGProperty) - +WX_PG_IMPLEMENT_PROPERTY_CLASS(wxPGRootProperty, wxPGProperty, + none, none, TextCtrl) wxPGRootProperty::wxPGRootProperty( const wxString& name ) : wxPGProperty() @@ -2739,8 +2738,8 @@ wxPGRootProperty::~wxPGRootProperty() // wxPropertyCategory // ----------------------------------------------------------------------- -WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxPropertyCategory,none,TextCtrl) -IMPLEMENT_DYNAMIC_CLASS(wxPropertyCategory, wxPGProperty) +WX_PG_IMPLEMENT_PROPERTY_CLASS(wxPropertyCategory, wxPGProperty, + none, none, TextCtrl) void wxPropertyCategory::Init() { diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index fef32b9bc3..422e1f84ca 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -1096,9 +1096,8 @@ bool wxBoolProperty::DoSetAttribute( const wxString& name, wxVariant& value ) // wxEnumProperty // ----------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxEnumProperty, wxPGProperty) - -WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEnumProperty,long,Choice) +WX_PG_IMPLEMENT_PROPERTY_CLASS(wxEnumProperty, wxPGProperty, + long, const long*, Choice) wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels, const long* values, int value ) : wxPGProperty(label,name) @@ -1370,9 +1369,8 @@ int wxEnumProperty::GetIndex() const // wxEditEnumProperty // ----------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxEditEnumProperty, wxPGProperty) - -WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEditEnumProperty,wxString,ComboBox) +WX_PG_IMPLEMENT_PROPERTY_CLASS(wxEditEnumProperty, wxPGProperty, + wxString, const wxString&, ComboBox) wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels, const long* values, const wxString& value ) @@ -1410,9 +1408,8 @@ wxEditEnumProperty::~wxEditEnumProperty() // wxFlagsProperty // ----------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxFlagsProperty,wxPGProperty) - -WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxFlagsProperty,long,TextCtrl) +WX_PG_IMPLEMENT_PROPERTY_CLASS(wxFlagsProperty, wxPGProperty, + long, long, TextCtrl) void wxFlagsProperty::Init() {