// ================
// BATTLEZONE SHELL
// ================

//
// CREATE SHELL LOGIN PAGE
//
exec("bzshell_scroll.cfg");

CreateControl("ShellLogin", "WINDOW")
{
	// inherit root window's dimensions
	Geometry("PARENTWIDTH", "PARENTHEIGHT");

	// set window style
	Style("TRANSPARENT", "MODAL");

	
	//
	// create the login edit box
	//
	CreateControl("LoginEdit", "EDIT")
	{
		Geometry("HCENTRE", "TOP");
		Position(0, 130);
		Size(200, 20);
		Style("ROLLOVER", "OUTLINE");
		Projector(1);
		BorderSize(10);
		BevelSize(5);
		TabSize(120, 10);
		Title("Login Name");
		TitleFont("MEDIUM");
		Font("LARGE");
		Cursor("Highlight");
		UseVar("shell.login.name");
		MaxLength(21);	// 20 characters + 1 for the end
	}

	//
	// create the login list box
	//
	CreateControl("LoginList", "WINDOW")
	{
		Geometry("HCENTRE", "TOP");
		Position(0, 190);
		Size(200, 100);
		BorderSize(10);
		BevelSize(5);
		Style("OUTLINE");
		Projector(3);
		TabSize(120, 10);
		Title("Duty Roster");
		TitleFont("MEDIUM");
		
		CreateControl("List", "LISTBOX")
		{
			ColorGroup("LISTBOX");

			Geometry("HCENTRE", "TOP");
			Position(0, 0);
			Size(200, 100);
			CellSize(200, 10);
			BorderSize(5);
			BevelSize(3);
			Font("SMALL");
			UseVar("shell.login.slot");
			Cursor("Highlight");
		}
	}

	//
	// create the "retire" button
	//
	CreateControl("Retire", "BUTTON")
	{
		Geometry("HCENTRE", "TOP");
		Position(0, 320);
		Size(200, 15);
		BorderSize(10);
		BevelSize(5);
		Style("ROLLOVER", "OUTLINE");
		Projector(5);
		Font("MEDIUM");
		JustifyText("CENTER");
		Text("Retire Pilot");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Retire");
	}

	//
	// create the "enter" button
	//
	CreateControl("Enter", "BUTTON")
	{
		ColorGroup("MAGENTA");

		Geometry("RIGHT", "TOP");
		Position(-20, 20);
		Size(95, 0);
		BorderSize(10);
		BevelSize(5);
		Style("ROLLOVER", "OUTLINE");
		Text("Enter");
		Font("MEDIUM");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Enter");
	}

	//
	// create the "quit" button
	//
	CreateControl("Quit", "BUTTON")
	{
		ColorGroup("MAGENTA");

		Geometry("LEFT", "TOP");
		Position(20, 20);
		Size(95, 0);
		BorderSize(10);
		BevelSize(5);
		Style("ROLLOVER", "OUTLINE");
		Text("Quit");
		Font("MEDIUM");
		Cursor("Highlight");
		NotifyParent("Button::Press", "Quit");
	}

	//
	// handle the "retire" event
	//
	OnEvent("Retire")
	{
		Cmd("shell.login.retire");
	}

	//
	// handle the "enter" event
	//
	OnEvent("Enter")
	{
		Cmd("shell.login.enter");
		//FadeOut();
		//FadeIn("|ShellMain");
	}

	//
	// handle the "quit" event
	//
	OnEvent("Quit")
	{
		Cmd("sys.runcode quit");
	}

	OnEvent("Control::Activate")
	{
		Activate("|Scroll");
		cmd("shell.background login.tga");
		cmd("shell.backgroundSound mire22_1.wav");
	}
	
	OnEvent("Control::Deactivate")
	{
		Deactivate("|Scroll");
		cmd("shell.stopSound mire22_1.wav");
	}


}

