Similar plot code for both versions....
Based upon SVN r1245.
From: "A. Maitland Bottoms" <aa...@amrad.org>
Date: Tue, 21 May 2013 20:42:41 -0400
Subject: [PATCH] plot 2.8 variation
Description: allow plots to build with wx-2.8
diff --git a/src/fdmdv2_plot.cpp b/src/fdmdv2_plot.cpp
index 2a22b8f..5b43812 100644
--- a/src/fdmdv2_plot.cpp
+++ b/src/fdmdv2_plot.cpp
@@ -56,10 +56,19 @@ PlotPanel::PlotPanel(wxFrame* parent) : wxPanel(parent)
m_use_bitmap = true;
m_rubberBand = false;
m_mouseDown = false;
+#ifdef wxPENSTYLE_SHORT_DASH
+ // wxWidgets 2.9 and above style
m_penShortDash = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1,
wxPENSTYLE_SHORT_DASH);
m_penDotDash = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1,
wxPENSTYLE_DOT_DASH);
m_penSolid = wxPen(wxColor(0x00, 0x00, 0x00), 1,
wxPENSTYLE_SOLID);
SetBackgroundStyle(wxBG_STYLE_PAINT);
+#else
+ // wxWidgets 2.8 style
+ m_penShortDash = wxPen(wxColor(0xA0, 0xA0, 0xA0), 1, wxSHORT_DASH);
+ m_penDotDash = wxPen(wxColor(0xD0, 0xD0, 0xD0), 1, wxDOT_DASH);
+ m_penSolid = wxPen(wxColor(0x00, 0x00, 0x00), 1, wxSOLID);
+ SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+#endif
SetLabelSize(10.0);
}
@@ -123,7 +132,11 @@ void PlotPanel::OnSize(wxSizeEvent& event)
{
m_oImage.Rescale(m_rCtrl.GetWidth(), m_rCtrl.GetHeight());
}
+#ifdef wxBITMAP_SCREEN_DEPTH
m_pBmp = new wxBitmap(m_oImage, wxBITMAP_SCREEN_DEPTH);
+#else
+ m_pBmp = new wxBitmap(m_oImage); // Use default screen depth
+#endif
m_firstPass = true;
}
this->Refresh();
diff --git a/src/fdmdv2_plot_scalar.cpp b/src/fdmdv2_plot_scalar.cpp
index 4f6b34d..6d1103a 100644
--- a/src/fdmdv2_plot_scalar.cpp
+++ b/src/fdmdv2_plot_scalar.cpp
@@ -203,7 +203,13 @@ void PlotScalar::drawGraticule(wxAutoBufferedPaintDC& dc)
float a_to_py;
wxBrush ltGraphBkgBrush;
+#ifdef wxBRUSHSTYLE_TRANSPARENT
+ // wxWidgets 2.9 and above style
ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+#else
+ // wxWidgets 2.8 style
+ ltGraphBkgBrush.SetStyle(wxTRANSPARENT);
+#endif
ltGraphBkgBrush.SetColour(*wxBLACK);
dc.SetBrush(ltGraphBkgBrush);
dc.SetPen(wxPen(BLACK_COLOR, 1));
diff --git a/src/fdmdv2_plot_spectrum.cpp b/src/fdmdv2_plot_spectrum.cpp
index 6558582..f0b3b3c 100644
--- a/src/fdmdv2_plot_spectrum.cpp
+++ b/src/fdmdv2_plot_spectrum.cpp
@@ -49,7 +49,11 @@ PlotSpectrum::PlotSpectrum(wxFrame* parent, float *magdB,
int n_magdB,
float min_mag_db, float max_mag_db, bool
clickTune): PlotPanel(parent)
{
m_greyscale = 0;
+#ifdef FUTURE_WXWIN_COMPATIBILITY_3_0
m_Bufsz = GetMaxClientSize();
+#else
+ m_Bufsz = wxDefaultSize;
+#endif
m_newdata = false;
m_firstPass = true;
m_line_color = 0;
@@ -169,7 +173,13 @@ void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&
dc)
float f, mag, freq_hz_to_px, mag_dB_to_py;
wxBrush ltGraphBkgBrush;
+#ifdef wxBRUSHSTYLE_TRANSPARENT
+ // wxWidgets 2.9 and above style
ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+#else
+ // wxWidgets 2.8 style
+ ltGraphBkgBrush.SetStyle(wxTRANSPARENT);
+#endif
ltGraphBkgBrush.SetColour(*wxBLACK);
dc.SetBrush(ltGraphBkgBrush);
dc.SetPen(wxPen(BLACK_COLOR, 1));
diff --git a/src/fdmdv2_plot_waterfall_linux.cpp
b/src/fdmdv2_plot_waterfall_linux.cpp
index 5ea1aee..8bb50ad 100644
--- a/src/fdmdv2_plot_waterfall_linux.cpp
+++ b/src/fdmdv2_plot_waterfall_linux.cpp
@@ -55,7 +55,11 @@ PlotWaterfall::PlotWaterfall(wxFrame* parent, bool
graticule, int colour): PlotP
}
m_graticule = graticule;
m_colour = colour;
+#ifdef FUTURE_WXWIN_COMPATIBILITY_3_0
m_Bufsz = GetMaxClientSize();
+#else
+ m_Bufsz = wxDefaultSize;
+#endif
m_newdata = false;
m_firstPass = true;
m_line_color = 0;
@@ -234,7 +238,13 @@ void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC&
dc)
float f, time, freq_hz_to_px, time_s_to_py;
wxBrush ltGraphBkgBrush;
+#ifdef wxBRUSHSTYLE_TRANSPARENT
+ // wxWidgets 2.9 and above style
ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
+#else
+ // wxWidgets 2.8 style
+ ltGraphBkgBrush.SetStyle(wxTRANSPARENT);
+#endif
ltGraphBkgBrush.SetColour(*wxBLACK);
dc.SetBrush(ltGraphBkgBrush);
dc.SetPen(wxPen(BLACK_COLOR, 1));
--
1.7.10.4
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Freetel-codec2 mailing list
Freetel-codec2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freetel-codec2