// LessonA16_1View.h : interface of the CLessonA16_1View class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_LESSONA16_1VIEW_H__D579387B_43D8_4E9D_9F0F_4D32FFCE3CEC__INCLUDED_)
#define AFX_LESSONA16_1VIEW_H__D579387B_43D8_4E9D_9F0F_4D32FFCE3CEC__INCLUDED_

#include "Chart.h"
#if defined(_UNICODE) || defined(UNICODE)
#	pragma comment(lib,"CChartu.lib")
#else
#	pragma comment(lib,"CChart.lib")
#endif
using namespace NsCChart;

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

class CLessonA16_1View : public CWindowImpl<CLessonA16_1View>
{
public:
	DECLARE_WND_CLASS(NULL)

	BOOL PreTranslateMessage(MSG* pMsg)
	{
		pMsg;
		return FALSE;
	}

	BEGIN_MSG_MAP(CLessonA16_1View)
		MESSAGE_HANDLER(WM_PAINT, OnPaint)
		MESSAGE_HANDLER(WM_CREATE, OnCreate)
	END_MSG_MAP()

// Handler prototypes (uncomment arguments if needed):
//	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
//	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
//	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)

	LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
	{
		CPaintDC dc(m_hWnd);

		//TODO: Add your drawing code here

		return 0;
	}

	LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
	{
		HWND hWnd = CreateSubChartWnd(m_hWnd, kTypeXY, _T("Chart"), 0, 0, 600, 400);
		CChart *chart = GetChart(hWnd);
		for(int i=-10; i<=10; i++)
		{
			chart->AddPoint2D(i, i*i);
		}
		return 0;
	}
};


/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_LESSONA16_1VIEW_H__D579387B_43D8_4E9D_9F0F_4D32FFCE3CEC__INCLUDED_)
