public new void SetToolTip(Control control, string description) { if (ToolTipControls.ContainsKey(control)) { ToolTipControls[control].Title = string.Empty; ToolTipControls[control].Description = description; } else { var ctrl = new ToolTipControl { Control = control, Title = string.Empty, Description = description }; ToolTipControls.TryAdd(control, ctrl); } if (control is IToolTip toolTip) { SetToolTip(toolTip.ExToolTipControl(), description); } base.SetToolTip(control, description); }
public void SetToolTip(Control control, string description, string title, int symbol, int symbolSize, Color symbolColor) { if (title == null) { title = string.Empty; } if (ToolTipControls.ContainsKey(control)) { ToolTipControls[control].Title = title; ToolTipControls[control].Description = description; ToolTipControls[control].Symbol = symbol; ToolTipControls[control].SymbolSize = symbolSize; ToolTipControls[control].SymbolColor = symbolColor; } else { var ctrl = new ToolTipControl() { Control = control, Title = title, Description = description, Symbol = symbol, SymbolSize = symbolSize, SymbolColor = symbolColor }; ToolTipControls.TryAdd(control, ctrl); } base.SetToolTip(control, description); }
public void SetToolTip(Control control, string caption, string title) { if (title == null) { title = string.Empty; } if (ToolTipControls.ContainsKey(control)) { ToolTipControls[control].Title = title; ToolTipControls[control].ToolTipText = caption; } else { var ctrl = new ToolTipControl() { Control = control, Title = title, ToolTipText = caption }; ToolTipControls.TryAdd(control, ctrl); } if (control is IToolTip toolTip) { SetToolTip(toolTip.ExToolTipControl(), caption, title); } base.SetToolTip(control, caption); }
public void SetToolTip(Control control, string description, string title) { if (title == null) { title = string.Empty; } if (ToolTipControls.ContainsKey(control)) { ToolTipControls[control].Title = title; ToolTipControls[control].Description = description; } else { var ctrl = new ToolTipControl() { Control = control, Title = title, Description = description }; ToolTipControls.TryAdd(control, ctrl); } base.SetToolTip(control, description); }
public Hierarchy_AreaItemControl(Hierarchy_AreaItemWrapper wrapper, BitmapImage icon) : base(wrapper, icon) { PropertyInfo prop = null; // Текст подсказки StringBuilder sb = new StringBuilder(); sb.AppendLine(String.Format(Localization.Tooltip_Hierarchy, wrapper.Caption)); prop = wrapper.GetCustomProperty(InfoBase.DIMENSION_CAPTION); if (prop != null) { sb.AppendLine(String.Format(Localization.Tooltip_Dimension, prop.Value)); } prop = wrapper.GetCustomProperty(InfoBase.CUBE_CAPTION); if (prop != null) { sb.AppendLine(String.Format(Localization.Tooltip_Cube, prop.Value)); } String str = sb.ToString(); str = str.TrimEnd('\n'); str.TrimEnd('\r'); // Подсказка ToolTipControl m_ToolTip = new ToolTipControl(); m_ToolTip.Caption = wrapper.Caption; m_ToolTip.Text = str; ToolTipService.SetToolTip(this, m_ToolTip); }
void Start() { instance = this; backgroundRectTransform = transform.Find("Background").GetComponent <RectTransform>(); toolTipText = backgroundRectTransform.Find("Text").GetComponent <Text>(); HideToolTip(); // ShowToolTip("Random Text on"); }
public static void ConfigureTooltip(ToolTipControl toolTip) { toolTip.IsBalloon = true; toolTip.AutoPopDelay = 30000; toolTip.InitialDelay = 1000; toolTip.ReshowDelay = 0; toolTip.Title = "Details"; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenToolTip"/> class. /// </summary> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenToolTipLayoutManager"/></para> /// <para><see cref="INuGenToolTipRenderer"/></para> /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para> /// </exception> public NuGenToolTip(INuGenServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _serviceProvider = serviceProvider; _components = new Container(); _tooltip = new ToolTipControl(serviceProvider); _components.Add(_tooltip); _autoPopDelayTimer = new Timer(_components); _autoPopDelayTimer.Interval = this.AutoPopDelay; _autoPopDelayTimer.Tick += _autoPopDelayTimer_Tick; }
public void SetToolTip(Control control, string caption, string title, int symbol, int symbolSize, Color symbolColor) { if (title == null) { title = string.Empty; } if (ToolTipControls.ContainsKey(control)) { ToolTipControls[control].Title = title; ToolTipControls[control].ToolTipText = caption; ToolTipControls[control].Symbol = symbol; ToolTipControls[control].SymbolSize = symbolSize; ToolTipControls[control].SymbolColor = symbolColor; } else { var ctrl = new ToolTipControl() { Control = control, Title = title, ToolTipText = caption, Symbol = symbol, SymbolSize = symbolSize, SymbolColor = symbolColor }; ToolTipControls.TryAdd(control, ctrl); } if (control is IToolTip toolTip) { SetToolTip(toolTip.ExToolTipControl(), caption, title, symbol, symbolSize, symbolColor); } base.SetToolTip(control, caption); }
public ToolTipForm() { this.DoubleBuffered = true; this.synchronizationContext = SynchronizationContext.Current; this.DropShadowEnabled = false; //是否绘制边框阴影 this.BackColor = Color.Transparent; this.control = new ToolTipControl() { Width = 200, Height = 200 }; DUIControl dc = new DUIControl() { Dock = DockStyle.Fill }; this.control.DUIControls.Add(dc); mControlHost = new ToolStripControlHost(this.control); mControlHost.Padding = Padding.Empty; mControlHost.Margin = Padding.Empty; //mControlHost.AutoSize = false; this.Padding = Padding.Empty; this.Items.Add(mControlHost); dc.Paint += (s, e) => { e.Graphics.DrawImageDc(this.backImageDc, 0, 0); e.Graphics.FillRectangle(DUIBrushes.Blue, new RectangleF(60, 60, 60, 60)); }; this.control.Paint += (s, e) => { //IntPtr hDC = e.Graphics.GetHdc(); //NativeMethods.BitBlt(hDC, 0, 0, this.Width, this.Height, backImageDc.Hdc, 0, 0, 0xCC0020); //e.Graphics.ReleaseHdc(hDC); //using (SolidBrush sb = new SolidBrush(Color.FromArgb(60, Color.Red))) //{ // e.Graphics.FillRectangle(sb, new Rectangle(0, 0, this.Width, this.Height)); //} }; }
public void PointerExit() { ToolTipControl.HideToolTip_Static(); }
/// <summary> /// Shows a tool tip. /// </summary> /// <param name="toolTip">The tool tip.</param> /// <param name="mousePosition">The mouse position.</param> public void ShowToolTip(object toolTip, Vector2F mousePosition) { if (toolTip == null) { return; } UIControl content = null; if (CreateToolTipContent != null) { content = CreateToolTipContent(toolTip); } if (content == null) { var control = toolTip as UIControl; if (control != null) { content = control; } else { content = new TextBlock { Style = "ToolTipText", Text = toolTip.ToString() } }; } ToolTipControl.Content = content; ToolTipControl.IsVisible = true; // If this is the first time, we have to add the control to the screen. // Otherwise, we make sure that the tool tip is on top. if (ToolTipControl.VisualParent == null) { Screen.Children.Add(ToolTipControl); } else { Screen.BringToFront(ToolTipControl); } // Determine position next to mouse. Position it so that it fits onto the screen. ToolTipControl.Measure(new Vector2F(float.PositiveInfinity)); float x = mousePosition.X; if (x + ToolTipControl.DesiredWidth > Screen.ActualWidth) { // Draw the tool tip on the left. x = x - ToolTipControl.DesiredWidth; } float y = mousePosition.Y + ToolTipOffset; if (y + ToolTipControl.DesiredHeight > Screen.ActualHeight) { // Draw the tool tip on top. // (We use 0.5 * offset if tool tip is above cursor. This assumes that the cursor is // similar to the typical arrow where the hot spot is at the top. If the cursor is a // different shape we might need to adjust the offset.) y = y - ToolTipControl.DesiredHeight - 1.5f * ToolTipOffset; } ToolTipControl.X = x; ToolTipControl.Y = y; }
public void PointerEnterSpeedSlider() { ToolTipControl.ShowToolTip_Static("Speed Slider"); }
public void PointerEnterGoToNextEvent() { ToolTipControl.ShowToolTip_Static("Go To Next Event"); }
public void PointerEnterPause() { ToolTipControl.ShowToolTip_Static("Play/Pause"); }
public void PointerEnterStop() { ToolTipControl.ShowToolTip_Static("Stop"); }
public void PointerEnterForward() { ToolTipControl.ShowToolTip_Static("Forward"); }
public void PointerEnterRewind() { ToolTipControl.ShowToolTip_Static("Rewind"); }
/// <summary> /// Control.OnHandleCreate override /// </summary> /// <param name="e">EventArgs</param> protected override void OnHandleCreated(EventArgs e) { EnsureHeaderContainer(); CalcTextHeight(); CalcItemHeight(true); base.OnHandleCreated(e); if (ShowToolTips) { myTooltip = new ToolTipControl(this); } AttachHeaderContainer(); AfterHandleCreated(); }
private void DestroyTooltipWindow() { if (myTooltip != null) { HideBubble(); myTooltip.DestroyHandle(); myTooltip = null; } }