#pragma once

#include "../EngineDef.h"
#include "Singleton.h"

#include "StaticControl.h"
#include "ButtonControl.h"
#include "EditBoxControl.h"
#include "ListBoxControl.h"
#include "ComboBoxControl.h"
#include "ViewControl.h"


// enum ButtonEvent
// {
// 
// };
// 
// enum ListBoxEvent
// {
// 
// };
// 
// enum EditBoxEvent
// {
// 
// };

class Engine EEngineFrameWork
	: public CSingleton<EEngineFrameWork>
{
protected:
	std::vector<CBaseControl*>	m_stlBaseControl;

	std::wstring	m_strTitle;					// 제목 표시줄 텍스트입니다.
	std::wstring	m_strWindowClass;			// 기본 창 클래스 이름입니다.

	HACCEL			m_hAccelTable;	

	HWND			m_hEdit;	

public:
	HWND			m_hWnd;
	HINSTANCE		m_hInst;								// 현재 인스턴스입니다.

private:
	ATOM				MyRegisterClass(HINSTANCE hInstance);
	BOOL				InitInstance(HINSTANCE);

public:
	EEngineFrameWork(void);
	~EEngineFrameWork(void);

	int					InitFrameWork( HINSTANCE hInstance, HINSTANCE hPrevInstance );
	int					Run( void );

	virtual void		_InitFrameWork( void ) = 0;
	virtual void		_InitMenuControl( void ) = 0;
	virtual void		_DeInitFrameWork( void ) = 0;

	virtual void		ControlEvent( CBaseControl* aControl, int aEvent ) = 0;

	virtual void		OnPaint( PAINTSTRUCT aPs ) {}


	//----------------------------------------------
	// 컨트롤 생성
	//----------------------------------------------
	CButtonControl*		CreateButton( LPCWSTR aName, DWORD aStyle, int aX, int aY, int aWidth, int aHeight );
	CListBoxControl*	CreateListBox( LPCWSTR aName, DWORD aStyle, int aX, int aY, int aWidth, int aHeight );
	CComboBoxControl*	CreateComboBox( LPCWSTR aName, DWORD aStyle, int aX, int aY, int aWidth, int aHeight );
	CEditBoxControl*	CreateEditBox( LPCWSTR aName, DWORD aStyle, int aX, int aY, int aWidth, int aHeight );
	CViewControl*		CreateView( LPCWSTR aName, DWORD aStyle, int aX, int aY, int aWidth, int aHeight );
	CStaticControl*		CreateStatic( LPCWSTR aName, DWORD aStyle, int aX, int aY, int aWidth, int aHeight );

	CBaseControl*		GetControl( int aIdx );

	//----------------------------------------------
	// 
	//----------------------------------------------
	void				GetButtonEvent( );
	void				GetListBoxEvent( );
	void				GetEditBoxEvent( );


	LPCWSTR				GetWindowClass( void ) { return m_strWindowClass.c_str(); }

	virtual void		Update( double aTime ) {}

};

