00001
00002
00003
00004
00005
00006
00007
00009
00010 #ifndef MARKER_H_
00011 #define MARKER_H_
00012
00013 #include <wx/wxfreechartdefs.h>
00014 #include <wx/drawobject.h>
00015 #include <wx/areadraw.h>
00016
00017 #include <wx/dynarray.h>
00018
00019 class Axis;
00020
00024 class WXDLLIMPEXP_FREECHART Marker : public DrawObject
00025 {
00026 public:
00027 Marker();
00028 virtual ~Marker();
00029
00037 virtual void Draw(wxDC &dc, wxRect rcData, Axis *horizAxis, Axis *vertAxis) = 0;
00038 };
00039
00040 WX_DECLARE_USER_EXPORTED_OBJARRAY(Marker *, MarkerArray, WXDLLIMPEXP_FREECHART);
00041
00042 #if 0
00043
00046 class WXDLLIMPEXP_FREECHART PointMarker : public Marker
00047 {
00048 public:
00049 PointMarker();
00050 virtual ~PointMarker();
00051
00052 virtual void Draw(wxDC &dc, wxRect rcData, Axis *horizAxis, Axis *vertAxis);
00053
00054 void SetText(const wxString &text)
00055 {
00056 m_text = text;
00057 FireNeedRedraw();
00058 }
00059
00060 private:
00061 wxString m_text;
00062 wxFont m_textFont;
00063 wxColour m_textColour;
00064 };
00065 #endif
00066
00070 class WXDLLIMPEXP_FREECHART LineMarker : public Marker
00071 {
00072 public:
00073 LineMarker(wxPen linePen);
00074 virtual ~LineMarker();
00075
00076 virtual void Draw(wxDC &dc, wxRect rcData, Axis *horizAxis, Axis *vertAxis);
00077
00082 void SetVerticalLine(double value);
00083
00088 void SetHorizontalLine(double value);
00089
00095 void SetValue(double value, bool horizontal);
00096
00097 private:
00098 wxPen m_linePen;
00099
00100 double m_value;
00101 bool m_horizontal;
00102 };
00103
00108 class WXDLLIMPEXP_FREECHART RangeMarker : public Marker
00109 {
00110 public:
00111 RangeMarker(AreaDraw *rangeAreaDraw);
00112 virtual ~RangeMarker();
00113
00114 virtual void Draw(wxDC &dc, wxRect rcData, Axis *horizAxis, Axis *vertAxis);
00115
00121 void SetVerticalRange(double minValue, double maxValue);
00122
00128 void SetHorizontalRange(double minValue, double maxValue);
00129
00136 void SetRange(double minValue, double maxValue, bool horizontal);
00137
00142 void SetRangeAreaDraw(AreaDraw *rangeAreaDraw);
00143
00144 private:
00145 double m_minValue;
00146 double m_maxValue;
00147 bool m_horizontal;
00148
00149 AreaDraw *m_rangeAreaDraw;
00150 };
00151
00152 #endif