Exemplo n.º 1
0
        static void updateTh_method()
        {
            while (true)
            {
                stateChanged.WaitOne();
                while (stateChanged.WaitOne(400))
                {
                    ;
                }

                DispatchService.GuiSyncDispatch(() =>
                {
                    var p = Ide.IdeApp.Workbench.GetPad <MixinInsightPad>();
                    if (p == null)
                    {
                        return;
                    }

                    pad = p.Content as MixinInsightPad;
                });

                if (pad != null && pad.Window.ContentVisible)
                {
                    pad.Update();
                }
            }
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
		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;
		}
Exemplo n.º 4
0
        static void updateTh_method()
        {
            while (true)
            {
                stateChanged.WaitOne();
                while (stateChanged.WaitOne(400));

                DispatchService.GuiSyncDispatch(() =>
                {
                    var p = Ide.IdeApp.Workbench.GetPad<MixinInsightPad>();
                    if (p == null)
                        return;

                    pad = p.Content as MixinInsightPad;
                });

                if (pad != null && pad.Window.ContentVisible)
                    pad.Update();
            }
        }