#define __WXMSW__   /// 使用windows平台
//#define WXUSINGDLL  /// 使用动态链接库
#define WXUSINGLIB  /// 使用静态链接库
 
#ifdef _DEBUG
#define __WXDEBUG__  /// 使用WxWidgets调试
#endif //_DEBUG
 
#include "wx/config.h"
 
#include "wx/wx.h"       /// 使用WxWidgets通用功能和类
#include "wx/aui/aui.h" /// 使用AUI
#include "wx/artprov.h"  /// 使用预定义的图标资源

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

CChartWnd chartWnd;

class MyFrame: public wxFrame {
public:
    MyFrame(): wxFrame(NULL, wxID_ANY, "WxWidgets") {
		WXHWND wxhWnd = GetHWND();
		chartWnd.Attach((HWND)wxhWnd, kTypeXY);
		int i, hc=5;
		for(i=-hc; i<=hc; ++i)
		{
			chartWnd.GetChart()->AddPoint2D(i, i*i);
		}
		chartWnd.GetChart()->SetBLAxis();
		chartWnd.GetChart()->SetTitle(_T("Title"));
	}

	void MyFrame::OnSize(wxSizeEvent &event) {
		chartWnd.ReDraw();
	}

	wxDECLARE_EVENT_TABLE();
};
class MyApp: public wxApp {
public:
    virtual bool OnInit(){
        MyFrame *pframe = new MyFrame();
        pframe->Show( true );
        return true;
    }
};


wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
    EVT_SIZE(MyFrame::OnSize)
wxEND_EVENT_TABLE()

wxIMPLEMENT_APP(MyApp);