Remove creation on the fly of a wxPaintEvent instance (fix previous commit).

This commit is contained in:
jean-pierre charras 2020-07-15 14:00:58 +02:00
parent 19d0899a80
commit 9f20c61fa7
4 changed files with 14 additions and 16 deletions

View File

@ -40,8 +40,6 @@
#include <pixman.h>
#include <id.h>
using namespace KIGFX;
@ -1305,13 +1303,12 @@ void CAIRO_GAL::endDrawing()
}
void CAIRO_GAL::PostPaint()
void CAIRO_GAL::PostPaint( wxPaintEvent& aEvent )
{
// posts an event to m_paint_listener to ask for redraw the canvas.
if( paintListener )
{
wxPaintEvent redrawReqEvent;
wxPostEvent( paintListener, redrawReqEvent );
wxPostEvent( paintListener, aEvent );
}
}
@ -1488,9 +1485,9 @@ void CAIRO_GAL::setCompositor()
}
void CAIRO_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
void CAIRO_GAL::onPaint( wxPaintEvent& aEvent )
{
PostPaint();
PostPaint( aEvent );
}

View File

@ -352,13 +352,12 @@ wxString OPENGL_GAL::CheckFeatures( GAL_DISPLAY_OPTIONS& aOptions )
}
void OPENGL_GAL::PostPaint()
void OPENGL_GAL::PostPaint( wxPaintEvent& aEvent )
{
// posts an event to m_paint_listener to ask for redraw the canvas.
if( paintListener )
{
wxPaintEvent redrawReqEvent;
wxPostEvent( paintListener, redrawReqEvent );
wxPostEvent( paintListener, aEvent );
}
}
@ -1954,9 +1953,9 @@ std::pair<VECTOR2D, float> OPENGL_GAL::computeBitmapTextSize( const UTF8& aText
}
void OPENGL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
void OPENGL_GAL::onPaint( wxPaintEvent& aEvent )
{
PostPaint();
PostPaint( aEvent );
}

View File

@ -386,9 +386,10 @@ public:
/**
* Function PostPaint
* 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.
* function can use a device context type that is not specific to the wxEVT_PAINT event,
* just by changing the PostPaint code.
*/
void PostPaint();
void PostPaint( wxPaintEvent& aEvent );
void SetMouseListener( wxEvtHandler* aMouseListener )
{

View File

@ -250,9 +250,10 @@ public:
/**
* @brief Function PostPaint
* 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.
* function can use a device context type that is not specific to the wxEVT_PAINT event,
* just by changing the PostPaint code.
*/
void PostPaint();
void PostPaint( wxPaintEvent& aEvent );
void SetMouseListener( wxEvtHandler* aMouseListener )
{