//-----------------------------------------------------------------------------
#ifndef PlotCanvasH
#define PlotCanvasH PlotCanvasH
//-----------------------------------------------------------------------------
#include "DrawingCanvas.h"
#include <wx/dcclient.h>

//-----------------------------------------------------------------------------
class PlotCanvas : public DrawingCanvas
//-----------------------------------------------------------------------------
{
	DECLARE_EVENT_TABLE()
	int						m_BorderWidth;
protected:
	int						m_ImageCount;
	int						m_UpdateFrequency;

	virtual void			OnPaintCustom( wxPaintDC& dc ) = 0;
	void					DrawInfoString( wxPaintDC& dc, const wxString& info, wxCoord& xOffset, wxCoord yOffset, const wxColour& colour ) const;
	void					DrawMarkerLines( wxPaintDC& dc, const wxCoord w, const wxCoord h, const double scaleX ) const;
	void					DrawProfileLine( wxPaintDC& dc, int h, int startOffset, double scaleX, double scaleY, unsigned int from, unsigned int to, int* pData, int elementCount, const wxColour& colour ) const;
	virtual double			GetScaleX( wxCoord /*w*/ ) const { return 1.0; }
	virtual double			GetScaleY( wxCoord /*h*/ ) const { return 1.0; }
	virtual unsigned int	GetXMarkerParameters( unsigned int& from, unsigned int& to ) const { from = 0; to = 0; return 1; }
	virtual void			OnPaint( wxPaintEvent& );
public:
	explicit				PlotCanvas() {}
	explicit				PlotCanvas( wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
								const wxSize& size = wxDefaultSize, long style = wxSUNKEN_BORDER,
								const wxString& name = wxT("PlotCanvas"), bool boActive = false );
	bool					SetUpdateFrequency( int frequency );
	int						GetBorderWidth( void ) const { return m_BorderWidth; }
	void					SetBorderWidth( int borderWidth );
	//-----------------------------------------------------------------------------
	enum TUpdateLimit
	//-----------------------------------------------------------------------------
	{
		ulMin = 1,
		ulMax = 100
	};
};

#endif // PlotCanvasH
