public MeadowPadWidget(MeadowSerialDevice meadow, MeadowPad meadowPad)
        {
            meadowSerialDevice = meadow;
            this.meadowPad     = meadowPad;
            this.Build();

            meadowOS = new Lazy <MeadowOS>(() => new MeadowOS(meadowPad));

            Gdk.Pixbuf image = Gdk.Pixbuf.LoadFromResource("Meadow.Sdks.IdeExtensions.Vs4Mac.MeadowLogo.png");

            // Gtk.ListStore list = new Gtk.ListStore(typeof(Gdk.Pixbuf));
            image = image.ScaleSimple(30, 20, Gdk.InterpType.Bilinear);

            image1.Pixbuf = image;


            iter = textview1.Buffer.EndIter;
            this.textview1.ModifyFont(FontDescription.FromString(MonoDevelop.Ide.Fonts.FontService.MonospaceFontName));
            this.labelState.ModifyFont(FontDescription.FromString(MonoDevelop.Ide.Fonts.FontService.MonospaceFontName));

            LoadTags();

            textview1.SizeAllocated            += Textview1_SizeAllocated;
            meadowSerialDevice.OnMeadowMessage += MeadowData;


            //Textview background. Cant get this to work
            //textview1.Realized += (sender, e) =>
            //{
            //    Gdk.Pixbuf image = Gdk.Pixbuf.LoadFromResource("Meadow.Sdks.IdeExtensions.Vs4Mac.MeadowLogo.png");
            //    Gdk.Pixmap pixmap, pixmap_mask;
            //    image.RenderPixmapAndMask(out pixmap, out pixmap_mask, 0);
            //    textview1.GdkWindow.SetBackPixmap(pixmap, false);
            //};
        }
Пример #2
0
        public MeadowDeviceExecutionTarget(MeadowSerialDevice meadowSerialDevice, Connection connection = null)
        {
            this.meadowSerialDevice = meadowSerialDevice;
            var waitHandle = new ManualResetEventSlim(false);

            Gtk.Application.Invoke(delegate
                                   { try
                                     {
                                         meadowPad   = new MeadowPad(this, meadowSerialDevice);
                                         var pad     = MonoDevelop.Ide.IdeApp.Workbench.ShowPad(meadowPad, (PadID++).ToString(), "Meadow", "bottom", MonoDevelop.Components.Docking.DockItemStatus.Dockable, new IconId("meadow"));
                                         pad.Visible = true;
                                         pad.IsOpenedAutomatically = true;
                                         pad.BringToFront();

                                         waitHandle.Set();
                                     }
                                     catch (Exception ex)
                                     {
                                         Console.WriteLine($"MeadowDeviceExecutionTarget: Error {ex.Message}");
                                     } });
            if (waitHandle.Wait(3000))
            {
                meadowSerialDevice.StatusChange   += StatusDisplay;
                meadowSerialDevice.RunStateChange += RunState;
                if (meadowSerialDevice.RunState.HasValue)
                {
                    meadowPad.control.SetRunState(meadowSerialDevice.RunState.Value);
                }
                meadowSerialDevice.connection = connection;
                Gtk.Application.Invoke(delegate
                {
                    meadowPad.Window.Title = meadowSerialDevice.connection.ToString();
                });
            }
            else
            {
                MessageDialog dialog = new MessageDialog(IdeApp.Workbench.RootWindow, DialogFlags.DestroyWithParent,
                                                         MessageType.Info, ButtonsType.Ok,
                                                         "Failed to open Meadow console window");
            }
        }
Пример #3
0
        //[SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions", Justification = "Sample code")]
        //[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Default event handler naming pattern")]

        public MeadowOS(MeadowPad meadowPad)
        {
            this.meadowPad = meadowPad;
        }