class WXDLLEXPORT wxPlotCurve: public wxObject
{
public:
- wxPlotCurve( int offsetY );
+ wxPlotCurve( int offsetY, double startY, double endY );
virtual wxInt32 GetStartX() = 0;
virtual wxInt32 GetEndX() = 0;
-
+
+ virtual double GetY( wxInt32 x ) = 0;
+
+ void SetStartY( double startY )
+ { m_startY = startY; }
+ double GetStartY()
+ { return m_startY; }
+ void SetEndY( double endY )
+ { m_endY = endY; }
+ double GetEndY()
+ { return m_endY; }
+ void SetOffsetY( int offsetY )
+ { m_offsetY = offsetY; }
int GetOffsetY()
{ return m_offsetY; }
- virtual double GetY( wxInt32 x ) = 0;
-
private:
int m_offsetY;
+ double m_startY;
+ double m_endY;
DECLARE_ABSTRACT_CLASS(wxPlotCurve)
};
void OnPaint( wxPaintEvent &event );
void OnMouse( wxMouseEvent &event );
+
+ void DrawCurve( wxDC *dc, wxPlotCurve *curve, int from = -1, int to = -1 );
+ void DeleteCurve( wxPlotCurve *curve, int from = -1, int to = -1 );
private:
wxPlotWindow *m_owner;
void SetCurrent( wxPlotCurve* current );
wxPlotCurve *GetCurrent();
+ void Move( wxPlotCurve* curve, int pixels_up );
+ void Enlarge( wxPlotCurve *curve, double factor );
+
+ void OnMoveUp( wxCommandEvent& event );
+ void OnMoveDown( wxCommandEvent& event );
+
+ void OnEnlarge100( wxCommandEvent& event );
+ void OnEnlarge50( wxCommandEvent& event );
+ void OnShrink50( wxCommandEvent& event );
+ void OnShrink33( wxCommandEvent& event );
+
void OnPaint( wxPaintEvent &event );
+
+ void RedrawYAxis();
private:
friend wxPlotArea;
-
+
wxList m_curves;
wxPlotArea *m_area;
wxPlotCurve *m_current;