Version: 0.6.0
multiplot.h
1 // Name: multiplot.h
3 // Purpose:
4 // Author: Moskvichev Andrey V.
5 // Created: 2008/11/07
6 // Copyright: (c) 2008-2010 Moskvichev Andrey V.
7 // Licence: wxWidgets licence
9 
10 #ifndef MULTIPLOT_H_
11 #define MULTIPLOT_H_
12 
13 #include <wx/dynarray.h>
14 #include <wx/plot.h>
15 
16 WX_DECLARE_USER_EXPORTED_OBJARRAY(Plot *, PlotArray, WXDLLIMPEXP_FREECHART);
17 
22 class WXDLLIMPEXP_FREECHART MultiPlot : public Plot, public PlotObserver
23 {
24 public:
32  MultiPlot(int rows, int cols, wxCoord horizGap, wxCoord vertGap);
33  virtual ~MultiPlot();
34 
39  void AddPlot(Plot *subPlot)
40  {
41  m_subPlots.Add(subPlot);
42 
43  subPlot->AddObserver(this);
44  FirePlotNeedRedraw();
45  }
46 
47  //
48  // PlotObserver
49  //
50  virtual void PlotNeedRedraw(Plot *plot);
51 
52 protected:
53  virtual bool HasData();
54 
55  virtual void DrawData(wxDC &dc, wxRect rc);
56 
57 private:
58  PlotArray m_subPlots;
59 
60  int m_rows;
61  int m_cols;
62  wxCoord m_horizGap;
63  wxCoord m_vertGap;
64 };
65 
66 #endif /*MULTIPLOT_H_*/
virtual void DrawData(wxDC &dc, wxRect rc)=0
virtual void PlotNeedRedraw(Plot *_plot)=0
Definition: multiplot.h:22
virtual bool HasData()=0
void AddPlot(Plot *subPlot)
Definition: multiplot.h:39
Definition: plot.h:24
Definition: plot.h:42