]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/plot.h
Add draft wxPlotWindow
[wxWidgets.git] / include / wx / generic / plot.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: plot.h
3 // Purpose: wxPlotWindow
4 // Author: Robert Roebling
5 // Modified by:
6 // Created: 12/1/2000
7 // Copyright: (c) Robert Roebling
8 // RCS-ID: $Id$
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_PLOT_H_
13 #define _WX_PLOT_H_
14
15 #ifdef __GNUG__
16 #pragma interface "plot.h"
17 #endif
18
19 #include "wx/scrolwin.h"
20
21 //-----------------------------------------------------------------------------
22 // classes
23 //-----------------------------------------------------------------------------
24
25 class wxPlotCurve;
26 class wxPlotArea;
27 class wxPlotWindow;
28
29 //-----------------------------------------------------------------------------
30 // wxPlotCurve
31 //-----------------------------------------------------------------------------
32
33 class WXDLLEXPORT wxPlotCurve: public wxObject
34 {
35 public:
36 wxPlotCurve( int offsetY );
37
38 virtual wxInt32 GetStartX() = 0;
39 virtual wxInt32 GetEndX() = 0;
40
41 int GetOffsetY()
42 { return m_offsetY; }
43
44 virtual double GetY( wxInt32 x ) = 0;
45
46 private:
47 int m_offsetY;
48
49 DECLARE_ABSTRACT_CLASS(wxPlotCurve)
50 };
51
52 //-----------------------------------------------------------------------------
53 // wxPlotArea
54 //-----------------------------------------------------------------------------
55
56 class WXDLLEXPORT wxPlotArea: public wxWindow
57 {
58 public:
59 wxPlotArea() {}
60 wxPlotArea( wxPlotWindow *parent );
61
62 void OnPaint( wxPaintEvent &event );
63 void OnMouse( wxMouseEvent &event );
64
65 private:
66 wxPlotWindow *m_owner;
67
68 DECLARE_CLASS(wxPlotArea)
69 DECLARE_EVENT_TABLE()
70 };
71
72 //-----------------------------------------------------------------------------
73 // wxPlotWindow
74 //-----------------------------------------------------------------------------
75
76 class WXDLLEXPORT wxPlotWindow: public wxScrolledWindow
77 {
78 public:
79 wxPlotWindow() {}
80 wxPlotWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flags );
81 ~wxPlotWindow();
82
83 void Add( wxPlotCurve *curve );
84 size_t GetCount();
85 wxPlotCurve *GetAt( size_t n );
86
87 void SetCurrent( wxPlotCurve* current );
88 wxPlotCurve *GetCurrent();
89
90 void OnPaint( wxPaintEvent &event );
91
92 private:
93 friend wxPlotArea;
94
95 wxList m_curves;
96 wxPlotArea *m_area;
97 wxPlotCurve *m_current;
98
99 DECLARE_CLASS(wxPlotWindow)
100 DECLARE_EVENT_TABLE()
101 };
102
103 #endif
104 // _WX_PLOT_H_