internal void SetHelpTooltip(SuperTooltip superTooltip) { string description = GetDescriptionAttributeValue(); if (string.IsNullOrEmpty(description)) superTooltip.SetSuperTooltip(this, null); else { SuperTooltipInfo info = new SuperTooltipInfo(this.Text, "", description, null, null, eTooltipColor.System, true, false, Size.Empty); superTooltip.SetSuperTooltip(this, info); } }
private void EraseErrorTooltip(SuperTooltip tooltip) { tooltip.HideTooltip(); tooltip.SetSuperTooltip(this, null); _ErrorTooltipAttached = false; }
private void AttachErrorTooltip(SuperTooltip tooltip, Exception valueException, object value) { SuperTooltipInfo info = new SuperTooltipInfo(); info.HeaderText = this.Text; string s = GetErrorString(); bool showTooltip = false; if (valueException is InvalidPropertyValueException && !string.IsNullOrEmpty(valueException.Message)) { s = valueException.Message; showTooltip = true; } else if (valueException != null) { if (!s.EndsWith(" ")) s += " "; s += valueException.Message; } info.BodyText = s; AdvPropertyGrid grid = AdvPropertyGrid; if (grid != null) { grid.InvokePrepareErrorSuperTooltip(info, GetPropertyName(), valueException, value); } tooltip.SetSuperTooltip(this, info); if (showTooltip) { // Show tooltip below the node Rectangle r = this.Cells[0].Bounds; AdvTree.AdvTree tree = this.TreeControl; if (tree != null) r.Location = tree.PointToScreen(r.Location); tooltip.ShowTooltip(this, new Point(r.Right - 18, r.Bottom)); } _ErrorTooltipAttached = true; }
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(); } }
public void ClearToolTip(SuperTooltip tip) { tip.SetSuperTooltip(tCODE,null); tip.SetSuperTooltip(tLIST, null); }
public void SetToolTip(SuperTooltip tip) { tip.SetSuperTooltip(tCODE, new SuperTooltipInfo("", "", "Dữ liệu bắt buộc", null, null, eTooltipColor.Lemon, false, false, new Size(0, 0))); tip.SetSuperTooltip(tLIST, new SuperTooltipInfo("", "", "Dữ liệu bắt buộc", null, null, eTooltipColor.Lemon, false, false, new Size(0, 0))); }