コード例 #1
0
        public override Gtk.Window ShowTooltipWindow(TextEditor editor, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
        {
            var location   = editor.OffsetToLocation(item.ItemSegment.Offset);
            var point      = editor.LocationToPoint(location);
            int lineHeight = (int)editor.LineHeight;
            int y          = point.Y;

            // find the top of the line that the mouse is hovering over
            while (y + lineHeight < mouseY)
            {
                y += lineHeight;
            }

            var caret = new Gdk.Rectangle(mouseX, y, 1, lineHeight);

            tooltip = new DebugValueWindow(editor, offset, DebuggingService.CurrentFrame, (ObjectValue)item.Item, null);
            tooltip.ShowPopup(editor, caret, PopupPosition.TopLeft);

            return(tooltip);
        }
コード例 #2
0
		public override Gtk.Window ShowTooltipWindow (TextEditor editor, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
		{
			var location = editor.OffsetToLocation (item.ItemSegment.Offset);
			var point = editor.LocationToPoint (location);
			int lineHeight = (int) editor.LineHeight;
			int y = (int) point.Y;

			// find the top of the line that the mouse is hovering over
			while (y + lineHeight < mouseY)
				y += lineHeight;

			var caret = new Gdk.Rectangle (mouseX - editor.Allocation.X, y - editor.Allocation.Y, 1, lineHeight);

			tooltip = new DebugValueWindow (editor, offset, DebuggingService.CurrentFrame, (ObjectValue) item.Item, null);
			tooltip.ShowPopup (editor, caret, PopupPosition.TopLeft);

			return tooltip;
		}