1
/////////////////////////////////////////////////////////////////////////////
7
// Copyright: (C) 2006, Paolo Gava
8
// RCS-ID: $Id: chartwindow.h 9270 2013-08-18 05:22:02Z mortenmacfly $
9
// Licence: wxWindows licence
10
/////////////////////////////////////////////////////////////////////////////
12
#if !defined( __WXCHARTWINDOW_H__ )
13
#define __WXCHARTWINDOW_H__
15
//----------------------------------------------------------------------------
17
//----------------------------------------------------------------------------
18
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
19
#pragma interface "chartwindow.h"
27
#include <wx/window.h>
28
#include <wx/scrolwin.h>
33
//----------------------------------------------------------------------------
35
//----------------------------------------------------------------------------
38
//+++-S-cd-------------------------------------------------------------------
39
// NAME: CWxChartWindow
43
//----------------------------------------------------------------------E-+++
45
class WXDLLIMPEXP_CHART wxChartWindow : public wxWindow
50
wxChartWindow(wxScrolledWindow *parent = NULL, bool usegrid = true);
52
// allow access of CChart's public methods
54
//-----------------------------------------
55
void Add(wxChartPoints* cp);
58
// allow access of CChart's public methods
61
ChartValue GetMaxX() const;
62
ChartValue GetMinX() const;
63
ChartValue GetMaxY() const;
64
ChartValue GetMinY() const;
65
int GetNumBarPoints() const;
66
int GetNumBar3DPoints() const;
68
// Get/Set virtual size
69
//---------------------
70
ChartValue GetVirtualMaxX() const;
71
ChartValue GetVirtualMinX() const;
72
ChartValue GetVirtualMaxY() const;
73
ChartValue GetVirtualMinY() const;
74
ChartValue GetVirtualWidth() const;
78
void SetZoom(double z);
79
double GetZoom() const;
81
// Set sizes for drawing
82
//----------------------
83
void SetSizes(wxChartSizes *sizes);
84
wxChartSizes *GetSizes() const;
88
void Draw(CHART_HPAINT hp, int x = 0, int y = 0);
92
wxScrolledWindow *m_WinParent;
95
// Draw helper function
97
void DrawHLines(CHART_HPAINT hp, CHART_HRECT hr);
101
void OnPaint(wxPaintEvent &event);
102
void OnMouse(wxMouseEvent &event);
105
DECLARE_DYNAMIC_CLASS(wxChartWindow)
107
DECLARE_EVENT_TABLE()
110
//----------------------------------------------------------------------------
112
//----------------------------------------------------------------------------
115
//+++-S-cf-------------------------------------------------------------------
118
// PARAMETERS: CChartPoints* cp
120
//----------------------------------------------------------------------E-+++
121
inline void wxChartWindow::Add(
128
//+++-S-cf-------------------------------------------------------------------
133
//----------------------------------------------------------------------E-+++
134
inline void wxChartWindow::Clear()
139
//+++-S-cf-------------------------------------------------------------------
141
// DESC: Get the max x-val calculated from all chartpoints
143
// RETURN: ChartValue
144
//----------------------------------------------------------------------E-+++
145
inline ChartValue wxChartWindow::GetMaxX() const
147
return ( m_Chart.GetMaxX() );
150
//+++-S-cf-------------------------------------------------------------------
152
// DESC: Get the min x-val calculated from all chartpoints
154
// RETURN: ChartValue
155
//----------------------------------------------------------------------E-+++
156
inline ChartValue wxChartWindow::GetMinX() const
158
return ( m_Chart.GetMinX() );
161
//+++-S-cf-------------------------------------------------------------------
163
// DESC: Get the max y-val calculated from all chartpoints
165
// RETURN: ChartValue
166
//----------------------------------------------------------------------E-+++
167
inline ChartValue wxChartWindow::GetMaxY() const
169
return ( m_Chart.GetMaxY() );
172
//+++-S-cf-------------------------------------------------------------------
174
// DESC: Get the min y-val calculated from all chartpoints
176
// RETURN: ChartValue
177
//----------------------------------------------------------------------E-+++
178
inline ChartValue wxChartWindow::GetMinY() const
180
return ( m_Chart.GetMinY() );
183
//+++-S-cf-------------------------------------------------------------------
184
// NAME: GetNumBarPoints()
185
// DESC: Number of bar points is used to calculate the width
189
//----------------------------------------------------------------------E-+++
190
inline int wxChartWindow::GetNumBarPoints() const
192
return ( m_Chart.GetNumBarPoints() );
196
//+++-S-cf-------------------------------------------------------------------
197
// NAME: GetNumBar3DPoints()
198
// DESC: Number of bar points is used to calculate the width
202
//----------------------------------------------------------------------E-+++
203
inline int wxChartWindow::GetNumBar3DPoints() const
205
return ( m_Chart.GetNumBar3DPoints() );
208
//+++-S-cf-------------------------------------------------------------------
211
// PARAMETERS: double
213
//----------------------------------------------------------------------E-+++
214
inline void wxChartWindow::SetZoom(
218
m_Chart.SetZoom( z );
221
//+++-S-cf-------------------------------------------------------------------
224
// PARAMETERS: double
226
//----------------------------------------------------------------------E-+++
227
inline double wxChartWindow::GetZoom() const
229
return m_Chart.GetZoom();
232
//+++-S-cf-------------------------------------------------------------------
234
// DESC: Set sizes for drawing
235
// PARAMETERS: ChartSizes sizes
237
//----------------------------------------------------------------------E-+++
238
inline void wxChartWindow::SetSizes(
242
m_Chart.SetSizes( sizes );
245
//+++-S-cf-------------------------------------------------------------------
247
// DESC: Get sizes for drawing
249
// RETURN: ChartSizes sizes
250
//----------------------------------------------------------------------E-+++
251
inline wxChartSizes *wxChartWindow::GetSizes() const
253
return m_Chart.GetSizes();
256
//+++-S-cf-------------------------------------------------------------------
257
// NAME: GetVirtualMaxX
258
// DESC: Get virtual size for drawing
260
// RETURN: ChartValue
261
//----------------------------------------------------------------------E-+++
262
inline ChartValue wxChartWindow::GetVirtualMaxX() const
267
//+++-S-cf-------------------------------------------------------------------
268
// NAME: GetVirtualMinX
269
// DESC: Get virtual size for drawing
271
// RETURN: ChartValue
272
//----------------------------------------------------------------------E-+++
273
inline ChartValue wxChartWindow::GetVirtualMinX() const
278
//+++-S-cf-------------------------------------------------------------------
279
// NAME: GetVirtualMaxY
280
// DESC: Get virtual size for drawing
282
// RETURN: ChartValue
283
//----------------------------------------------------------------------E-+++
284
inline ChartValue wxChartWindow::GetVirtualMaxY() const
289
//+++-S-cf-------------------------------------------------------------------
290
// NAME: GetVirtualMinX
291
// DESC: Get virtual size for drawing
293
// RETURN: ChartValue
294
//----------------------------------------------------------------------E-+++
295
inline ChartValue wxChartWindow::GetVirtualMinY() const
300
#endif // __WXCHARTWINDOW_H__