private static RibbonToolTip GetToolTip([NotNull] IRibbonElement element) { return(new RibbonToolTip { Title = element.Name, Content = element.Description, IsHelpEnabled = false, Image = element.LargeImage }); }
/// <summary> /// Constructor to create instance of RibbonToolTip. /// </summary> public RibbonToolTip(IRibbonElement ribbonElement) { try { this._RibbonElement = ribbonElement; this.OwnerDraw = true; this.AutoSize = false; base.Popup += new PopupEventHandler(ToolTip_Popup); this.Draw += new DrawToolTipEventHandler(ToolTip_Draw); } catch (Exception ex) { string logMessage = "Exception in RibbonToolTip.RibbonToolTip() " + ex.ToString(); Trace.TraceError(logMessage); throw; } }
/// <summary> /// Constructor to create instance of RibbonToolTip. /// </summary> public RibbonToolTip(IRibbonElement ribbonElement) { try { _RibbonElement = ribbonElement; OwnerDraw = true; AutoSize = false; base.Popup += ToolTip_Popup; Draw += ToolTip_Draw; } catch (Exception ex) { var logMessage = "Exception in RibbonToolTip.RibbonToolTip() " + ex; Trace.TraceError(logMessage); throw; } }
private static RibbonButton CreateButton([NotNull] IRibbonElement element) { var button = new RibbonButton { CommandHandler = element.Command, Text = element.Name, // Текст рядом с кнопкой, если ShowText = true Name = element.Name, // Тест на всплявающем окошке (заголовов) Description = element.Description, // Описание на всплывающем окошке LargeImage = ResizeImage(element.LargeImage as BitmapSource, 32), Image = ResizeImage(element.Image as BitmapSource, 16), ToolTip = GetToolTip(element), IsToolTipEnabled = true, ShowImage = element.LargeImage != null || element.Image != null, ShowText = false, Size = RibbonItemSize.Large }; return(button); }
public RibbonElementPopupEventArgs(IRibbonElement item, PopupEventArgs args) : base(args.AssociatedWindow, args.AssociatedControl, args.IsBalloon, args.ToolTipSize) { this._ribbonElement = item; this._args = args; }
public RibbonElementPopupEventArgs(IRibbonElement item) : base(item.Owner, item.Owner, false, new Size(-1, -1)) { _ribbonElement = item; }
public RibbonElementPopupEventArgs(IRibbonElement item, PopupEventArgs args) : base(args.AssociatedWindow, args.AssociatedControl, args.IsBalloon, args.ToolTipSize) { _ribbonElement = item; _args = args; }