// cTearsStartupMenu.cpp: implementation of the cTearsStartupMenu class.
//
//////////////////////////////////////////////////////////////////////

#include "stdinc.h"
#include "cTearsStartupMenu.h"

BOOL cTearsStartupMenu::ClassRegistered = false;

cTearsStartupMenu::cTearsStartupMenu(){

}

cTearsStartupMenu::~cTearsStartupMenu(){
	Destroy();
}

BOOL cTearsStartupMenu::RegisterClass(){
	ClassRegistered = cWindow::RegisterClass(CS_HREDRAW | CS_VREDRAW);
	return ClassRegistered;
}

BOOL cTearsStartupMenu::Create(LPCTSTR lpWindowName, DWORD dwStyle, 
		int x, int y, int nWidth, int nHeight, 
		cWindow *pParentWindow, int id, cDisplay *_pDisplay){

	BackPic.Create(new cMedium("title.bmp"));

	return cPictureWindow::Create(dwStyle, x, y, nWidth, nHeight,
		pParentWindow, id, _pDisplay->GetFrontPic(), &BackPic);
}

void cTearsStartupMenu::Destroy(){
	cPictureWindow::Destroy();
	BackPic.DeleteMedium();
//	BtnPic[0].DeleteMedium();
//	BtnPic[1].DeleteMedium();

}


LRESULT cTearsStartupMenu::Proc(UINT uMsg, WPARAM wParam, LPARAM lParam){
	switch(uMsg){
	case WM_CREATE:
		SetFocus();
		break;
	case WM_KEYDOWN:
		switch(wParam){
		case VK_RETURN:
			PostQuitMessage(SMID_START);
			break;
		case VK_ESCAPE:
			PostQuitMessage(SMID_EXIT);
			break;
		};
		
		return 0;
	}
	return cPictureWindow::Proc(uMsg, wParam, lParam);
}
