// MainDlg.h : interface of the CLoginDlg class
//
/////////////////////////////////////////////////////////////////////////////
#pragma once

#include "CManageNetWork.h"
#include "comm.h"

class CLoginDlg : public SHostWnd, protected TAutoEventMapReg<CLoginDlg>
{
public:
	CLoginDlg();
	~CLoginDlg();

	void OnClose();
	void OnMaximize();
	void OnRestore();
	void OnMinimize();

	int OnCreate(LPCREATESTRUCT lpCreateStruct);
	BOOL OnInitDialog(HWND wndFocus, LPARAM lInitParam);
private:
	void Init();
	bool OnTabtypeControl(SOUI::EventArgs* pEvt);

	void OnLogin();


	void ToMain();
	void OnUpdateLInkUI();

protected:

	void OnLoginFinish(EventArgs* e);
	void OnDonloadFinish(EventArgs* e);
	void OnSysConfig(EventArgs * e);
	void OnReg();
	//soui消息
	EVENT_MAP_BEGIN()

		EVENT_HANDLER(EventLogin::EventID, OnLoginFinish)
		EVENT_HANDLER(EventDoWNload::EventID, OnDonloadFinish)
		EVENT_HANDLER(EventSysconfig::EventID, OnSysConfig)


		EVENT_NAME_COMMAND(L"btn_close", OnClose)
		EVENT_NAME_COMMAND(L"btn_min", OnMinimize)
		EVENT_NAME_COMMAND(L"btn_max", OnMaximize)
		EVENT_NAME_COMMAND(L"btn_restore", OnRestore)
		EVENT_NAME_COMMAND(L"onlogin", OnLogin)
		EVENT_NAME_COMMAND(L"reglink", OnReg)
	EVENT_MAP_END()
		
	//HostWnd真实窗口消息处理
	BEGIN_MSG_MAP_EX(CLoginDlg)
		MSG_WM_CREATE(OnCreate)
		MSG_WM_INITDIALOG(OnInitDialog)
		MSG_WM_CLOSE(OnClose)
		CHAIN_MSG_MAP(SHostWnd)
		REFLECT_NOTIFICATIONS_EX()
	END_MSG_MAP()
private:
	BOOL			m_bLayoutInited;	
	std::vector<ServerListUrl> vctInfo;
	std::vector<ServerListUrl> vctInfoUrl;
	BOOL			m_is_reg;
	/*CManageNetWork* m_network_tools;*/
 
	
	 
};
