Ejemplo n.º 1
0
        /// <summary>
        /// Opens the menu.
        /// </summary>
        public void OpenMenu()
        {
            if (null == m_Menu)
            {
                return;
            }

            m_Menu.Show();
            m_Menu.BringToFront();

            Point p = LocalPosToCanvas(Point.Zero);

            // Strip menus open downwards
            if (IsOnStrip)
            {
                m_Menu.Position = new Point(p.X, p.Y + ActualHeight - 2);
            }
            // Submenus open sidewards
            else
            {
                m_Menu.Position = new Point(p.X + ActualWidth, p.Y);
            }

            // TODO: Option this.
            // TODO: Make sure on screen, open the other side of the
            // parent if it's better...
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Opens the menu.
        /// </summary>
        public void OpenMenu()
        {
            if (null == m_Menu)
            {
                return;
            }

            m_Menu.IsHidden = false;
            m_Menu.BringToFront();

            Point p = LocalPosToCanvas(Point.Empty);

            // Strip menus open downwards
            if (m_OnStrip)
            {
                m_Menu.SetPosition(p.X, p.Y + Height + 1);
            }
            // Submenus open sidewards
            else
            {
                m_Menu.SetPosition(p.X + Width, p.Y);
            }

            // TODO: Option this.
            // TODO: Make sure on screen, open the other side of the
            // parent if it's better...
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Opens the combo.
        /// </summary>
        public virtual void Open()
        {
            if (null == m_Menu)
            {
                return;
            }

            m_Menu.Parent   = GetCanvas();
            m_Menu.IsHidden = false;
            m_Menu.BringToFront();

            Point p = LocalPosToCanvas(Point.Empty);

            m_Menu.SetBounds(new Rectangle(p.X, p.Y + Height, Width, m_Menu.Height));
        }