ConfigureVarSys()
{
	CreateInteger("mission.var1", 0);
	SetIntegerRange("mission.var1", 0, 3);

	CreateInteger("mission.var2", 0);
	SetIntegerRange("mission.var2", 0, 3);

	CreateInteger("mission.var3", 0);
	SetIntegerRange("mission.var3", 0, 3);

	CreateInteger("mission.var4", 0);
	SetIntegerRange("mission.var4", 0, 2);
}



CreateControl("Window1", "WINDOW")
{
	Geometry("HCENTRE","VCENTRE");
	Size(800, 375);
	BorderSize(25);
	BevelSize(13);
	Font("Console");
	TitleFont("Console");
	Title("Unit Selection");
	TabSize(250, 25);
	Style("Outline", "INERT");

	CreateControl("Messages", "ListBox")
	{
		Geometry("Top", "Left");
		Pos(13, 13);
		Size(775, 275);
		CellSize(775, 25);
		BorderSize(13);
		BevelSize(8);
		SliderPadding(5);
		Font("MEDIUM");
		Style("NOSELECTION");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}
		AddTextItem("");
		AddTextItem("Choose a combination of units whose");
		AddTextItem("total scrap cost doesn't exceed 200.");
		AddTextItem("");
		AddTextItem("");
		AddTextItem("Number of Titans (90):");
		AddTextItem("");
		AddTextItem("Number of Lancers (55):");
		AddTextItem("");
		AddTextItem("Number of Maulers (55):");	
	}

	CreateControl("Low", "BUTTON")
	{
		ColorGroup("LISTBOX");
		Geom("TOP", "LEFT");
		Position(300, 350);
		Size(163, 13);
		BorderSize(13);
		BevelSize(8);
		Style("ROLLOVER", "RADIO");
		Font("SMALL");
		Text("ENTER");
		Cursor("Highlight");
		UseVar("mission.var4");
		Value(1);
		NotifyParent("Button::Select", "Press");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(525, 138);
		Size(225, 25);
		Font("SMALL");
		UseVar("mission.var1");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(525, 188);
		Size(225, 25);
		Font("SMALL");
		UseVar("mission.var2");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	CreateControl("EditBox", "Edit")
	{
		Geometry("Top", "Left");
		Pos(525, 238);
		Size(225, 25);
		Font("SMALL");
		UseVar("mission.var3");
		Style("Rollover", "Outline");
		Cursor("Highlight");
	}

	OnEvent("Control::Activate")
	{
		InitialTab(1);
	}

	OnEvent("Press")
	{
		Deactivate("|Window1");
	}
}


CreateControl("Window2", "WINDOW")
{
	Geometry("HCENTRE","VCENTRE");
	Size(800, 375);
	BorderSize(25);
	BevelSize(13);
	Font("Console");
	TitleFont("Console");
	Title("Warning");
	TabSize(250, 25);
	Style("Outline", "INERT");

	CreateControl("Messages", "ListBox")
	{
		Geometry("Top", "Left");
		Pos(13, 13);
		Size(775, 275);
		CellSize(775, 25);
		BorderSize(13);
		BevelSize(8);
		SliderPadding(5);
		Font("MEDIUM");
		Style("NOSELECTION");
		ItemConfig()
		{
			Style("TRANSPARENT");
		}
		AddTextItem("");
		AddTextItem("You have enough scrap for at least");
		AddTextItem("another unit.  Redo selection?");
		AddTextItem("");
	}

	CreateControl("Yes", "BUTTON")
	{
		ColorGroup("LISTBOX");
		Geom("TOP", "LEFT");
		Position(50, 350);
		Size(163, 13);
		BorderSize(13);
		BevelSize(8);
		Style("ROLLOVER", "RADIO");
		Font("SMALL");
		Text("YES");
		Cursor("Highlight");
		UseVar("mission.var4");
		Value(1);
		NotifyParent("Button::Select", "Press");
	}

	CreateControl("No", "BUTTON")
	{
		ColorGroup("LISTBOX");
		Geom("TOP", "LEFT");
		Position(400, 350);
		Size(163, 13);
		BorderSize(13);
		BevelSize(8);
		Style("ROLLOVER", "RADIO");
		Font("SMALL");
		Text("NO");
		Cursor("Highlight");
		UseVar("mission.var4");
		Value(2);
		NotifyParent("Button::Select", "Press");
	}

	OnEvent("Control::Activate")
	{
		InitialTab(1);
	}

	OnEvent("Press")
	{
		Deactivate("|Window2");
	}
}
