Пример #1
0
 /// <summary>Adds a new submenu to this menu.</summary>
 /// <param name="menu">PieMenu to add to submenus.</param>
 public void AddSubmenu(PieMenu menu)
 {
     Point newPt = GetNewSubmenuPoint(this);
     menu.Left = newPt.X;
     menu.Top = newPt.Y;
     subMenus.Add(menu);
     subMenus.Last().Show();
 }
Пример #2
0
 public static void AddOptions(ref PieMenu menu)
 {
     // I don't remember what this was supposed to do.
     switch (menu.Name)
     {
         case "apps":
             break;
         case "root":
         default:
             break;
     }
 }
Пример #3
0
 public static void BuildSubmenus(ref PieMenu piemenu)
 {
     switch (piemenu.name)
     {
         case "root":
             piemenu.AddSubmenu(new PieMenu_Apps(piemenu.mainWindow, piemenu));
             break;
         case "apps":
             break; // TODO: Add pies for Apps
         default:
             break;
     }
 }
Пример #4
0
 public static PieMenu BuildPie(PieMenu parent, string _name)
 {
     PieMenu menu = new PieMenu(parent.mainWindow, _name);
     AddOptions(ref menu);
     return menu;
 }
Пример #5
0
 public static PieMenu BuildPie(MainWindow window)
 {
     PieMenu menu = new PieMenu(window, "root");
     AddOptions(ref menu);
     return menu;
 }
Пример #6
0
 public PieMenu_Apps(MainWindow mainWin, PieMenu parent)
     : base(mainWin, "Apps")
 {
     parent = ParentMenu;
 }
Пример #7
0
        /// <summary>Determines where to put a new Submenu.</summary>
        /// <param name="parent">Parent submenu</param>
        /// <returns>Point where a new submenu on the parent would be located</returns>
        protected Point GetNewSubmenuPoint(PieMenu parent)
        {
            Point ptThisMenu = new Point(parent.Width - parent.Left, parent.Height - parent.Top), ptNewMenu = new Point(0, 0);
            int SubmenuCenterDistance = 0;

            for (int iLevel = 1; iLevel < subMenus.Count; iLevel ++)
            {
                ptNewMenu = new Point(Math.Cos(45 * iLevel), Math.Sin(45 * iLevel));
                if (iLevel % 7 == 0)
                    SubmenuCenterDistance += (int)(Width * 1.5D);
            }
            return ptNewMenu;
        }