diff --git a/include/wx/propgrid/advprops.h b/include/wx/propgrid/advprops.h index 16bda4ed91..16930c4bb9 100644 --- a/include/wx/propgrid/advprops.h +++ b/include/wx/propgrid/advprops.h @@ -329,6 +329,10 @@ public: protected: wxBitmap* m_pBitmap; // final thumbnail area wxImage* m_pImage; // intermediate thumbnail area + +private: + // Initialize m_pImage using the current file name. + void LoadImageFromFile(); }; #endif diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 2d7ab44cf4..4e1592ac4d 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -1827,6 +1827,8 @@ wxImageFileProperty::wxImageFileProperty( const wxString& label, const wxString& m_pImage = NULL; m_pBitmap = NULL; + + LoadImageFromFile(); } wxImageFileProperty::~wxImageFileProperty() @@ -1845,6 +1847,11 @@ void wxImageFileProperty::OnSetValue() wxDELETE(m_pImage); wxDELETE(m_pBitmap); + LoadImageFromFile(); +} + +void wxImageFileProperty::LoadImageFromFile() +{ wxFileName filename = GetFileName(); // Create the image thumbnail