← Back to team overview

kicad-developers team mailing list archive

[Patch] Fix wxWidget compatibility issues

 

wxWidgets have renamed a variable in the wxGrid implementation for their
3.1.3 release, so out implementation needs to have a compatibility check
for this now. This patch does that, and also removes an unneeded
check/define.

-Ian
From cd1e81d005618a841a132a82764835e7e48d76c4 Mon Sep 17 00:00:00 2001
From: Ian McInerney <Ian.S.McInerney@xxxxxxxx>
Date: Thu, 29 Aug 2019 12:04:18 +0200
Subject: [PATCH 01/10] wxWidgets compatibility fixes

* Remove unneeded check
* Fix WX_GRID since upstream renamed a variable in 3.1.3
---
 common/widgets/wx_grid.cpp    |  5 +++++
 include/gal/cairo/cairo_gal.h | 10 ----------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/common/widgets/wx_grid.cpp b/common/widgets/wx_grid.cpp
index 8f3549209..2f87611ad 100644
--- a/common/widgets/wx_grid.cpp
+++ b/common/widgets/wx_grid.cpp
@@ -148,7 +148,12 @@ void WX_GRID::DrawColLabel( wxDC& dc, int col )
 
     // It is reported that we need to erase the background to avoid display
     // artefacts, see #12055.
+    // wxWidgets renamed this variable between 3.1.2 and 3.1.3 ...
+#if wxCHECK_VERSION( 3, 1, 3 )
+    wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() );
+#else
     wxDCBrushChanger setBrush( dc, m_colWindow->GetBackgroundColour() );
+#endif
     dc.DrawRectangle(rect);
 
     rend.DrawBorder( *this, dc, rect );
diff --git a/include/gal/cairo/cairo_gal.h b/include/gal/cairo/cairo_gal.h
index ad28a2f10..71d1c2f44 100644
--- a/include/gal/cairo/cairo_gal.h
+++ b/include/gal/cairo/cairo_gal.h
@@ -39,16 +39,6 @@
 
 #include <memory>
 
-#if defined(__WXMSW__)
-#define SCREEN_DEPTH 24
-#else
-#if wxCHECK_VERSION( 2, 9, 0 )
-#define SCREEN_DEPTH    wxBITMAP_SCREEN_DEPTH
-#else
-#define SCREEN_DEPTH    32
-#endif
-#endif
-
 /**
  * @brief Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
  *
-- 
2.21.0


Follow ups