示例#1
0
        /// <summary>
        /// Shows popup if there is one, and sets the number of clicks to close
        /// to two.
        /// </summary>
        internal void Select()
        {
            if (!this.isPopUpShown && this.numMenuItems > 0 && this.isEnabled)
            {
                if (PopUpOpen != null)
                {
                    PopUpOpen.Invoke(this);
                }
                this.isPopUpShown = true;
                this.popUpMenu.Populate();

                if (Parent.GetType() == typeof(MenuBar)) // MenuBar parent
                {
                    this.popUpMenu.X = AbsolutePosition.X;
                    this.popUpMenu.Y = AbsolutePosition.Y + Height - 1;
                }
                else // PopUpMenu parent
                {
                    this.popUpMenu.X = Parent.AbsolutePosition.X + Parent.Width - 1;
                    this.popUpMenu.Y = AbsolutePosition.Y;
                }

                GUIManager.SetFocus(this.popUpMenu);
                GUIManager.Add(this.popUpMenu);

                AddHighlight();

                this.numClicks = 0;
            }
            else
            {
                this.popUpMenu.BringToTop();
            }
        }
 public void PlayPopUpOpenAudio()
 {
     PopUpOpen.Play();
 }