public ToolTip() { // Defaults from MS is_active = true; automatic_delay = 500; autopop_delay = 5000; initial_delay = 500; re_show_delay = 100; show_always = false; back_color = SystemColors.Info; fore_color = SystemColors.InfoText; isBalloon = false; stripAmpersands = false; useAnimation = true; useFading = true; tooltip_strings = new Hashtable(5); controls = new ArrayList(5); tooltip_window = new ToolTipWindow(); tooltip_window.MouseLeave += new EventHandler(control_MouseLeave); tooltip_window.Draw += new DrawToolTipEventHandler(tooltip_window_Draw); tooltip_window.Popup += new PopupEventHandler(tooltip_window_Popup); // UIA Framework: Static event handlers tooltip_window.UnPopup += delegate(object sender, PopupEventArgs args) { OnUnPopup(args); }; UnPopup += new PopupEventHandler(OnUIAUnPopup); timer = new Timer(); timer.Enabled = false; timer.Tick += new EventHandler(timer_Tick); }
public override void MouseMove(float X, float Y) { if (WM.MouseStillSeconds > 0.5f && this.Item != null) { ToolTipWindow tip = new ToolTipWindow(this.WM, this.Item.GetTooltip(), WM.MouseX, WM.MouseY, true); WM.Add(tip); } }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); Invalidate(); ToolTipTimer.Stop(); ToolTipWindow.Hide(this); }
public ToolTipManager(SecondaryTaskbar form) { _mainForm = form; ToolTipWindow = new ToolTipWindow(); ToolTipWindow.OnActivate += new EventHandler <TooltipEventArgs>(toolTipWindow_OnActivate); ToolTipWindow.OnClose += new EventHandler <TooltipEventArgs>(toolTipWindow_OnClose); ToolTipWindow.OnCustomEnter += new EventHandler <TooltipEventArgs>(toolTipWindow_OnMouseEnter); ToolTipWindow.OnCustomLeave += new EventHandler <TooltipEventArgs>(toolTipWindow_OnMouseLeave); }
private void MakeNewItem() { GameObject.Item Item = MakeRandomMat(); Item = MakeRandomEquip(); Item = MakeRandomGem(); List <string> ToolTip = Item.GetTooltip(); this.slot.Item = Item; Console.WriteEx("New item is ^BEGINLINK " + Renderer.ColourToCode(Item.NameColour) + "[" + Item.GetName() + "] ^ENDLINK .^FFFFFF Click name to see more.", new List <Action> { new Action(() => { ToolTipWindow tip = new ToolTipWindow(this.WM, ToolTip, WM.MouseX, WM.MouseY, false); WM.Add(tip); }) }); }
public IEnumerator Init(ToolTipWindow toolTipWindowInfo, Transform scaleFactor) { float newPosition; this.scaleFactor = scaleFactor; switch (toolTipWindowInfo.WhereToSpawn) { case TypeOfSpawn.Top: newPosition = transform.GetComponent <RectTransform>().rect.height / 4f; transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y + newPosition, transform.localPosition.z); GetComponent <RectTransform>().pivot = new Vector2(0.5f, 0); //originalPosition = new Vector3(transform.localPosition.x, newPosition, 0); break; case TypeOfSpawn.Down: newPosition = transform.GetComponent <RectTransform>().rect.height / 4f; transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y - newPosition, transform.localPosition.z); GetComponent <RectTransform>().pivot = new Vector2(0.5f, 1); //originalPosition = new Vector3(transform.localPosition.x, newPosition, 0); break; case TypeOfSpawn.Left: newPosition = transform.GetComponent <RectTransform>().rect.width / 2f; transform.localPosition = new Vector3(transform.localPosition.x - newPosition, transform.localPosition.y, transform.localPosition.z); GetComponent <RectTransform>().pivot = new Vector2(1, 0.5f); //originalPosition = new Vector3(newPosition, transform.localPosition.y, 0); break; case TypeOfSpawn.Right: newPosition = transform.GetComponent <RectTransform>().rect.width / 2f; transform.localPosition = new Vector3(transform.localPosition.x + newPosition, transform.localPosition.y, transform.localPosition.z); GetComponent <RectTransform>().pivot = new Vector2(0, 0.5f); //originalPosition = new Vector3(newPosition, transform.localPosition.y, 0); break; default: break; } transform.GetChild(0).GetComponent <Image>().sprite = toolTipWindowInfo.Image; transform.GetChild(1).GetComponentInChildren <Text>().text = toolTipWindowInfo.ShortDescription; transform.GetChild(2).GetComponentInChildren <Text>().text = toolTipWindowInfo.LongDescription; yield return(new WaitForEndOfFrame()); gameObject.SetActive(true); isInit = true; }
/// <summary> /// Hides the current <see cref="InteractiveToolTip"/>. /// </summary> /// <remarks> /// <para> /// If the <see cref="InteractiveToolTip"/> is not visible, the method just returns. /// </para> /// </remarks> public void Hide() { _durationTimer.Stop(); ToolTipWindow toolTip = _currentToolTip; IWin32Window window; if (null != toolTip) { _currentToolTip = null; window = toolTip.Window; toolTip.Dispose(); if (null != ToolTipHidden) { ToolTipHidden(this, new InteractiveToolTipEventArgs(window)); } } }
/// <summary> /// Sets the ToolTip content associated with the specified control, and displays the <see cref="InteractiveToolTip"/> at the specified relative position. /// </summary> /// <param name="content">The content to be displayed in the <see cref="InteractiveToolTip"/>.</param> /// <param name="window">The <see cref="T:System.Windows.Forms.Control"/> to display the <see cref="InteractiveToolTip"/> for.</param> /// <param name="x">The horizontal offset, in pixels, relative to the upper-left corner of the associated control window, to display the <see cref="InteractiveToolTip"/>.</param> /// <param name="y">The vertical offset, in pixels, relative to the upper-left corner of the associated control window, to display the <see cref="InteractiveToolTip"/>.</param> /// <param name="stemPosition">The desired position for the stem of the balloon.</param> /// <param name="duration">The time in milliseconds for which the <see cref="InteractiveToolTip"/> should be displayed, or zero for indefinite display.</param> /// <remarks> /// <para> /// The <see cref="InteractiveToolTip"/> is displayed until either one of the <b>Show</b> methods is called to display another <see cref="InteractiveToolTip"/>, /// or <see cref="Hide"/> is called, or the specified <paramref name="duration"/> is exceeded. It will be drawn with the stem positioned at the specified part /// of the balloon, tip located at the specified position relative to the top-left corner of <paramref name="window"/>. If there is insufficient space on the /// display for this, the stem and balloon may be repositioned to accomodate this. /// </para> /// <para> /// If the mouse is moved over the <see cref="InteractiveToolTip"/>, the duration timer will be halted. It will resume - with its original value - when the mouse /// leaves the <see cref="InteractiveToolTip"/> again. /// </para> /// </remarks> public void Show(Control content, IWin32Window window, int x, int y, StemPosition stemPosition, int duration) { if (null == content || null == window) { throw new ArgumentNullException(); } Hide(); _currentToolTip = new ToolTipWindow(content, window, x, y, stemPosition, UseAnimation, UseFading); if (duration > 0) { _currentToolTip.MouseEnter += delegate(object sender, EventArgs e) { _durationTimer.Stop(); }; _currentToolTip.MouseLeave += delegate(object sender, EventArgs e) { if (duration > 0) { _durationTimer.Start(); } }; _currentToolTip.MouseDown += delegate(object sender, EventArgs e) { if (duration > 0) { duration = 1; } _durationTimer.Start(); }; _durationTimer.Interval = duration; _durationTimer.Start(); } if (null != ToolTipShown) { ToolTipShown(this, new InteractiveToolTipEventArgs(window)); } }
void nsITooltipListener.OnShowTooltip(int aXCoords, int aYCoords, string aTipText) { ToolTip = new ToolTipWindow(); ToolTip.Location = PointToScreen(new Point(aXCoords, aYCoords)) + new Size(0, 24); ToolTip.Text = aTipText; ToolTip.Show(); }
public ToolTip() { // Defaults from MS is_active = true; automatic_delay = 500; autopop_delay = 5000; initial_delay = 500; re_show_delay = 100; show_always = false; back_color = SystemColors.Info; fore_color = SystemColors.InfoText; isBalloon = false; stripAmpersands = false; useAnimation = true; useFading = true; tooltip_strings = new Hashtable(5); controls = new ArrayList(5); tooltip_window = new ToolTipWindow(); tooltip_window.MouseLeave += new EventHandler(control_MouseLeave); tooltip_window.Draw += new DrawToolTipEventHandler (tooltip_window_Draw); tooltip_window.Popup += new PopupEventHandler (tooltip_window_Popup); // UIA Framework: Static event handlers tooltip_window.UnPopup += delegate (object sender, PopupEventArgs args) { OnUnPopup (args); }; UnPopup += new PopupEventHandler (OnUIAUnPopup); timer = new Timer(); timer.Enabled = false; timer.Tick +=new EventHandler(timer_Tick); }
private void MouseLeftPanel(StatusBarPanel item) { ToolTipTimer.Stop(); ToolTipWindow.Hide(this); tooltip_currently_showing = null; }
void nsITooltipListener.OnHideTooltip() { if (ToolTip != null) { ToolTip.Hide(this); ToolTip.Dispose(); ToolTip = null; } }
void nsITooltipListener.OnShowTooltip(int aXCoords, int aYCoords, string aTipText) { if (true.Equals(GeckoPreferences.User["browser.chrome.toolbar_tips"])) { ToolTip = new ToolTipWindow(); ToolTip.Show(aTipText, this, new Point(aXCoords, aYCoords + 24)); } }
private void OKButton_Clicked(object sender, EventArgs e) { GameObject.Item Item; Item = GameObject.Items.Material.MaterialTemplates.GetRandomMaterial(); Item.SubType = GameObject.RNG.Next(GameObject.Items.Material.MaterialType.Max); Item.Description = "A " + GameObject.Items.Material.MaterialType.GetTypeName(Item.SubType) + " made from " + Item.Name + ". Used in crafting equipment."; this.OKButton.Title = Item.GetName(); this.slot.Item = Item; ItemEquip eq = new ItemEquip(); BonusPool p = BonusPool.Load("heavy_0_10"); eq.Bonuses.Add(p.PickBonus()); eq.Bonuses.Add(p.PickBonus()); Enchantment enc = new Enchantment(); int enctype = GameObject.RNG.Next(0, 3); switch (enctype) { case 0: { enc = new Enchantment() { Effecttext = "Fire damage +{0}%", Type = "dmg_scale_fire" }; enc.LineColour = new Color(255, 50, 30); enc.Multiplier = 0.15f; break; } case 1: { enc = new Enchantment() { Effecttext = "Water resistance +{0}%", Type = "element_multiplier_water" }; enc.LineColour = new Color(0, 50, 200); enc.Multiplier = 0.05f; break; } case 2: { enc = new Enchantment() { Effecttext = "Reduces poisoning duration by +{0}%", Type = "element_dot_time_poison" }; enc.LineColour = new Color(0, 150, 20); enc.Multiplier = 0.33f; break; } } eq.Enchant = enc; eq.SubType = GameObject.RNG.Next(0, 10); if (eq.SubType == 7) { eq.SubType = 18; } if (eq.SubType == 8) { eq.SubType = 27; } if (eq.SubType == 9) { eq.SubType = 15; } eq.PrimaryMaterial = Material.MaterialTemplates.GetRandomMaterial(); eq.SecondaryMaterial = Material.MaterialTemplates.GetRandomMaterial(); List <string> ToolTip = eq.GetTooltip(); this.slot.Item = eq; Console.WriteEx("New item is ^BEGINLINK " + Renderer.ColourToCode(eq.NameColour) + "[" + eq.GetName() + "] ^ENDLINK .^FFFFFF Click name to see more.", new List <Action> { new Action(() => { ToolTipWindow tip = new ToolTipWindow(this.WM, ToolTip, WM.MouseX, WM.MouseY, false); WM.Add(tip); }) }); //this.Player.EquipItem(eq); this.Title = this.Player.CalculateStat("HP").ToString(); }