Replace wxScopedPtr with std::unique_ptr in the samples too

No real changes, just use the standard class instead of the wx one.
This commit is contained in:
Vadim Zeitlin 2023-03-06 23:37:53 +01:00
parent 363f0988cf
commit abb9859b89
7 changed files with 26 additions and 19 deletions

View file

@ -24,7 +24,6 @@
#include "wx/mstream.h"
#include "wx/wfstream.h"
#include "wx/quantize.h"
#include "wx/scopedptr.h"
#include "wx/stopwatch.h"
#include "wx/versioninfo.h"
#include "wx/artprov.h"
@ -48,6 +47,8 @@
#include "canvas.h"
#include <memory>
#ifndef wxHAS_IMAGES_IN_RESOURCES
#include "../sample.xpm"
#endif
@ -1270,7 +1271,7 @@ private:
// Use wxGraphicsContext if available for alpha support.
#if wxUSE_GRAPHICS_CONTEXT
wxScopedPtr<wxGraphicsContext> const
std::unique_ptr<wxGraphicsContext> const
gc(wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc));
gc->DrawBitmap(m_bitmap, 0, 0, sizeWin.x, sizeWin.y);
@ -1409,7 +1410,7 @@ private:
void OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(this);
wxScopedPtr<wxGraphicsContext> gc(wxGraphicsContext::Create(dc));
std::unique_ptr<wxGraphicsContext> gc(wxGraphicsContext::Create(dc));
wxGraphicsBitmap gb(gc->CreateBitmapFromImage(m_image));
gc->SetFont(*wxNORMAL_FONT, *wxBLACK);