Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solved errors and warning for building against wxWidgets 3.1.3 #47

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/wx/axis/numberaxis.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class WXDLLIMPEXP_FREECHART NumberAxis : public LabelAxis
}

wxDEPRECATED_MSG("Do not use this function, instead use SetMajorInterval.")
void SetLabelCount(size_t labelCount) {}
void SetLabelCount(size_t WXUNUSED(labelCount)) {}

/**
* Set whether to use integer values instead of doubles.
Expand Down
2 changes: 1 addition & 1 deletion include/wx/multiplot.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class WXDLLIMPEXP_FREECHART MultiPlot : public Plot, public PlotObserver

virtual void DrawData(ChartDC& cdc, wxRect rc);

virtual void DrawBackground(ChartDC& cdc, wxRect rc) {}; // Does nothing in a multi plot?
virtual void DrawBackground(ChartDC& WXUNUSED(cdc), wxRect WXUNUSED(rc)) {}; // Does nothing in a multi plot?

private:
PlotArray m_subPlots;
Expand Down
2 changes: 1 addition & 1 deletion include/wx/pie/pieplot.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class WXDLLIMPEXP_FREECHART PiePlot : public Plot, public DatasetObserver

virtual void DrawData(ChartDC& cdc, wxRect rc);

virtual void DrawBackground(ChartDC& cdc, wxRect rc) {}; // Does nothing in a pie plot?
virtual void DrawBackground(ChartDC& WXUNUSED(cdc), wxRect WXUNUSED(rc)) {}; // Does nothing in a pie plot?

private:

Expand Down
20 changes: 16 additions & 4 deletions sample/combinedaxisdemos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ class CombinedAxisDemo1 : public ChartDemo
XYSimpleDataset *dataset1 = new XYSimpleDataset();

// and add serie to it
dataset1->AddSerie((double *) data1, WXSIZEOF(data1));
wxVector<wxRealPoint> datapoints1;
for (size_t i = 0; i < WXSIZEOF(data1); i++)
datapoints1.push_back(wxRealPoint(data1[i][0], data1[i][1]));
dataset1->AddSerie(new XYSerie(datapoints1));

// set line renderer to dataset
dataset1->SetRenderer(new XYLineRenderer());
Expand Down Expand Up @@ -94,7 +97,10 @@ class CombinedAxisDemo1 : public ChartDemo
XYSimpleDataset *dataset2 = new XYSimpleDataset();

// and add serie to it
dataset2->AddSerie((double *) data2, WXSIZEOF(data2));
wxVector<wxRealPoint> datapoints2;
for (size_t i = 0; i < WXSIZEOF(data2); i++)
datapoints2.push_back(wxRealPoint(data2[i][0], data2[i][1]));
dataset2->AddSerie(new XYSerie(datapoints2));

// set line renderer to dataset
dataset2->SetRenderer(new XYLineRenderer());
Expand Down Expand Up @@ -170,7 +176,10 @@ class CombinedAxisDemo2 : public ChartDemo
XYSimpleDataset *dataset1 = new XYSimpleDataset();

// and add serie to it
dataset1->AddSerie((double *) data1, WXSIZEOF(data1));
wxVector<wxRealPoint> datapoints1;
for (size_t i = 0; i < WXSIZEOF(data1); i++)
datapoints1.push_back(wxRealPoint(data1[i][0], data1[i][1]));
dataset1->AddSerie(new XYSerie(datapoints1));

// set line renderer to dataset
dataset1->SetRenderer(new XYLineRenderer());
Expand Down Expand Up @@ -202,7 +211,10 @@ class CombinedAxisDemo2 : public ChartDemo
XYSimpleDataset *dataset2 = new XYSimpleDataset();

// and add serie to it
dataset2->AddSerie((double *) data2, WXSIZEOF(data2));
wxVector<wxRealPoint> datapoints2;
for (size_t i = 0; i < WXSIZEOF(data2); i++)
datapoints2.push_back(wxRealPoint(data2[i][0], data2[i][1]));
dataset2->AddSerie(new XYSerie(datapoints2));

// set histogram renderer to dataset
XYHistoRenderer *renderer2 = new XYHistoRenderer();
Expand Down
10 changes: 8 additions & 2 deletions sample/markersdemos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ class MarkersDemo1 : public ChartDemo
XYSimpleDataset *dataset = new XYSimpleDataset();

// and add serie to it
dataset->AddSerie((double *) data, WXSIZEOF(data));
wxVector<wxRealPoint> datapoints;
for (size_t i = 0; i < WXSIZEOF(data); i++)
datapoints.push_back(wxRealPoint(data[i][0], data[i][1]));
dataset->AddSerie(new XYSerie(datapoints));

// set line renderer to dataset
dataset->SetRenderer(new XYLineRenderer());
Expand Down Expand Up @@ -97,7 +100,10 @@ class MarkersDemo2 : public ChartDemo
XYSimpleDataset *dataset = new XYSimpleDataset();

// and add serie to it
dataset->AddSerie((double *) data, WXSIZEOF(data));
wxVector<wxRealPoint> datapoints;
for (size_t i = 0; i < WXSIZEOF(data); i++)
datapoints.push_back(wxRealPoint(data[i][0], data[i][1]));
dataset->AddSerie(new XYSerie(datapoints));

// set line renderer to dataset
dataset->SetRenderer(new XYLineRenderer());
Expand Down
20 changes: 16 additions & 4 deletions sample/multipleaxisdemos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,18 @@ class MultipleAxisDemo1 : public ChartDemo
// create first dataset
XYSimpleDataset *dataset1 = new XYSimpleDataset();
// add serie to it
dataset1->AddSerie((double *) values1, WXSIZEOF(values1));
wxVector<wxRealPoint> datapoints1;
for (size_t i = 0; i < WXSIZEOF(values1); i++)
datapoints1.push_back(wxRealPoint(values1[i][0], values1[i][1]));
dataset1->AddSerie(new XYSerie(datapoints1));

// create second dataset
XYSimpleDataset *dataset2 = new XYSimpleDataset();
// add serie to it
dataset2->AddSerie((double *) values2, WXSIZEOF(values2));
wxVector<wxRealPoint> datapoints2;
for (size_t i = 0; i < WXSIZEOF(values2); i++)
datapoints2.push_back(wxRealPoint(values2[i][0], values2[i][1]));
dataset2->AddSerie(new XYSerie(datapoints2));

// create renderer for first dataset
XYLineRenderer *renderer1 = new XYLineRenderer();
Expand Down Expand Up @@ -167,12 +173,18 @@ class MultipleAxisDemo2 : public ChartDemo
// create first dataset
XYSimpleDataset *dataset1 = new XYSimpleDataset();
// add serie to it
dataset1->AddSerie((double *) values1, WXSIZEOF(values1));
wxVector<wxRealPoint> datapoints1;
for (size_t i = 0; i < WXSIZEOF(values1); i++)
datapoints1.push_back(wxRealPoint(values1[i][0], values1[i][1]));
dataset1->AddSerie(new XYSerie(datapoints1));

// create second dataset
XYSimpleDataset *dataset2 = new XYSimpleDataset();
// add serie to it
dataset2->AddSerie((double *) values2, WXSIZEOF(values2));
wxVector<wxRealPoint> datapoints2;
for (size_t i = 0; i < WXSIZEOF(values2); i++)
datapoints2.push_back(wxRealPoint(values2[i][0], values2[i][1]));
dataset2->AddSerie(new XYSerie(datapoints2));

// create renderer for first dataset
XYLineRenderer *renderer1 = new XYLineRenderer();
Expand Down
20 changes: 10 additions & 10 deletions sample/xydemos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ class XYDemo2 : public ChartDemo
plot->LinkDataHorizontalAxis(0, 0);

// set serie names to be displayed on legend
dataset->SetSerieName(0, wxT("Serie 0"));
dataset->SetSerieName(1, wxT("Serie 1"));
dataset->GetSerie(0)->SetName(wxT("Serie 0"));
dataset->GetSerie(1)->SetName(wxT("Serie 1"));

// set legend
plot->SetLegend(new Legend(wxCENTER, wxRIGHT));
Expand Down Expand Up @@ -195,8 +195,8 @@ class XYDemo3 : public ChartDemo
plot->LinkDataHorizontalAxis(0, 0);

// set serie names to be displayed on legend
dataset->SetSerieName(0, wxT("First"));
dataset->SetSerieName(1, wxT("Second"));
dataset->GetSerie(0)->SetName(wxT("First"));
dataset->GetSerie(1)->SetName(wxT("Second"));

// set legend to plot
plot->SetLegend(new Legend(wxCENTER, wxRIGHT));
Expand Down Expand Up @@ -300,7 +300,7 @@ class DynamicUpdater : public wxEvtHandler
NumberAxis* m_axis;
wxTimer m_timer;

void OnTimer(wxTimerEvent &ev)
void OnTimer(wxTimerEvent &WXUNUSED(ev))
{
double first_x = m_dataset->GetSerie(0)->GetX(0);

Expand Down Expand Up @@ -725,9 +725,9 @@ class XYDemo10 : public ChartDemo
plot->LinkDataHorizontalAxis(0, 0);

// set serie names to be displayed on legend
dataset->SetSerieName(0, wxT("First"));
dataset->SetSerieName(1, wxT("Second"));
dataset->SetSerieName(2, wxT("Third"));
dataset->GetSerie(0)->SetName(wxT("First"));
dataset->GetSerie(1)->SetName(wxT("Second"));
dataset->GetSerie(2)->SetName(wxT("Third"));

// set legend
plot->SetLegend(new Legend(wxBOTTOM, wxCENTER));
Expand Down Expand Up @@ -805,8 +805,8 @@ class XYDemo11 : public ChartDemo
plot->LinkDataHorizontalAxis(0, 0);

// set serie names to be displayed on legend
dataset->SetSerieName(0, wxT("Serie 0"));
dataset->SetSerieName(1, wxT("Serie 1"));
dataset->GetSerie(0)->SetName(wxT("Serie 0"));
dataset->GetSerie(1)->SetName(wxT("Serie 1"));

// set legend
plot->SetLegend(new Legend(wxCENTER, wxRIGHT));
Expand Down
8 changes: 4 additions & 4 deletions src/axisplot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ bool AxisPlot::HasData()
return m_datasets.Count() != 0;
}

void AxisPlot::ChartPanelChanged(wxChartPanel *oldPanel, wxChartPanel *newPanel)
void AxisPlot::ChartPanelChanged(wxChartPanel *WXUNUSED(oldPanel), wxChartPanel *WXUNUSED(newPanel))
{
m_redrawDataArea = true;
FirePlotNeedRedraw();
Expand Down Expand Up @@ -184,7 +184,7 @@ void AxisPlot::SetLegend(Legend *legend)
FirePlotNeedRedraw();
}

void AxisPlot::SetCrosshair(Crosshair *crosshair)
void AxisPlot::SetCrosshair(Crosshair *WXUNUSED(crosshair))
{
/*// TODO
if (m_crosshair != NULL && GetChartPanel() != NULL) {
Expand Down Expand Up @@ -553,7 +553,7 @@ void AxisPlot::ChartEnterWindow()
}
*/

void AxisPlot::ChartMouseDown(wxPoint &pt, int key)
void AxisPlot::ChartMouseDown(wxPoint& WXUNUSED(pt), int WXUNUSED(key))
{

}
Expand All @@ -574,4 +574,4 @@ void AxisPlot::ChartMouseDrag(wxPoint &pt)
void AxisPlot::ChartMouseWheel(int rotation)
{
}
*/
*/
2 changes: 1 addition & 1 deletion src/chart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void Chart::SetChartPanel(wxChartPanel *chartPanel)
// return rc;
//}

void Chart::Draw(ChartDC &cdc, wxRect &rc, bool antialias)
void Chart::Draw(ChartDC &cdc, wxRect &rc, bool WXUNUSED(antialias))
{
// draw chart background
m_background->Draw(cdc.GetDC(), rc);
Expand Down
12 changes: 6 additions & 6 deletions src/chartpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,23 @@ void ChartPanelObserver::ChartEnterWindow()
{
}

void ChartPanelObserver::ChartMouseDown(wxPoint &pt, int key)
void ChartPanelObserver::ChartMouseDown(wxPoint &WXUNUSED(pt), int WXUNUSED(key))
{
}

void ChartPanelObserver::ChartMouseUp(wxPoint &pt, int key)
void ChartPanelObserver::ChartMouseUp(wxPoint &WXUNUSED(pt), int WXUNUSED(key))
{
}

void ChartPanelObserver::ChartMouseMove(wxPoint &pt)
void ChartPanelObserver::ChartMouseMove(wxPoint &WXUNUSED(pt))
{
}

void ChartPanelObserver::ChartMouseDrag(wxPoint &pt)
void ChartPanelObserver::ChartMouseDrag(wxPoint &WXUNUSED(pt))
{
}

void ChartPanelObserver::ChartMouseWheel(int rotation)
void ChartPanelObserver::ChartMouseWheel(int WXUNUSED(rotation))
{
}

Expand Down Expand Up @@ -264,7 +264,7 @@ void wxChartPanel::OnScrollWin(wxScrollWinEvent &ev)
ev.Skip();
}

void wxChartPanel::OnMouseEvents(wxMouseEvent &ev)
void wxChartPanel::OnMouseEvents(wxMouseEvent &WXUNUSED(ev))
{
if (m_mode == NULL) {
return ;
Expand Down
4 changes: 2 additions & 2 deletions src/chartsplitpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ void wxChartSplitPanel::AddPlot(Plot *plot, int pos, bool allowRemove)
m_auiManager->Update();
}

void wxChartSplitPanel::RemovePlot(Plot *plot)
void wxChartSplitPanel::RemovePlot(Plot *WXUNUSED(plot))
{
// TODO
}

void wxChartSplitPanel::RemovePlot(size_t nPlot)
void wxChartSplitPanel::RemovePlot(size_t WXUNUSED(nPlot))
{
// TODO
}
Expand Down
10 changes: 5 additions & 5 deletions src/crosshair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "wx/crosshair.h"

Crosshair::Crosshair(int style, wxPen *pen)
Crosshair::Crosshair(int WXUNUSED(style), wxPen *WXUNUSED(pen))
{

}
Expand All @@ -19,7 +19,7 @@ Crosshair::~Crosshair()

}

void Crosshair::Draw(wxDC &dc, wxRect rcData)//, wxCoord x, wxCoord y)
void Crosshair::Draw(wxDC& WXUNUSED(dc), wxRect WXUNUSED(rcData))//, wxCoord x, wxCoord y)
{
// TODO
/*
Expand All @@ -30,14 +30,14 @@ void Crosshair::Draw(wxDC &dc, wxRect rcData)//, wxCoord x, wxCoord y)
*/
}

void Crosshair::ChartMouseDown(wxPoint &pt, int key)
void Crosshair::ChartMouseDown(wxPoint& WXUNUSED(pt), int WXUNUSED(key))
{
}

void Crosshair::ChartMouseUp(wxPoint &pt, int key)
void Crosshair::ChartMouseUp(wxPoint& WXUNUSED(pt), int WXUNUSED(key))
{
}

void Crosshair::ChartMouseMove(wxPoint &pt)
void Crosshair::ChartMouseMove(wxPoint& WXUNUSED(pt))
{
}
9 changes: 7 additions & 2 deletions src/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,13 @@ void DatasetArray::Add(Dataset *dataset)

void DatasetArray::Remove(Dataset *dataset)
{
SAFE_UNREF(dataset);
DatasetArrayBase::Remove(dataset);
for (size_t n = 0; n < Count(); n++) {
if (dataset == Item(n)) {
SAFE_UNREF(dataset);
DatasetArrayBase::RemoveAt(n);
break;
}
}
}

void DatasetArray::RemoveAt(size_t index, size_t count)
Expand Down
2 changes: 1 addition & 1 deletion src/xy/xydynamicdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void XYDynamicSerie::AddXY(const wxRealPoint& xy)

void XYDynamicSerie::AddXY(const wxRealPointArray& data)
{
WX_APPEND_ARRAY(m_data, data)
WX_APPEND_ARRAY(m_data, data);

if (m_dataset != NULL) {
m_dataset->DatasetChanged();
Expand Down
6 changes: 5 additions & 1 deletion src/xy/xysimpledataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ XYSimpleDataset::~XYSimpleDataset()

void XYSimpleDataset::AddSerie(double *data, size_t count)
{
AddSerie(new XYSerie(data, count));
wxVector<wxRealPoint> newdata;
for (size_t i = 0; i < count; i++)
newdata.push_back(wxRealPoint(data[i * 2], data[(i * 2) + 1]));

AddSerie(new XYSerie(newdata));
}

void XYSimpleDataset::AddSerie(XYSerie *serie)
Expand Down