]> git.saurik.com Git - wxWidgets.git/commitdiff
Initialize wxImageFileProperty correctly when file is given in the ctor.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 29 Aug 2013 20:44:58 +0000 (20:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 29 Aug 2013 20:44:58 +0000 (20:44 +0000)
Previously the file had to be specified later and the value passed to the ctor
was ignored.

Closes #15456.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74729 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/advprops.h
src/propgrid/advprops.cpp

index 16bda4ed9120ce21eb5adf8e7c2ca802914b7903..16930c4bb907c68efe7c245eafc131b41746e0d2 100644 (file)
@@ -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
index 2d7ab44cf469462a90d95a46f0977969a3482b17..4e1592ac4dc5d233199b3e3f78bb8050fc264af4 100644 (file)
@@ -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