From 3a4ad03492a2c86fd9696cfb1a75a5185aee12e0 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 10 Apr 2013 10:09:23 +0200 Subject: [PATCH] Fix for compatibility with wxWidgets 2.8 & 2.9 at the same time. --- common/drawpanel_gal.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/drawpanel_gal.cpp b/common/drawpanel_gal.cpp index 6a09411c7d..bc8c5224b4 100644 --- a/common/drawpanel_gal.cpp +++ b/common/drawpanel_gal.cpp @@ -101,10 +101,13 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin m_painter = new KiGfx::PCB_PAINTER( m_gal ); m_view->SetPainter( m_painter ); +#if wxCHECK_VERSION( 2, 9, 0 ) + Connect( KiGfx::EVT_GAL_REDRAW, wxEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this ); +#elif wxCHECK_VERSION( 2, 8, 0 ) // FIXME Cairo needs this to be uncommented to remove blinking on refreshing - // Connect( wxEVT_PAINT, wxEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this ); - Connect(KiGfx::EVT_GAL_REDRAW, wxEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this ); - Connect(wxEVT_SIZE, wxSizeEventHandler( EDA_DRAW_PANEL_GAL::onSize ), NULL, this ); + Connect( wxEVT_PAINT, wxEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this ); +#endif + Connect( wxEVT_SIZE, wxSizeEventHandler( EDA_DRAW_PANEL_GAL::onSize ), NULL, this ); }