コード例 #1
0
		protected override bool OnQueryTooltip (int x, int y, bool keyboard_tooltip, Tooltip tooltip)
		{
			if (TextEditor.HighlightSearchPattern) {
				if (IsOverIndicator (y)) {
					var matches = TextEditor.TextViewMargin.SearchResultMatchCount;
					tooltip.Text = GettextCatalog.GetPluralString ("{0} match", "{0} matches", matches, matches);
					return true;
				}
				return false;
			}

			if (IsOverIndicator (y)) {
				int errors, warnings, hints, suggestions;
				CountTasks (out errors, out warnings, out hints, out suggestions);
				string text = null;
				if (errors == 0 && warnings == 0) {
					text = GettextCatalog.GetString ("No errors or warnings");
				} else if (errors == 0) {
					text = GettextCatalog.GetPluralString ("{0} warning", "{0} warnings", warnings, warnings);
				} else if (warnings == 0) {
					text = GettextCatalog.GetPluralString ("{0} error", "{0} errors", errors, errors);
				} else {
					text = GettextCatalog.GetString ("{0} errors and {1} warnings", errors, warnings);
				}

				if (errors > 0) {
					text += Environment.NewLine + GettextCatalog.GetString ("Click to navigate to the next error");
				} else if (warnings > 0) {
					text += Environment.NewLine + GettextCatalog.GetString ("Click to navigate to the next warning");
				} else if (warnings + hints > 0) {
					text += Environment.NewLine + GettextCatalog.GetString ("Click to navigate to the next message");
				}

				tooltip.Text = text;
				return true;
			}

			var hoverTask = GetHoverTask (y);
			if (hoverTask != null) {
				tooltip.Text = hoverTask.Description;
				return true;
			}

			return false;
		}
コード例 #2
0
ファイル: NodeView.cs プロジェクト: nuxleus/gtk-sharp
 public void SetTooltipCell(Tooltip tooltip, ITreeNode node, TreeViewColumn column, CellRenderer renderer)
 {
     SetTooltipCell (tooltip,  store.GetPath (node),  column,  renderer);
 }
コード例 #3
0
		protected override bool OnQueryTooltip (int x, int y, bool keyboard_tooltip, Tooltip tooltip)
		{
			tooltip.Text = item.Text;
			return true;
		}
コード例 #4
0
 protected override bool OnQueryTooltip(int x, int y, bool keyboard_tooltip, Tooltip tooltip)
 {
     if (tooltipX == x && tooltipY == y){
         if (PolygonAtPointer.Tooltip == null) {
             new Task (() => {
                 Gtk.Application.Invoke((sender,e)=>{
                     if (PolygonAtPointer.Tooltip == null) {
                         this.TooltipText = "(Загрузка)";
                     }
                 });
                 PolygonAtPointer.Tooltip = GetTooltip (PolygonAtPointer);
                 Gtk.Application.Invoke ((sender, e) => {
                     this.TooltipText = PolygonAtPointer.Tooltip;
                 });
             }).Start ();
         }else
             this.TooltipText = PolygonAtPointer.Tooltip;
     }
     tooltipY = y;
     tooltipX = x;
     return base.OnQueryTooltip (x, y, keyboard_tooltip, tooltip);
 }
コード例 #5
0
		protected override bool OnQueryTooltip (int x, int y, bool keyboard_tooltip, Tooltip tooltip)
		{
			var button = VisibleButtons.FirstOrDefault (b => allocations [b].Contains (Allocation.X + (int)x, Allocation.Y + (int)y));
			if (button != null) {
				tooltip.Text = button.Tooltip;
				var rect = allocations [button];
				rect.Offset (-Allocation.X, -Allocation.Y);
				tooltip.TipArea = rect;
				return true;
			} else {
				return false;
			}
		}
コード例 #6
0
 protected override bool OnQueryTooltip(int x, int y, bool keyboard_mode, Tooltip tooltip)
 {
     tooltip.Custom = popup;
     return true;
 }