]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/plot.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPlotWindow
4 // Author: Robert Roebling
7 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "plot.h"
19 #include "wx/scrolwin.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 class WXDLLEXPORT wxPlotCurve
: public wxObject
36 wxPlotCurve( int offsetY
, double startY
, double endY
);
38 virtual wxInt32
GetStartX() = 0;
39 virtual wxInt32
GetEndX() = 0;
41 virtual double GetY( wxInt32 x
) = 0;
43 void SetStartY( double startY
)
44 { m_startY
= startY
; }
47 void SetEndY( double endY
)
51 void SetOffsetY( int offsetY
)
52 { m_offsetY
= offsetY
; }
61 DECLARE_ABSTRACT_CLASS(wxPlotCurve
)
64 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
68 class WXDLLEXPORT wxPlotArea
: public wxWindow
72 wxPlotArea( wxPlotWindow
*parent
);
74 void OnPaint( wxPaintEvent
&event
);
75 void OnMouse( wxMouseEvent
&event
);
77 void DrawCurve( wxDC
*dc
, wxPlotCurve
*curve
, int from
= -1, int to
= -1 );
78 void DeleteCurve( wxPlotCurve
*curve
, int from
= -1, int to
= -1 );
81 wxPlotWindow
*m_owner
;
83 DECLARE_CLASS(wxPlotArea
)
87 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
91 class WXDLLEXPORT wxPlotWindow
: public wxScrolledWindow
95 wxPlotWindow( wxWindow
*parent
, wxWindowID id
, const wxPoint
&pos
, const wxSize
&size
, int flags
);
98 void Add( wxPlotCurve
*curve
);
100 wxPlotCurve
*GetAt( size_t n
);
102 void SetCurrent( wxPlotCurve
* current
);
103 wxPlotCurve
*GetCurrent();
105 void Move( wxPlotCurve
* curve
, int pixels_up
);
106 void Enlarge( wxPlotCurve
*curve
, double factor
);
108 void OnMoveUp( wxCommandEvent
& event
);
109 void OnMoveDown( wxCommandEvent
& event
);
111 void OnEnlarge100( wxCommandEvent
& event
);
112 void OnEnlarge50( wxCommandEvent
& event
);
113 void OnShrink50( wxCommandEvent
& event
);
114 void OnShrink33( wxCommandEvent
& event
);
116 void OnPaint( wxPaintEvent
&event
);
125 wxPlotCurve
*m_current
;
127 DECLARE_CLASS(wxPlotWindow
)
128 DECLARE_EVENT_TABLE()