void mouseIdle_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (CustomTooltipDisabled) { return; } // Setup the super tooltip. tooltip.SetSuperTooltip(this, null); if (currentNode == null) { return; } if (currentNode.InfoEntries.Length < 1) { return; } SuperTooltipInfo info = currentNode.InfoEntries[0].NodeType.GetTooltip(currentNode.InfoEntries[0]); if (info != null) { UseInternalTooltips = false; // Set and display the tooltip. tooltip.SetSuperTooltip(this, info); tooltip.ShowTooltip(this, MousePosition); } }
public ButtonItem CreateMenuItem(MultiSourceTreeNode node, SuperTooltip tooltip) { this.node = node; menuItem = new ButtonItem(); menuItem.Text = Text; menuItem.BeginGroup = BeginGroup; menuItem.Image = Icon; // Generate the tooltip text and setup the SuperTooltip link. string tooltipText = ""; if (dynamicTooltipCallback != null) { tooltipText = dynamicTooltipCallback.Invoke(node, node.InfoEntries[0]); } else if (toolTipText != "") { tooltipText = toolTipText; } if (!String.IsNullOrEmpty(tooltipText)) { tooltip.SetSuperTooltip(menuItem, new SuperTooltipInfo(menuItem.Text.Replace("&", ""), "", tooltipText, null, null, eTooltipColor.System, true, false, new Size(1, 1))); } menuItem.Click += new EventHandler(MenuClickHandler); return(menuItem); }
private void listErrors_ItemMouseHover(object sender, ListViewItemMouseHoverEventArgs e) { string footer = ""; if (e.Item.SubItems.Count > 2) { footer = string.Format("Line {0}, column {1}", e.Item.SubItems[2].Text, e.Item.SubItems[3].Text); } var sti = new SuperTooltipInfo(e.Item.Text, footer, e.Item.SubItems[1].Text, imageList32.Images[2], null, eTooltipColor.Office2003); SuperTooltipErrors.SetSuperTooltip(listErrors, sti); SuperTooltipErrors.ShowTooltip(listErrors, new Point(Cursor.Position.X + 5, Cursor.Position.Y + 15)); }
public static ButtonItem CreateButton([NotNull] this RibbonBar bar, [NotNull] IActionDefinition actionDefinition, [NotNull] SuperTooltip tooltip) { ButtonItem result = null; string key = $"{actionDefinition.Id:N}_{actionDefinition.Name}"; if (!bar.Items.Contains(key)) { result = new ButtonItem { ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText, ImagePosition = DevComponents.DotNetBar.eImagePosition.Top, SubItemsExpandWidth = 14, Name = key, Text = actionDefinition.Label, Image = actionDefinition.Icon, ImageSmall = actionDefinition.SmallIcon, ImageFixedSize = new Size(32, 32), Enabled = actionDefinition.Enabled, Tag = actionDefinition }; if (actionDefinition.Shortcut != Shortcut.None) { result.Shortcuts.Add((eShortcut)actionDefinition.Shortcut); } if (actionDefinition.Shortcut != Shortcut.None || !string.IsNullOrWhiteSpace(actionDefinition.Tooltip)) { string header; if (actionDefinition.Shortcut != Shortcut.None) { header = $"{actionDefinition.Label} ({GetShortcutString(actionDefinition.Shortcut)})"; } else { header = $"{actionDefinition.Label}"; } tooltip.SetSuperTooltip(result, new SuperTooltipInfo(header, null, actionDefinition.Tooltip, null, null, eTooltipColor.Gray)); } } return(result); }
public void PopulateFunctionList() { try { superTooltip1 = new SuperTooltip(); superTooltip1.BeforeTooltipDisplay += superTooltip1_BeforeTooltipDisplay; List<string> specialFunctions = Project.Instance.InternalFunctionNames; treeFunctions.BeginUpdate(); treeFunctions.Nodes.Clear(); foreach (string category in Project.Instance.FunctionCategories) { RemoveTabsOfDeletedFunctions(); var categoryNode = new Node(); categoryNode.Text = " " + (string.IsNullOrEmpty(category) ? "General" : category); bool categoryAdded = false; foreach (FunctionInfo function in Project.Instance.Functions) { if (function.Category != category || specialFunctions.BinarySearch(function.Name) >= 0) { continue; } if (function.IsExtensionMethod) continue; if (!categoryAdded) { categoryNode.Style = treeFunctions.Styles["elementStyleGroup"]; treeFunctions.Nodes.Add(categoryNode); categoryAdded = true; } var functionNode = new Node { Text = function.Name, Tag = function }; if (!function.IsTemplateFunction) { functionNode.Image = imageListFunctions.Images[0]; } else { switch (SyntaxEditorHelper.LanguageEnumFromName(function.TemplateReturnLanguage)) { case TemplateContentLanguage.CSharp: functionNode.Image = imageListFunctions.Images[3]; break; case TemplateContentLanguage.VbDotNet: functionNode.Image = imageListFunctions.Images[5]; break; case TemplateContentLanguage.Sql: functionNode.Image = imageListFunctions.Images[0]; break; case TemplateContentLanguage.Html: functionNode.Image = imageListFunctions.Images[4]; break; case TemplateContentLanguage.Css: functionNode.Image = imageListFunctions.Images[2]; break; case TemplateContentLanguage.IniFile: functionNode.Image = imageListFunctions.Images[0]; break; case TemplateContentLanguage.JScript: functionNode.Image = imageListFunctions.Images[0]; break; case TemplateContentLanguage.Python: functionNode.Image = imageListFunctions.Images[0]; break; case TemplateContentLanguage.VbScript: functionNode.Image = imageListFunctions.Images[5]; break; case TemplateContentLanguage.Xml: functionNode.Image = imageListFunctions.Images[6]; break; case TemplateContentLanguage.PlainText: functionNode.Image = imageListFunctions.Images[0]; break; default: functionNode.Image = imageListFunctions.Images[0]; //throw new Exception("This function return type not handled yet in CreateDirectiveXmlToCSharpLanguage: " + function.ReturnType); break; } } //toolTipForNavBar.SetToolTip(functionNode, string.Format("({1}) {0}", function.Name, function.ReturnType)); var sti = new SuperTooltipInfo(function.Name, "", function.Description, functionNode.Image, null, eTooltipColor.Office2003); superTooltip1.SetSuperTooltip(functionNode, sti); categoryNode.Nodes.Add(functionNode); } } foreach (Node node in treeFunctions.Nodes) { node.ExpandAll(); node.Expand(); } } finally { treeFunctions.EndUpdate(); } }
private void SetTooltip(IComponent labelPropertyName, string header, string description) { superTooltip1.SetSuperTooltip(labelPropertyName, new SuperTooltipInfo(header, "", description, null, null, eTooltipColor.System)); }