{
ULONG i;
ULONG Width = 0;
ULONG Height;
ULONGLength;
//// Height is the menu item count plus 2 (top border & bottom border)//
Height = MenuInfo->MenuItemCount + 2;
Height -= 1; // Height is zero-based//// Loop every item//for(i = 0; i < MenuInfo->MenuItemCount; i++)
{
//// Get the string length and make it become the new width if necessary//
Length = (ULONG)strlen(MenuInfo->MenuItemList[i]);
if (Length > Width) Width = Length;
}
//// Allow room for left & right borders, plus 8 spaces on each side//
Width += 18;
//// Check if we're drawing a centered menu//if (UiCenterMenu)
{
//// Calculate the menu box area for a centered menu//MenuInfo->Left = (UiScreenWidth - Width) / 2;
MenuInfo->Top = (((UiScreenHeight - TUI_TITLE_BOX_CHAR_HEIGHT) -
Height) / 2) + TUI_TITLE_BOX_CHAR_HEIGHT;
}
else
{
//// Put the menu in the default left-corner position//MenuInfo->Left = -1;
MenuInfo->Top = 4;
}
//// The other margins are the same//MenuInfo->Right = (MenuInfo->Left) + Width;
MenuInfo->Bottom = (MenuInfo->Top) + Height;
}
Generated on Sun May 27 2012 04:48:32 for ReactOS by
1.7.6.1
ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.