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

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

            var p = LocalPosToCanvas(new Vector2i(0, 0));

            // 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...
        }
Beispiel #2
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();

            var p = LocalPosToCanvas(new Vector2i(0, 0));

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