From b06b950574fbc58a5f20e3e1fe605b0f72abb26e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 18 Apr 2022 22:16:23 +0200 Subject: [PATCH] Document changes in wxImageFileProperty Remove references to the non-public member variables from documentation. --- docs/changes.txt | 7 +++++++ include/wx/propgrid/advprops.h | 4 +++- interface/wx/propgrid/advprops.h | 4 ---- src/propgrid/advprops.cpp | 11 ++++++++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 43e2df6b19..cbc267d63b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -234,6 +234,13 @@ Changes in behaviour which may result in build errors 3.1.7: (released 2022-??-??) ---------------------------- +INCOMPATIBLE CHANGES SINCE 3.1.6: + +- wxImageFileProperty::m_pImage and m_pBitmap member variables were removed. + They were not intended for the public API. m_image variable represents + cached image now. + + NOTE: This file is updated only before the release, please use $ git log --notes=changelog --format='%N' v3.1.6..|grep . diff --git a/include/wx/propgrid/advprops.h b/include/wx/propgrid/advprops.h index b356b6bd7b..b1fadd4641 100644 --- a/include/wx/propgrid/advprops.h +++ b/include/wx/propgrid/advprops.h @@ -296,12 +296,14 @@ public: const wxRect& rect, wxPGPaintData& paintdata ) wxOVERRIDE; protected: - wxBitmap m_bitmap; // final thumbnail area + void SetImage(const wxImage& img); wxImage m_image; // original thumbnail area private: // Initialize m_image using the current file name. void LoadImageFromFile(); + + wxBitmap m_bitmap; // final thumbnail area }; #endif diff --git a/interface/wx/propgrid/advprops.h b/interface/wx/propgrid/advprops.h index 8868776b0b..7f29efa76a 100644 --- a/interface/wx/propgrid/advprops.h +++ b/interface/wx/propgrid/advprops.h @@ -248,10 +248,6 @@ public: virtual wxSize OnMeasureImage( int item ) const; virtual void OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata ); - -protected: - wxBitmap m_bitmap; // final thumbnail area - wxImage m_image; // original thumbnail area }; diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index c8cfcfd91e..0eeec08de8 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -1850,17 +1850,22 @@ void wxImageFileProperty::OnSetValue() wxFileProperty::OnSetValue(); // Delete old image - m_image = wxNullImage; - m_bitmap = wxNullBitmap; + SetImage(wxNullImage); LoadImageFromFile(); } +void wxImageFileProperty::SetImage(const wxImage& img) +{ + m_image = img; + m_bitmap = wxNullBitmap; +} + void wxImageFileProperty::LoadImageFromFile() { wxFileName filename = GetFileName(); - // Create the image thumbnail + // Cache the image if ( filename.FileExists() ) { m_image.LoadFile(filename.GetFullPath());