From 8fa513e903ed899f2c8e29fb17dbdd04610c6f18 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 6 Feb 2020 12:43:32 +0100 Subject: [PATCH] Properties: fix Properties panel refresh --- common/widgets/properties_panel.cpp | 8 ++++++++ common/widgets/properties_panel.h | 1 + include/property.h | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/widgets/properties_panel.cpp b/common/widgets/properties_panel.cpp index bf3e6e0383..3eb1954406 100644 --- a/common/widgets/properties_panel.cpp +++ b/common/widgets/properties_panel.cpp @@ -43,6 +43,7 @@ PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame ) Connect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( PROPERTIES_PANEL::valueChanged ), NULL, this ); Connect( wxEVT_PG_CHANGING, wxPropertyGridEventHandler( PROPERTIES_PANEL::valueChanging ), NULL, this ); + Connect( wxEVT_SHOW, wxShowEventHandler( PROPERTIES_PANEL::onShow ), NULL, this ); } @@ -147,3 +148,10 @@ void PROPERTIES_PANEL::update( const SELECTION& aSelection ) m_grid->FitColumns(); } + + +void PROPERTIES_PANEL::onShow( wxShowEvent& aEvent ) +{ + if( aEvent.IsShown() ) + Update(); +} diff --git a/common/widgets/properties_panel.h b/common/widgets/properties_panel.h index 302684e35a..2d1758b335 100644 --- a/common/widgets/properties_panel.h +++ b/common/widgets/properties_panel.h @@ -66,6 +66,7 @@ protected: // Event handlers virtual void valueChanging( wxPropertyGridEvent& aEvent ) {} virtual void valueChanged( wxPropertyGridEvent& aEvent ) {} + void onShow( wxShowEvent& aEvent ); std::vector m_displayed; wxPropertyGrid* m_grid; diff --git a/include/property.h b/include/property.h index 8b744889f4..6227929db1 100644 --- a/include/property.h +++ b/include/property.h @@ -277,7 +277,7 @@ protected: } virtual void setter( void* aObject, wxAny& aValue ) = 0; - virtual wxAny getter( const void* aObject ) const = 0; + virtual wxAny getter( void* aObject ) const = 0; private: const wxString m_name;