当前位置: 首页>>代码示例>>C#>>正文


C# MonoTextEditor.LocationToPoint方法代码示例

本文整理汇总了C#中MonoTextEditor.LocationToPoint方法的典型用法代码示例。如果您正苦于以下问题:C# MonoTextEditor.LocationToPoint方法的具体用法?C# MonoTextEditor.LocationToPoint怎么用?C# MonoTextEditor.LocationToPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoTextEditor的用法示例。


在下文中一共展示了MonoTextEditor.LocationToPoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetDiffRectangles

		public static ICollection<Cairo.Rectangle> GetDiffRectangles (MonoTextEditor editor, int startOffset, int endOffset)
		{
			ICollection<Cairo.Rectangle> rectangles = new List<Cairo.Rectangle> ();
			var startLine = editor.GetLineByOffset (startOffset);
			var endLine = editor.GetLineByOffset (endOffset);
			int lineCount = endLine.LineNumber - startLine.LineNumber;
			var line = startLine;
			for (int i = 0; i <= lineCount; i++) {
				Cairo.Point point = editor.LocationToPoint (editor.Document.OffsetToLocation (Math.Max (startOffset, line.Offset)), true);
				Cairo.Point point2 = editor.LocationToPoint (editor.Document.OffsetToLocation (Math.Min (line.EndOffset, endOffset)), true);
				rectangles.Add (new Cairo.Rectangle (point.X - editor.TextViewMargin.XOffset, point.Y, point2.X - point.X, editor.LineHeight));
				line = line.NextLine;
			}
			return rectangles;
		}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:15,代码来源:EditorCompareWidgetBase.cs

示例2: DrawBackground

 public override void DrawBackground(MonoTextEditor editor, Context cr, LineMetrics metrics, int startOffset, int endOffset)
 {
     int x1 = editor.LocationToPoint(editor.OffsetToLocation(this.Offset), false).X;
     int x2 = editor.LocationToPoint(editor.OffsetToLocation(this.Offset + this.Length), false).X;
     cr.Rectangle(x1, metrics.LineYRenderStartPosition + 0.5, x2 - x1, metrics.LineHeight - 1);
     cr.SetSourceRGB(1.0, 1.0, 0.0);
     cr.Fill();
 }
开发者ID:hut104,项目名称:ApsimX,代码行数:8,代码来源:FindAndReplaceForm.cs

示例3: ShowPopup

		void ShowPopup (MonoTextEditor editor, EventButton evt)
		{
			CommandEntrySet cset = IdeApp.CommandService.CreateCommandEntrySet ("/MonoDevelop/VersionControl/DiffView/ContextMenu");
			Gtk.Menu menu = IdeApp.CommandService.CreateMenu (cset);
			menu.Destroyed += delegate {
				this.QueueDraw ();
			};
			
			if (evt != null) {
				GtkWorkarounds.ShowContextMenu (menu, this, evt);
			} else {
				var pt = editor.LocationToPoint (editor.Caret.Location);
				GtkWorkarounds.ShowContextMenu (menu, editor, new Gdk.Rectangle (pt.X, pt.Y, 1, (int)editor.LineHeight));
			}
		}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:15,代码来源:EditorCompareWidgetBase.cs


注:本文中的MonoTextEditor.LocationToPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。