コード例 #1
0
        private void KeyDownPopupOverflow(VisualPopupQATOverflow c, KeyEventArgs e)
        {
            switch (e.KeyData)
            {
            case Keys.Tab:
            case Keys.Right:
                // Ask the popup to move to the next focus item
                c.SetNextFocusItem();
                break;

            case Keys.Tab | Keys.Shift:
            case Keys.Left:
                // Ask the popup to move to the previous focus item
                c.SetPreviousFocusItem();
                break;

            case Keys.Space:
            case Keys.Enter:
                // Exit keyboard mode when you click the button spec
                Ribbon.KillKeyboardMode();

                // Generate a click event
                OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));
                break;
            }
        }
コード例 #2
0
        /// <summary>
        /// Perform actual selection of the item.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon instance.</param>
        public void KeyTipSelect(KryptonRibbon ribbon)
        {
            // Change to a fixed pressed appearance
            SetFixed();
            UpdateTargetState();

            // Generate a click event
            OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));

            // We should have a visual popup for showing the qat overflow group
            if (VisualPopupManager.Singleton.IsTracking &&
                (VisualPopupManager.Singleton.CurrentPopup is VisualPopupQATOverflow))
            {
                // Cast to correct type
                VisualPopupQATOverflow popupOverflow = (VisualPopupQATOverflow)VisualPopupManager.Singleton.CurrentPopup;

                // Grab the list of key tips from the popup group
                Ribbon.KeyTipMode = KeyTipMode.PopupQATOverflow;
                KeyTipInfoList keyTipList = new KeyTipInfoList();
                keyTipList.AddRange(popupOverflow.ViewQATContents.GetQATKeyTips(null));

                // Update key tips with those appropriate for this tab
                Ribbon.SetKeyTips(keyTipList, KeyTipMode.PopupQATOverflow);
            }
        }
コード例 #3
0
        private void KeyDownRibbon(KeyEventArgs e)
        {
            ViewBase newView = null;

            switch (e.KeyData)
            {
            case Keys.Tab:
            case Keys.Right:
                // Ask the ribbon to get use the next view for the qat
                newView = Ribbon.GetNextQATView(Target, (e.KeyData == Keys.Tab));
                break;

            case Keys.Tab | Keys.Shift:
            case Keys.Left:
                // Ask the ribbon to get use the previous view for the qat
                newView = Ribbon.GetPreviousQATView(Target);
                break;

            case Keys.Down:
            case Keys.Space:
            case Keys.Enter:
                // Change to a fixed pressed appearance
                SetFixed();
                UpdateTargetState();

                // Generate a click event
                OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));

                // Get access to the popup for the group
                if (!VisualPopupManager.Singleton.IsShowingCMS &&
                    (VisualPopupManager.Singleton.CurrentPopup != null) &&
                    (VisualPopupManager.Singleton.CurrentPopup is VisualPopupQATOverflow))
                {
                    // Cast to correct type
                    VisualPopupQATOverflow popupOverflow = (VisualPopupQATOverflow)VisualPopupManager.Singleton.CurrentPopup;
                    popupOverflow.SetFirstFocusItem();
                }
                break;
            }

            // If we have a new view to focus and it is not ourself...
            if ((newView != null) && (newView != Target))
            {
                // If the new view is a tab then select that tab
                if ((newView is ViewDrawRibbonTab) && !Ribbon.RealMinimizedMode)
                {
                    Ribbon.SelectedTab = ((ViewDrawRibbonTab)newView).RibbonTab;
                }

                // Finally we switch focus to new view
                Ribbon.FocusView = newView;
            }
        }
コード例 #4
0
        private void KeyDownPopupOverflow(VisualPopupQATOverflow c, KeyEventArgs e)
        {
            switch (e.KeyData)
            {
            case Keys.Tab:
            case Keys.Right:
                // Ask the popup to move to the next focus item
                c.SetNextFocusItem();
                break;

            case Keys.Tab | Keys.Shift:
            case Keys.Left:
                // Ask the popup to move to the previous focus item
                c.SetPreviousFocusItem();
                break;

            case Keys.Space:
            case Keys.Enter:
                // Change to a fixed pressed appearance
                SetFixed();
                UpdateTargetState();

                // Generate a click event
                OnClick(new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0));

                // Get access to the popup for the group
                if (!VisualPopupManager.Singleton.IsShowingCMS &&
                    (VisualPopupManager.Singleton.CurrentPopup != null) &&
                    (VisualPopupManager.Singleton.CurrentPopup is VisualPopupQATOverflow))
                {
                    // Cast to correct type
                    VisualPopupQATOverflow popupOverflow = (VisualPopupQATOverflow)VisualPopupManager.Singleton.CurrentPopup;
                    popupOverflow.SetFirstFocusItem();
                }
                break;
            }
        }