/// <summary> /// Generate a key tip info for each visible tab. /// </summary> /// <returns>Array of KeyTipInfo instances.</returns> public KeyTipInfo[] GetQATKeyTips() { KeyTipInfoList keyTipList = new KeyTipInfoList(); // Add all the entries for the contents keyTipList.AddRange(_borderContents.GetQATKeyTips(OwnerForm)); // If we have the extra button and it is in overflow appearance if (_extraButton.Overflow) { // If integrated into the caption area then get the caption area height Padding borders = Padding.Empty; if ((OwnerForm != null) && !OwnerForm.ApplyComposition) { borders = OwnerForm.RealWindowBorders; } // Get the screen location of the extra button Rectangle viewRect = _borderContents.ParentControl.RectangleToScreen(_extraButton.ClientRectangle); // The keytip should be centered on the bottom center of the view Point screenPt = new Point(viewRect.Left + (viewRect.Width / 2) - borders.Left, viewRect.Bottom - 2 - borders.Top); // Create fixed key tip of '00' that invokes the extra button contoller keyTipList.Add(new KeyTipInfo(true, "00", screenPt, _extraButton.ClientRectangle, _extraButton.KeyTipTarget)); } return(keyTipList.ToArray()); }
/// <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); } }
/// <summary> /// Gets the array of group level key tips. /// </summary> /// <returns>Array of KeyTipInfo; otherwise null.</returns> public KeyTipInfo[] GetGroupKeyTips() { ViewLayoutRibbonGroups groups = _viewFiller as ViewLayoutRibbonGroups; // If we contain a groups layout if (groups != null) { KeyTipInfoList keyTips = new KeyTipInfoList(); // Grab the list of key tips for all groups keyTips.AddRange(groups.GetGroupKeyTips()); // Remove all those that do not intercept the view rectangle for (int i = 0; i < keyTips.Count; i++) { if (!_viewClipRect.Contains(keyTips[i].ClientRect)) { keyTips[i].Visible = false; } } return(keyTips.ToArray()); } else { return new KeyTipInfo[] { } }; }
/// <summary> /// Gets the array of group level key tips. /// </summary> /// <returns>Array of KeyTipInfo; otherwise null.</returns> public KeyTipInfo[] GetTabKeyTips() { KeyTipInfoList keyTips = new KeyTipInfoList(); // Grab the list of key tips for all tab headers keyTips.AddRange(LayoutTabs.GetTabKeyTips()); // Remove all those that do not intercept the scroll port the tabs are inside Rectangle scrollRect = new Rectangle(Point.Empty, _tabsViewport.ClientSize); for (int i = 0; i < keyTips.Count; i++) { if (!scrollRect.Contains(keyTips[i].ClientRect)) { keyTips[i].Visible = false; } } return keyTips.ToArray(); }
/// <summary> /// Gets the array of group level key tips. /// </summary> /// <returns>Array of KeyTipInfo; otherwise null.</returns> public KeyTipInfo[] GetGroupKeyTips() { ViewLayoutRibbonGroups groups = _viewFiller as ViewLayoutRibbonGroups; // If we contain a groups layout if (groups != null) { KeyTipInfoList keyTips = new KeyTipInfoList(); // Grab the list of key tips for all groups keyTips.AddRange(groups.GetGroupKeyTips()); // Remove all those that do not intercept the view rectangle for (int i = 0; i < keyTips.Count; i++) if (!_viewClipRect.Contains(keyTips[i].ClientRect)) keyTips[i].Visible = false; return keyTips.ToArray(); } else return new KeyTipInfo[] { }; }
/// <summary> /// Generate a key tip info for each visible tab. /// </summary> /// <returns>Array of KeyTipInfo instances.</returns> public KeyTipInfo[] GetQATKeyTips() { KeyTipInfoList keyTipList = new KeyTipInfoList(); // Add all the entries for the contents keyTipList.AddRange(_borderContents.GetQATKeyTips(OwnerForm)); // If we have the extra button and it is in overflow appearance if (_extraButton.Overflow) { // If integrated into the caption area then get the caption area height Padding borders = Padding.Empty; if ((OwnerForm != null) && !OwnerForm.ApplyComposition) borders = OwnerForm.RealWindowBorders; // Get the screen location of the extra button Rectangle viewRect = _borderContents.ParentControl.RectangleToScreen(_extraButton.ClientRectangle); // The keytip should be centered on the bottom center of the view Point screenPt = new Point(viewRect.Left + (viewRect.Width / 2) - borders.Left, viewRect.Bottom - 2 - borders.Top); // Create fixed key tip of '00' that invokes the extra button contoller keyTipList.Add(new KeyTipInfo(true, "00", screenPt, _extraButton.ClientRectangle, _extraButton.KeyTipTarget)); } return keyTipList.ToArray(); }