#include "..\\global\\iviewer.h"
#include <map>

#include "resource.h"
#include "..\\global\\headers.h"

class CFrmWnd;

class CImpView : public CWnd
{
private:

	std::map<DWORD, DWORD> m_mapMinValues;
	std::map<DWORD, DOUBLE*> m_mapXValues;
	std::map<DWORD, DOUBLE*> m_mapYValues;
	std::map<DWORD, LPWSTR> m_mapLegend;
	std::map<DWORD, COLORREF> m_mapColor;
	std::map<DWORD, BYTE> m_mapMark;

	// globalni data grafu
	LPWSTR m_strGraphName;
	LPWSTR m_strXLabel;
	LPWSTR m_strYLabel;
	DOUBLE m_dMinX;
	DOUBLE m_dMaxX;
	DOUBLE m_dMinY;
	DOUBLE m_dMaxY;

	BOOL m_bXRange, m_bYRange;


//	double m_dMinX, m_dMaxX, m_dMinY, m_dMaxY;
	ITEMTYPE m_bestItemTypeX, m_bestItemTypeY;
	DWORD m_dwGraphs;

public:
	CImpView(CFrmWnd* pParent);
	~CImpView();
	DECLARE_MESSAGE_MAP()
	afx_msg void OnPaint();
	void OnDraw(CDC *pDC);
	void OnPrepareDC(CDC *pDC);
private:
	BOOL DrawGraphs(CDC* pDC, DWORD dwWidth, DWORD dwHeight, BYTE* pData);
	BOOL LoadData(BYTE *pData);
	BOOL DeleteData();
public:
	CFrmWnd* m_pParent;
	afx_msg void OnUpdateRefreshNow(CCmdUI *pCmdUI);
	void UpdateScrollBars();
	afx_msg void OnSize(UINT nType, int cx, int cy);
};