//-----------------------------------------------------------------------------
#ifndef AnalysisDataGridTableH
#define AnalysisDataGridTableH AnalysisDataGridTableH
//-----------------------------------------------------------------------------
#include <wx/grid.h>

class ImageAnalysisPlotCanvas;

//-----------------------------------------------------------------------------
class AnalysisDataGridTable : public wxGridTableBase
//-----------------------------------------------------------------------------
{
	ImageAnalysisPlotCanvas* m_pParent;
	long m_Rows;
	long m_Columns;
	bool UpdateRowsCols( long rows, long cols );
public:
	explicit         AnalysisDataGridTable( ImageAnalysisPlotCanvas* pParent, long rows, long columns );
	virtual int      GetNumberRows( void ) { return m_Rows; }
	virtual int      GetNumberCols( void ) { return m_Columns; }
	virtual bool     IsEmptyCell( int /*row*/, int /*col*/ ) { return false; }
	virtual bool     AppendRows( size_t numRows = 1 ) { return UpdateRowsCols( m_Rows + static_cast<long>(numRows), m_Columns ); }
	virtual bool     DeleteRows( size_t /*pos = 0*/, size_t numRows = 1 ) { return UpdateRowsCols( m_Rows - static_cast<long>(numRows), m_Columns ); }
	virtual bool     AppendCols( size_t numCols = 1 ) { return UpdateRowsCols( m_Rows, m_Columns + static_cast<long>(numCols) ); }
	virtual bool     DeleteCols( size_t /*pos = 0*/, size_t numCols = 1 ) { return UpdateRowsCols( m_Rows, m_Columns - static_cast<long>(numCols) ); }
	virtual wxString GetValue( int row, int col );
	virtual void     SetValue( int /*row*/, int /*col*/, const wxString& /*val*/ ) {}
};

#endif // AnalysisDataGridTableH
