コード例 #1
0
        /// <summary>
        /// Raises the Click event
        /// </summary>
        /// <param name="e">Event data</param>
        public virtual void OnClick(EventArgs e)
        {
            try
            {
                if (!Enabled)
                {
                    return;
                }

                if (ClosesDropDownAt(Canvas.PointToClient(Cursor.Position)))
                {
                    DeactivateToolTip(_TT);
                    RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.ItemClicked);
                }

                SetSelected(false);

                if (Click != null)
                {
                    Click(this, e);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
ファイル: RibbonItem.cs プロジェクト: tal-athena/RegScoreCalc
        /// <summary>
        /// Raises the MouseDown event
        /// </summary>
        /// <param name="e">Event data</param>
        public virtual void OnMouseDown(MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            if (MouseDown != null)
            {
                MouseDown(this, e);
            }

            RibbonPopup pop = Canvas as RibbonPopup;

            if (pop != null)
            {
                if (ClosesDropDownAt(e.Location))
                {
                    RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.ItemClicked);
                }

                OnClick(EventArgs.Empty);
            }

            SetPressed(true);
        }
コード例 #3
0
ファイル: Ribbon.cs プロジェクト: ogoki/peggle-edit
 private void _keyboardHook_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.EscapePressed);
     }
 }
コード例 #4
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.EscapePressed);
     }
     base.OnKeyDown(e);
 }
コード例 #5
0
ファイル: RibbonButton.cs プロジェクト: rrossenbg/vprint
        /// <summary>
        /// Closes the DropDown if opened
        /// </summary>
        public void CloseDropDown()
        {
            if (DropDown != null)
            {
                RibbonPopupManager.Dismiss(DropDown, RibbonPopupManager.DismissReason.NewPopup);
            }

            SetDropDownVisible(false);
        }
コード例 #6
0
        /// <summary>
        /// Removes all helper controls placed by any reason.
        /// Contol's visibility is set to false before removed.
        /// </summary>
        private void RemoveHelperControls()
        {
            RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.AppClicked);

            while (Controls.Count > 0)
            {
                Control ctl = Controls[0];

                ctl.Visible = false;

                Controls.Remove(ctl);
            }
        }
コード例 #7
0
        /// <summary>
        /// Raises the Click event
        /// </summary>
        /// <param name="e">Event data</param>
        public virtual void OnClick(EventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            if (ClosesDropDownAt(Canvas.PointToClient(Cursor.Position)))
            {
                RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.ItemClicked);
            }

            SetSelected(false);

            if (Click != null)
            {
                Click(this, e);
            }
        }
コード例 #8
0
ファイル: RibbonItem.cs プロジェクト: ShahradR/SOEN343_Ribbon
        /// <summary>
        /// Raises the Click event
        /// </summary>
        /// <param name="e">Event data</param>
        public virtual void OnClick(EventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            if (Click != null)
            {
                Click(this, e);
            }

            RibbonPopup pop = Canvas as RibbonPopup;

            if (pop != null)
            {
                if (ClosesDropDownAt(Cursor.Position))
                {
                    RibbonPopupManager.Dismiss(RibbonPopupManager.DismissReason.ItemClicked);
                }
            }
        }