Remove creation on the fly of a wxPaintEvent instance (final step).

This is not allowed in 3.1.4 wxWidgets.
This commit is contained in:
jean-pierre charras 2020-07-15 12:58:43 +02:00
parent 1dc804232c
commit 6366aa3ede
4 changed files with 29 additions and 19 deletions

View File

@ -40,6 +40,8 @@
#include <pixman.h>
#include <id.h>
using namespace KIGFX;
@ -1303,6 +1305,17 @@ void CAIRO_GAL::endDrawing()
}
void CAIRO_GAL::PostPaint()
{
// posts an event to m_paint_listener to ask for redraw the canvas.
if( paintListener )
{
wxPaintEvent redrawReqEvent;
wxPostEvent( paintListener, redrawReqEvent );
}
}
void CAIRO_GAL::ResizeScreen( int aWidth, int aHeight )
{
CAIRO_GAL_BASE::ResizeScreen( aWidth, aHeight );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2012-2018 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012-2020 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013-2017 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -352,6 +352,17 @@ wxString OPENGL_GAL::CheckFeatures( GAL_DISPLAY_OPTIONS& aOptions )
}
void OPENGL_GAL::PostPaint()
{
// posts an event to m_paint_listener to ask for redraw the canvas.
if( paintListener )
{
wxPaintEvent redrawReqEvent;
wxPostEvent( paintListener, redrawReqEvent );
}
}
bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
{
bool refresh = false;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2012-2019 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 2012-2020 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2018 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -388,14 +388,7 @@ public:
* posts an event to m_paint_listener. A post is used so that the actual drawing
* function can use a device context type that is not specific to the wxEVT_PAINT event.
*/
void PostPaint()
{
if( paintListener )
{
wxPaintEvent redrawEvent;
wxPostEvent( paintListener, redrawEvent );
}
}
void PostPaint();
void SetMouseListener( wxEvtHandler* aMouseListener )
{

View File

@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 2020 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013-2017 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -252,14 +252,7 @@ public:
* posts an event to m_paint_listener. A post is used so that the actual drawing
* function can use a device context type that is not specific to the wxEVT_PAINT event.
*/
void PostPaint()
{
if( paintListener )
{
wxPaintEvent redrawEvent;
wxPostEvent( paintListener, redrawEvent );
}
}
void PostPaint();
void SetMouseListener( wxEvtHandler* aMouseListener )
{