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


C# TextEditor.ShowAll方法代码示例

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


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

示例1: Initialize

        public override void Initialize(IPadWindow window)
        {
            base.Initialize(window);

            // Call ctors
            inputEditor = new TextEditor() { Name = "input", Events = Gdk.EventMask.AllEventsMask, HeightRequest = 80 };
            editor = new TextEditor() { Name = "output", Events = Gdk.EventMask.AllEventsMask };
            vpaned = new Gtk.VPaned();
            var scr1 = new Gtk.ScrolledWindow();
            var scr2 = new Gtk.ScrolledWindow();

            // Init layout
            scr1.ShadowType = Gtk.ShadowType.In;
            scr1.Child = inputEditor;
            vpaned.Add1(scr1);
            scr1.ShowAll();
            inputEditor.ShowAll();

            scr2.ShadowType = Gtk.ShadowType.In;
            scr2.Child = editor;
            vpaned.Add2(scr2);
            scr2.ShowAll();
            editor.ShowAll();

            vpaned.ShowAll();

            // Init editors
            var o = editor.Options;
            inputEditor.Options = o;
            o.ShowLineNumberMargin = false;
            o.ShowFoldMargin = false;
            o.ShowIconMargin = false;

            editor.Document.ReadOnly = true;
            inputEditor.Text = PropertyService.Get(lastInputStringPropId, string.Empty);
            editor.Text = string.Empty;
            editor.Document.SyntaxMode = new Highlighting.DSyntaxMode();
            inputEditor.Document.SyntaxMode = new Highlighting.DSyntaxMode();
            editor.Document.MimeType = Formatting.DCodeFormatter.MimeType;
            inputEditor.Document.MimeType = Formatting.DCodeFormatter.MimeType;

            // Init toolbar
            var tb = window.GetToolbar(Gtk.PositionType.Top);

            executeButton = new Gtk.Button();
            executeButton.Image = new Gtk.Image(Gtk.Stock.Execute, Gtk.IconSize.Menu);
            executeButton.TooltipText = "Evaluates the expression typed in the upper input editor.";
            executeButton.Clicked += Execute;
            tb.Add(executeButton);

            abortButton = new Gtk.Button();
            abortButton.Sensitive = false;
            abortButton.Image = new Gtk.Image(Gtk.Stock.Stop, Gtk.IconSize.Menu);
            abortButton.TooltipText = "Stops the evaluation.";
            abortButton.Clicked += (object sender, EventArgs e) => AbortExecution();
            tb.Add(abortButton);

            tb.ShowAll();
        }
开发者ID:simendsjo,项目名称:Mono-D,代码行数:59,代码来源:ExpressionEvaluationWidget.cs

示例2: Initialize

		public override void Initialize(IPadWindow pad)
		{
			base.Initialize(pad);

			// Init editor
			outputEditor = new TextEditor();
			outputEditor.Events = Gdk.EventMask.AllEventsMask;
			outputEditor.Name = "outputEditor";
			outputEditor.TabsToSpaces = false;
			
			scrolledWindow = new Gtk.ScrolledWindow();
			scrolledWindow.Child = outputEditor;
			scrolledWindow.ShadowType = Gtk.ShadowType.In;
			scrolledWindow.ShowAll();
			outputEditor.ShowAll();

			var o = outputEditor.Options;
			outputEditor.Document.MimeType = Formatting.DCodeFormatter.MimeType;
			o.ShowLineNumberMargin = false;
			o.ShowFoldMargin = false;
			o.ShowIconMargin = false;
			outputEditor.Document.ReadOnly = true;


			// Init toolbar
			var tb = pad.GetToolbar(Gtk.PositionType.Top);

			var ch = new Gtk.ToggleButton();
			ch.Image = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Menu);
			ch.Active = EnableCaretTracking;
			ch.TooltipText = "Toggle automatic update after the caret has been moved.";
			ch.Toggled += (object s, EventArgs ea) => EnableCaretTracking = ch.Active;
			tb.Add(ch);

			abortButton = new Gtk.Button();
			abortButton.Sensitive = false;
			abortButton.Image = new Gtk.Image(Gtk.Stock.Stop, Gtk.IconSize.Menu);
			abortButton.TooltipText = "Stops the evaluation.";
			abortButton.Clicked += (object sender, EventArgs e) => AbortExecution();
			tb.Add(abortButton);

			tb.ShowAll();
			Instance = this;
		}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:44,代码来源:MixinInsightPad.cs


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