UWindow
Class UWindowMenuBarItem

source: e:\games\UnrealTournament\UWindow\Classes\UWindowMenuBarItem.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowList
         |
         +--UWindow.UWindowMenuBarItem
Direct Known Subclasses:None

class UWindowMenuBarItem
extends UWindow.UWindowList

//============================================================================= // UWindowMenuBarItem - An Unreal menu bar item //=============================================================================
Variables
 byte HotKey
 float ItemLeft
 float ItemWidth
 UWindowPulldownMenu Menu
 UWindowMenuBar Owner
 bool bHelp


Function Summary
 void CloseUp()
 void DeSelect()
 UWindowMenuBar GetMenuBar()
 void Select()
 void SetCaption(string C)
 void SetHelp(bool b)



Source Code


00001	//=============================================================================
00002	// UWindowMenuBarItem - An Unreal menu bar item
00003	//=============================================================================
00004	
00005	class UWindowMenuBarItem extends UWindowList
00006		config;
00007	
00008	var	string					Caption;
00009	var UWindowMenuBar			Owner;
00010	var UWindowPulldownMenu		Menu;
00011	var float					ItemLeft;
00012	var float					ItemWidth;
00013	var bool					bHelp;
00014	var byte					HotKey;
00015	
00016	function SetHelp(bool b)
00017	{
00018		bHelp = b;
00019	}
00020	
00021	function SetCaption(string C)
00022	{
00023		local string Junk, Junk2;
00024	
00025		Caption = C;
00026		HotKey = Owner.ParseAmpersand(C, Junk, Junk2, False);	
00027	}
00028	
00029	function UWindowPulldownMenu CreateMenu(Class<UWindowPulldownMenu> MenuClass)
00030	{
00031		Menu = UWindowPulldownMenu(Owner.ParentWindow.CreateWindow(MenuClass, 0, 0, 100, 100));
00032		Menu.HideWindow();
00033		Menu.Owner = Self;
00034		return Menu;
00035	}
00036	
00037	function DeSelect()
00038	{
00039		Owner.LookAndFeel.PlayMenuSound(Owner, MS_MenuCloseUp);
00040		Menu.DeSelect();
00041		Menu.HideWindow();
00042	}
00043	
00044	function Select()
00045	{
00046		Owner.LookAndFeel.PlayMenuSound(Owner, MS_MenuPullDown);
00047		Menu.ShowWindow();
00048		Menu.WinLeft = ItemLeft + Owner.WinLeft;
00049		Menu.WinTop = 14;
00050		Menu.WinWidth = 100;
00051		Menu.WinHeight = 100;
00052	}
00053	
00054	
00055	function CloseUp() {
00056		Owner.CloseUp();
00057	}
00058	
00059	function UWindowMenuBar GetMenuBar()
00060	{
00061		return Owner.GetMenuBar();
00062	}
00063	
00064	defaultproperties
00065	{
00066	}

End Source Code