#pragma once
 
#include <core/SWnd.h>

#include "CChart\Chart.h"
using namespace NsCChart;
#pragma comment(lib,"CChart/CChartu.lib")
 
namespace SOUI
{
	class SChartWnd : public SWindow
	{
		SOUI_CLASS_NAME(SChartWnd,L"SChartWnd")
 
	public:
		SChartWnd();
		~SChartWnd();
 
	protected:
		void OnPaint(IRenderTarget *pRT);
		void OnTimer(UINT_PTR nIDEvent);
		int  OnCreate(LPVOID lpVoid);
		void OnDestroy();
		void OnLButtonDown(UINT nFlags,CPoint pt);
        void OnLButtonUp(UINT nFlags,CPoint pt);
		void OnLButtonDbClick(UINT nFlags,CPoint pt);
		void OnMouseMove(UINT nFlags,CPoint pt);
		void OnRButtonDown(UINT nFlags,CPoint pt);
		void OnKeyDown(UINT nChar,UINT nRepCnt,UINT nFlags);

		virtual UINT OnGetDlgCode();
  
		SOUI_MSG_MAP_BEGIN()
			MSG_WM_PAINT_EX(OnPaint)
			MSG_WM_TIMER_EX(OnTimer)
			MSG_WM_CREATE(OnCreate)
			MSG_WM_DESTROY(OnDestroy)
			MSG_WM_LBUTTONDOWN(OnLButtonDown)
            MSG_WM_LBUTTONUP(OnLButtonUp)
			MSG_WM_LBUTTONDBLCLK(OnLButtonDbClick)
			MSG_WM_MOUSEMOVE(OnMouseMove)
			MSG_WM_RBUTTONDOWN(OnRButtonDown)
			MSG_WM_KEYDOWN(OnKeyDown)
		SOUI_MSG_MAP_END()
 
	private:
		CChart	chart;

		bool	bRun;
	};
}
