示例#1
0
        public void ShowTooltip(string text, int x, int y, int altY)
        {
            if (tooltipWindow != null)
            {
                tooltipWindow.Hide();
            }
            else
            {
                tooltipWindow = new CustomTooltipWindow();
                tooltipWindow.TransientFor      = this;
                tooltipWindow.DestroyWithParent = true;
            }
            tooltipWindow.Tooltip = text;
            int ox, oy;

            this.GdkWindow.GetOrigin(out ox, out oy);
            int w = tooltipWindow.Child.SizeRequest().Width;
            int h = tooltipWindow.Child.SizeRequest().Height;

            Gdk.Rectangle geometry = Screen.GetMonitorGeometry(Screen.GetMonitorAtWindow(this.GdkWindow));

            if (ox + x + w + tooltipXOffset >= geometry.Right ||
                oy + y + h >= geometry.Bottom)
            {
                tooltipWindow.Move(ox + x - w, oy + altY - h);
            }
            else
            {
                tooltipWindow.Move(ox + x + tooltipXOffset, oy + y);
            }
            tooltipWindow.ShowAll();
        }
示例#2
0
 public void HideTooltipWindow()
 {
     if (tooltipWindow != null)
     {
         tooltipWindow.Destroy();
         tooltipWindow = null;
     }
 }
示例#3
0
        bool ShowTooltip()
        {
            HideTooltipWindow();
            tooltipWindow              = new CustomTooltipWindow();
            tooltipWindow.Tooltip      = tipItem.Tooltip;
            tooltipWindow.ParentWindow = this.GdkWindow;
            int ox, oy;

            this.GdkWindow.GetOrigin(out ox, out oy);
            tooltipWindow.Move(Math.Max(0, ox + tipX), oy + tipY);
            tooltipWindow.ShowAll();
            return(false);
        }
示例#4
0
 public void HideTooltipWindow()
 {
     if (tipTimeoutId != 0)
     {
         GLib.Source.Remove(tipTimeoutId);
         tipTimeoutId = 0;
     }
     if (tooltipWindow != null)
     {
         tooltipWindow.Destroy();
         tooltipWindow = null;
     }
 }
		public void ShowTooltip (string text, int x, int y, int altY)
		{
			if (tooltipWindow != null) {
				tooltipWindow.Hide ();
			} else {
				tooltipWindow = new CustomTooltipWindow ();
				tooltipWindow.TransientFor = this;
				tooltipWindow.DestroyWithParent = true;
			}
			tooltipWindow.Tooltip = text;
			int ox, oy;
			this.GdkWindow.GetOrigin (out ox, out oy);
			int w = tooltipWindow.Child.SizeRequest().Width;
			int h = tooltipWindow.Child.SizeRequest().Height;
			
			Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtWindow (this.GdkWindow));
			
			if (ox + x + w + tooltipXOffset >= geometry.Right ||
			    oy + y + h >= geometry.Bottom) {
				tooltipWindow.Move (ox + x - w, oy + altY - h);
			} else 
				tooltipWindow.Move (ox + x + tooltipXOffset, oy + y);
			tooltipWindow.ShowAll ();
		}
		public void HideTooltipWindow ()
		{
			if (tooltipWindow != null) {
				tooltipWindow.Destroy ();
				tooltipWindow = null;
			}
		}