• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MonoTextEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ShowTooltipWindow

		public virtual Gtk.Window ShowTooltipWindow (MonoTextEditor editor, Gtk.Window tipWindow, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
		{
			int ox = 0, oy = 0;
			if (editor.GdkWindow != null)
				editor.GdkWindow.GetOrigin (out ox, out oy);
			
			int w;
			double xalign;
			GetRequiredPosition (editor, tipWindow, out w, out xalign);
			w += 10;

			int x = mouseX + ox + editor.Allocation.X;
			int y = mouseY + oy + editor.Allocation.Y;
			Gdk.Rectangle geometry = editor.Screen.GetUsableMonitorGeometry (editor.Screen.GetMonitorAtPoint (x, y));
			
			x -= (int) ((double) w * xalign);
			y += 10;
			
			if (x + w >= geometry.X + geometry.Width)
				x = geometry.X + geometry.Width - w;
			if (x < geometry.Left)
				x = geometry.Left;
			
			int h = tipWindow.SizeRequest ().Height;
			if (y + h >= geometry.Y + geometry.Height)
				y = geometry.Y + geometry.Height - h;
			if (y < geometry.Top)
				y = geometry.Top;
			
			tipWindow.Move (x, y);
			
			tipWindow.ShowAll ();

			return tipWindow;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:35,代码来源:TooltipProvider.cs


示例2: GetLineHeight

		public double GetLineHeight (MonoTextEditor editor)
		{
			return editor.LineHeight;
			/*
			if (!IsVisible || DebuggingService.IsDebugging)
				return editor.LineHeight;
			
			if (editorAllocHeight == editor.Allocation.Width && lastLineLength == lineSegment.EditableLength)
				return lastHeight;
			
			CalculateLineFit (editor, lineSegment);
			double height;
			if (CollapseExtendedErrors) {
				height = editor.LineHeight;
			} else {
				// TODO: Insert virtual lines, if required
				height = UseVirtualLines ? editor.LineHeight * errors.Count : editor.LineHeight;
			}
			
			if (!fitsInSameLine)
				height += editor.LineHeight;
			
			editorAllocHeight = editor.Allocation.Height;
			lastLineLength = lineSegment.EditableLength;
			lastHeight = height;
			
			return height;*/
		}
开发者ID:ArsenShnurkov,项目名称:monodevelop,代码行数:28,代码来源:MessageBubbleTextMarker.cs


示例3: BounceFadePopupWindow

		public BounceFadePopupWindow (MonoTextEditor editor) : base (Gtk.WindowType.Popup)
		{
			if (!IsComposited)
				throw new InvalidOperationException ("Only works with composited screen. Check Widget.IsComposited.");
			if (editor == null)
				throw new ArgumentNullException ("Editor");
			DoubleBuffered = true;
			Decorated = false;
			BorderWidth = 0;
			HasFrame = true;
			this.editor = editor;
			Events = Gdk.EventMask.ExposureMask;
			Duration = 500;
			ExpandWidth = 12;
			ExpandHeight = 2;
			BounceEasing = Easing.Sine;
			
			var rgbaColormap = Screen.RgbaColormap;
			if (rgbaColormap == null)
				return;
			Colormap = rgbaColormap;

			stage.ActorStep += OnAnimationActorStep;
			stage.Iteration += OnAnimationIteration;
			stage.UpdateFrequency = 10;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:26,代码来源:BounceFadePopupWindow.cs


示例4: DrawIcon

		static void DrawIcon (MonoTextEditor editor, Cairo.Context cr, DocumentLine lineSegment, double x, double y, double width, double height)
		{
			if (lineSegment.IsBookmarked) {
				var color1 = editor.ColorStyle.Bookmarks.Color;
				var color2 = editor.ColorStyle.Bookmarks.SecondColor;
				
				DrawRoundRectangle (cr, x + 1, y + 1, 8, width - 4, height - 4);

				// FIXME: VV: Remove gradient features
				using (var pat = new Cairo.LinearGradient (x + width / 4, y, x + width / 2, y + height - 4)) {
					pat.AddColorStop (0, color1);
					pat.AddColorStop (1, color2);
					cr.SetSource (pat);
					cr.FillPreserve ();
				}

				// FIXME: VV: Remove gradient features
				using (var pat = new Cairo.LinearGradient (x, y + height, x + width, y)) {
					pat.AddColorStop (0, color2);
					//pat.AddColorStop (1, color1);
					cr.SetSource (pat);
					cr.Stroke ();
				}
			}
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:25,代码来源:BookmarkMarker.cs


示例5: GetItem

		public override async Task<TooltipItem> GetItem (MonoTextEditor editor, int offset, CancellationToken token = default(CancellationToken))
		{
			var wrappedEditor = WrapEditor (editor);
			if (wrappedEditor == null)
				return null;
			var doc = IdeApp.Workbench.ActiveDocument;
			if (doc == null)
				return null;
			var task = provider.GetItem (wrappedEditor, doc, offset, token);
			if (task == null) {
				LoggingService.LogWarning ("Tooltip provider " + provider + " gave back null on GetItem (should always return a non null task).");
				return null;
			}
			var item = await task;
			if (item == null)
				return null;
			if (lastUnwrappedItem != null) {
				if (lastUnwrappedItem.Offset == item.Offset &&
					lastUnwrappedItem.Length == item.Length &&
					lastUnwrappedItem.Item.Equals (item.Item)) {
					return lastWrappedItem;
				}
			}
			lastUnwrappedItem = item;
			return lastWrappedItem = new TooltipItem (item.Item, item.Offset, item.Length);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:26,代码来源:TooltipProviderWrapper.cs


示例6: ColorShemeEditor

		public ColorShemeEditor (HighlightingPanel panel)
		{
			this.panel = panel;
			this.Build ();
			textEditor = new MonoTextEditor ();
			textEditor.Options = new StyledSourceEditorOptions (MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance);
			this.scrolledwindowTextEditor.Child = textEditor;
			textEditor.ShowAll ();
			
			this.treeviewColors.AppendColumn (GettextCatalog.GetString ("Name"), new Gtk.CellRendererText (), new CellLayoutDataFunc (SyntaxCellRenderer));
			this.treeviewColors.HeadersVisible = false;
			this.treeviewColors.Model = colorStore;
			this.treeviewColors.SearchColumn = -1; // disable the interactive search
			this.treeviewColors.Selection.Changed += HandleTreeviewColorsSelectionChanged;
			this.hpaned1.Position = 250;
			this.SetSizeRequest (1024, 768);

			this.colorbuttonFg.ColorSet += Stylechanged;
			this.colorbuttonBg.ColorSet += Stylechanged;
			this.colorbuttonPrimary.ColorSet += Stylechanged;
			this.colorbuttonSecondary.ColorSet += Stylechanged;
			this.colorbuttonBorder.ColorSet += Stylechanged;
			colorbuttonBg.UseAlpha = true;
			this.checkbuttonBold.Toggled += Stylechanged;
			this.checkbuttonItalic.Toggled += Stylechanged;
			
			this.buttonOk.Clicked += HandleButtonOkClicked;
			HandleTreeviewColorsSelectionChanged (null, null);
			notebookColorChooser.ShowTabs = false;
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:30,代码来源:ColorShemeEditor.cs


示例7: GutterMargin

		public GutterMargin (MonoTextEditor editor)
		{
			this.editor = editor;

			this.editor.Document.LineChanged += UpdateWidth;
			this.editor.Document.TextSet += HandleEditorDocumenthandleTextSet;
			this.editor.Caret.PositionChanged += EditorCarethandlePositionChanged;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:GutterMargin.cs


示例8: WrapEditor

		static MonoDevelop.Ide.Editor.TextEditor WrapEditor (MonoTextEditor editor)
		{
			foreach (var doc in IdeApp.Workbench.Documents) {
				if (doc.FileName == editor.FileName)
					return doc.Editor;
			}
			return null;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:TooltipProviderWrapper.cs


示例9: FoldMarkerMargin

		public FoldMarkerMargin (MonoTextEditor editor)
		{
			this.editor = editor;
			layout = PangoUtil.CreateLayout (editor);
			editor.Caret.PositionChanged += HandleEditorCaretPositionChanged;
			editor.Document.FoldTreeUpdated += HandleEditorDocumentFoldTreeUpdated;
			editor.Caret.PositionChanged += EditorCarethandlePositionChanged;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:FoldMarkerMargin.cs


示例10: DrawBackground

		public override bool DrawBackground (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics)
		{
			if (metrics.SelectionStart > 0)
				return true;
			cr.SetSourceColor (color);
			cr.Rectangle (metrics.TextRenderStartPosition, metrics.LineYRenderStartPosition, metrics.TextRenderEndPosition - metrics.TextRenderStartPosition, editor.LineHeight);
			cr.Fill ();
			return true;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:9,代码来源:LineBackgroundMarker.cs


示例11: ActionMargin

		public ActionMargin (MonoTextEditor editor)
		{
			if (editor == null)
				throw new ArgumentNullException ("editor");
			this.editor = editor;
			marginWidth = 20;
			IsVisible = false;
			this.editor.Caret.PositionChanged += HandlePositionChanged;;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:9,代码来源:ActionMargin.cs


示例12: TextEventArgsWrapper

		void IActionTextLineMarker.MouseHover (MonoTextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
		{
			MouseHover?.Invoke (this, new TextEventArgsWrapper (args));
			result.Cursor = textLinkCursor;
			if (OnlyShowLinkOnHover) {
				editor.GetTextEditorData ().Document.CommitLineUpdate (args.LineSegment);
				editor.TextViewMargin.HoveredLineChanged += new UpdateOldLine (editor, args.LineSegment).TextViewMargin_HoveredLineChanged;
			}
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:9,代码来源:LinkMarker.cs


示例13:

		bool IActionTextLineMarker.MouseReleased (MonoTextEditor editor, MarginMouseEventArgs args)
		{
			if ((Platform.IsMac && (args.ModifierState & Gdk.ModifierType.Mod2Mask) == Gdk.ModifierType.Mod2Mask) ||
			    (!Platform.IsMac && (args.ModifierState & Gdk.ModifierType.ControlMask) == Gdk.ModifierType.ControlMask))
				activateLink?.Invoke (LinkRequest.RequestNewView);
			else
				activateLink?.Invoke (LinkRequest.SameView);
			
			return false;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:10,代码来源:LinkMarker.cs


示例14: ViStatusArea

		public ViStatusArea (MonoTextEditor editor)
		{
			this.editor = editor;
			editor.TextViewMargin.CaretBlink += HandleCaretBlink;
			editor.Caret.PositionChanged += HandlePositionChanged;

			editor.AddTopLevelWidget (this, 0, 0);
			((MonoTextEditor.EditorContainerChild)editor[this]).FixedPosition = true;
			Show ();
		}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:10,代码来源:ViStatusArea.cs


示例15: GotoLineNumberWidget

		public GotoLineNumberWidget (MonoTextEditor textEditor, Widget frame)
		{
			this.textEditor = textEditor;
			this.frame = frame;
			this.Build ();
			
			StoreWidgetState ();
			textEditor.Parent.SizeAllocated += HandleViewTextEditorhandleSizeAllocated;
			
			//HACK: GTK rendering issue on Mac, images don't repaint unless we put them in visible eventboxes
			if (MonoDevelop.Core.Platform.IsMac) {
				foreach (var eb in new [] { eventbox1, eventbox2 }) {
					eb.VisibleWindow = true;
					eb.ModifyBg (StateType.Normal, new Gdk.Color (230, 230, 230));
				}
			}
			this.closeButton.Clicked += delegate {
				RestoreWidgetState ();
				CloseWidget ();
			};
			
			this.buttonGoToLine.Clicked += delegate {
				cleanExit = true;
				GotoLine ();
				CloseWidget ();
			};
			
			foreach (Gtk.Widget child in this.Children) {
				child.KeyPressEvent += delegate (object sender, Gtk.KeyPressEventArgs args) {
					if (args.Event.Key == Gdk.Key.Escape) {
						RestoreWidgetState ();
						CloseWidget ();
					}
				};
			}
			
			Gtk.Widget oldWidget = null;
			this.FocusChildSet += delegate (object sender, Gtk.FocusChildSetArgs args) {
				// only store state when the focus comes from a non child widget
				if (args.Widget != null && oldWidget == null)
					StoreWidgetState ();
				oldWidget = args.Widget;
			};
			
			this.entryLineNumber.Changed += delegate {
				PreviewLine ();
			};
				
			this.entryLineNumber.Activated += delegate {
				cleanExit = true;
				GotoLine ();
				CloseWidget ();
			};
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:54,代码来源:GotoLineNumberWidget.cs


示例16: InternalHandleKeypress

	//	string status;
		
		public void InternalHandleKeypress (MonoTextEditor editor, TextEditorData data, Gdk.Key key, 
		                                      uint unicodeChar, Gdk.ModifierType modifier)
		{
			this.editor = editor; 
			this.textEditorData = data;
			
			HandleKeypress (key, unicodeChar, modifier);
			
			//make sure that nothing funny goes on when the mode should have finished
			this.textEditorData = null;
			this.editor = null;
		}
开发者ID:ArsenShnurkov,项目名称:monodevelop,代码行数:14,代码来源:EditMode.cs


示例17: InternalCaretPositionChanged

		internal void InternalCaretPositionChanged (MonoTextEditor editor, TextEditorData data)
		{
			// only trigger CaretPositionChanged when event is a result of external stimuli, i.e. when 
			// not already running HandleKeypress
			if (this.editor == null) {
				this.editor = editor; 
				this.textEditorData = data;
				CaretPositionChanged ();
				this.textEditorData = null;
				this.editor = null;
			}
		}
开发者ID:ArsenShnurkov,项目名称:monodevelop,代码行数:12,代码来源:EditMode.cs


示例18: DrawForeground

		public override void DrawForeground (MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
		{
			double size = metrics.Margin.Width;
			double borderLineWidth = cr.LineWidth;

			double x = Math.Floor (metrics.Margin.XOffset - borderLineWidth / 2);
			double y = Math.Floor (metrics.Y + (metrics.Height - size) / 2);

			var deltaX = size / 2 - DebugIcon.Width / 2 + 0.5f;
			var deltaY = size / 2 - DebugIcon.Height / 2 + 0.5f;

			cr.DrawImage (editor, DebugIcon, Math.Round (x + deltaX), Math.Round (y + deltaY));
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:13,代码来源:DebugTextMarker.cs


示例19: FoldingScreenbackgroundRenderer

		public FoldingScreenbackgroundRenderer (MonoTextEditor editor, IEnumerable<FoldSegment> foldSegments)
		{
			this.editor = editor;
			this.foldSegments = new List<FoldSegment> (foldSegments);
			startTime = DateTime.Now;
			timeout = GLib.Timeout.Add (30, delegate {
				editor.QueueDraw ();
				var cont = (DateTime.Now - startTime).TotalMilliseconds < animationLength;
				if (!cont)
					timeout = 0;
				return cont;
			});
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:13,代码来源:FoldingScreenbackgroundRenderer.cs


示例20: Update

		public override void Update (MonoTextEditor editor)
		{
			var startLine = editor.GetLine (start);
			if (start == end) {
				editor.TextViewMargin.RemoveCachedLine (startLine);
				editor.RedrawLine (start);
			} else {
				for (int i = 0; startLine != null && i < end - start; i++) {
					editor.TextViewMargin.RemoveCachedLine (startLine);
					startLine = startLine.NextLine;
				}
				editor.RedrawLines (start, end);
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:14,代码来源:DocumentUpdateRequest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MonoTouch类代码示例发布时间:2022-05-24
下一篇:
C# MonoMac类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap