// Create a popup window and show it or only show it if it is already created
void ShowSubPopup(Menu menu, MenuItem item)
{
if (item.Enabled == false)
{
return;
}
if (!popdown_menu || !item.VisibleItems)
{
item.PerformPopup();
}
if (item.VisibleItems == false)
{
return;
}
if (item.Wnd != null)
{
item.Wnd.Dispose();
}
popup_active = true;
PopUpWindow puw = new PopUpWindow(GrabControl, item);
Point pnt;
if (menu is MainMenu)
{
pnt = new Point(item.X, item.Y + item.Height - 2 - menu.Height);
}
else
{
pnt = new Point(item.X + item.Width - 3, item.Y - 3);
}
pnt = menu.Wnd.PointToScreen(pnt);
puw.Location = pnt;
item.Wnd = puw;
puw.ShowWindow();
if (menu.Tracker.ShowSubPopupEvent != null)
{
menu.Tracker.ShowSubPopupEvent(this, new SubPopupEventArgs(item));
}
}