 /*
 *	WEngine by eMan
 *  WWW : www.eman.wz.cz
 *  PATH : .\SDK\WCode\App\CBase.h
 */

#ifndef _CBASE_H
#define _CBASE_H

#include "EngineH.h"

static int g_NumWin=0;
const int WIN_DIS = 20;

class C_BASE_0
{
private :
	std::string _name_project;
	std::string _name_project_zzz;
	std::string _name_project_loading;
	std::string _name_class;
	HWND _hWnd;
	RECT _rect;
	WNDCLASS _wnd;
	bool _bool_dis;
	//**//  Funkce  //**//
	
public :
	virtual ~C_BASE_0(){}

public :
	void InkNumWin()
	{			
		if(_bool_dis)
		{
			_rect.left += g_NumWin*WIN_DIS;
			_rect.top += g_NumWin*WIN_DIS;
			g_NumWin++;
		}
	}
	std::string				GetNameClass()const {return _name_class;}
	void					SetNameClass(std::string name_class){_name_class = name_class;}
	WNDCLASS				GetWndClass()const {return _wnd;}
	void					SetWndClass(WNDCLASS w){_wnd = w;}
	void					SetHwnd(HWND hWnd){_hWnd = hWnd;}
	HWND					GetHwnd()const {return _hWnd;}
	void					SetFocus()const {::SetFocus(_hWnd);}
	void					SetWindowText(const char *text)
	{
		::SetWindowText(_hWnd,(LPTSTR)text);
	}

	void					SetNameP(std::string text){_name_project = text;}
	void					SetNamePZ(std::string text){_name_project_zzz = text;}
	void					SetNamePL(std::string text){_name_project_loading = text;}
	void					SetBoolDis(bool b){_bool_dis = b;}
	std::string				GetNameP()const {return _name_project;}
	std::string				GetNamePZ()const {return _name_project_zzz;}
	std::string				GetNamePL()const {return _name_project_loading;}
	void					SetRect(const RECT rect){_rect = rect;}
	inline void				SetRect(const int x,const int y,const int width,const int height)
	{
		RECT *r = &_rect;
		r->left = x;
		r->top = y;
		r->right = width;
		r->bottom = height;
	}
	RECT GetRect() const {return _rect;}
	RECT GetRectClient() const 
	{
		RECT lpRect;
		GetClientRect(_hWnd, &lpRect);
		return lpRect;
	}
	void Close() 
	{
		SendMessage(_hWnd, WM_CLOSE, 0, 0);
	}
	void ShowWin(int nCmdShow)
	{
		ShowWindow(_hWnd, nCmdShow);
	}
	void ShowOff()
	{
		ShowWindow(_hWnd, SW_HIDE); 
	}
	void ShowOn()
	{
		ShowWindow(_hWnd, SW_SHOW); 
	}

public :
	virtual bool			Register(){return FALSE;}
	virtual void			Render(){}	
	virtual void			LoopEvent(){}
};

#endif _CBASE_H