//=============================================================================
// UBrowserRootWindow - root window subclass for Unreal Menu System
//=============================================================================
class UMenuRootWindow expands UWindowRootWindow;

#exec TEXTURE IMPORT NAME=Bg11 FILE=Textures\Bg-11.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg21 FILE=Textures\Bg-21.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg31 FILE=Textures\Bg-31.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg41 FILE=Textures\Bg-41.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg12 FILE=Textures\Bg-12.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg22 FILE=Textures\Bg-22.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg32 FILE=Textures\Bg-32.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg42 FILE=Textures\Bg-42.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg13 FILE=Textures\Bg-13.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg23 FILE=Textures\Bg-23.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg33 FILE=Textures\Bg-33.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=Bg43 FILE=Textures\Bg-43.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=MenuBlack FILE=Textures\MenuBlack.bmp GROUP="Icons" FLAGS=2 MIPS=OFF

var	UMenuMenuBar MenuBar;
var	UMenuToolBar ToolBar;

function Created() {
	Super.Created();

	MenuBar = UMenuMenuBar(CreateWindow(class'UMenuMenuBar', 50, 0, 500, 16));
//	ToolBar = UMenuToolBar(CreateWindow(class'UMenuToolBar', 00, 0, 50, 300));

	// CreateWindow(class'UMenuTempWindow', 100, 100, 350, 200);



	Resized();
}


function Paint(Canvas C, float MouseX, float MouseY)
{
	local int XOffset, YOffset;
	local int W, H;


	if(Console.bNoDrawWorld)
	{

		W = WinWidth / 4;
		H = W;

		if(W > 256 || H > 256)
		{
			Tile(C, Texture'MenuBlack');
			W = 256;
			H = 256;
		}



		XOffset = (WinWidth - (4 * W)) / 2;
		YOffset = (WinHeight - (3 * H)) / 2;

		C.bNoSmooth = False;

		DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (0 * H), W, H, Texture'Bg11');
		DrawStretchedTexture(C, XOffset + (1 * W), YOffset + (0 * H), W, H, Texture'Bg21');
		DrawStretchedTexture(C, XOffset + (2 * W), YOffset + (0 * H), W, H, Texture'Bg31');
		DrawStretchedTexture(C, XOffset + (3 * W), YOffset + (0 * H), W, H, Texture'Bg41');

		DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (1 * H), W, H, Texture'Bg12');
		DrawStretchedTexture(C, XOffset + (1 * W), YOffset + (1 * H), W, H, Texture'Bg22');
		DrawStretchedTexture(C, XOffset + (2 * W), YOffset + (1 * H), W, H, Texture'Bg32');
		DrawStretchedTexture(C, XOffset + (3 * W), YOffset + (1 * H), W, H, Texture'Bg42');
		
		DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (2 * H), W, H, Texture'Bg13');
		DrawStretchedTexture(C, XOffset + (1 * W), YOffset + (2 * H), W, H, Texture'Bg23');
		DrawStretchedTexture(C, XOffset + (2 * W), YOffset + (2 * H), W, H, Texture'Bg33');
		DrawStretchedTexture(C, XOffset + (3 * W), YOffset + (2 * H), W, H, Texture'Bg43');

		C.bNoSmooth = True;
	}
}


function Resized() {
	Super.Resized();
	
	MenuBar.WinLeft = 0;// 50;
	MenuBar.WinTop = 0;
	MenuBar.WinWidth = WinWidth; //- 50;
	MenuBar.WinHeight = 16;

//	ToolBar.WinLeft = 0;
//	ToolBar.WinTop = 0;
//	ToolBar.WinWidth = 50;
//	ToolBar.WinHeight = WinHeight;
}
